dotfiles/sway/config
2026-04-15 16:30:27 +02:00

255 lines
9.5 KiB
Plaintext

# Variabili di base
set $mod Mod4
set $term foot
set $laptop eDP-1
set $benq DP-9
# Imposta il profilo ICC, risoluzione, posizione e scala per il display laptop
output $laptop color_profile icc ~/Documents/dotfiles/sway/FRAMEWORK_13_BOE_ICC/BOE_CQ_______NE135FBM_N41_03.icm
output $laptop resolution 2256x1504 position 0,0
output $laptop scale 1.3
# Configure BenQ display
output $laptop color_profile icc ~/Documents/dotfiles/sway/BENQ_PD2706QN_ICC/'Display P3.icc'
output $benq resolution 2560x1440@99.990Hz position 0,0
output $laptop scale 1.3
# Gestione degli eventi del coperchio
bindswitch --reload --locked lid:on exec ~/Documents/dotfiles/sway/scripts/lid.sh on $laptop
bindswitch --reload --locked lid:off exec ~/Documents/dotfiles/sway/scripts/lid.sh off $laptop
input type:touchpad {
dwt disabled # Disable while typing - RIATTIVA QUESTA OPZIONE
tap enabled # Enable tap-to-click
natural_scroll enabled # Natural scrolling
middle_emulation enabled # Emulate middle mouse button - RIATTIVA QUESTA OPZIONE
accel_profile "flat" # Acceleration profile
pointer_accel 0.3
drag enabled # AGGIUNGI: Abilita il drag
drag_lock disabled # AGGIUNGI: Disabilita il drag lock
tap_button_map lrm # AGGIUNGI: Mappa dei pulsanti per il tap
}
input type:pointer {
accel_profile "flat" # disable mouse acceleration (enabled by default; to set it manually, use "adaptive" instead of "flat")
pointer_accel 0.3
}
# Gestione dei gesti: swipe per cambiare workspace
bindgesture swipe:right workspace prev
bindgesture swipe:left workspace next
### Key Bindings di base
# Avvio terminale
bindsym $mod+Return exec $term
# Chiudi finestra focalizzata
bindsym $mod+Shift+q kill
set $ipc /usr/sbin/qs -c noctalia-shell ipc call
# Avvia il launcher
bindsym $mod+d exec $ipc launcher toggle
# Modalità floating: trascina finestre con $mod + mouse
floating_modifier $mod normal
# Ricarica la configurazione
bindsym $mod+Shift+c reload
### Navigazione e spostamento tra finestre
# Sposta il focus
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# Sposta la finestra focalizzata
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
### Gestione dei Workspaces
# Cambio workspace (1-10)
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10
# Sposta la finestra corrente nel workspace desiderato
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
### Gestione del Layout
# Split orizzontale e verticale
bindsym $mod+Shift+b splith
bindsym $mod+Shift+v splitv
# Cambio layout: stacking, tabbed e toggle split
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# Modalità fullscreen
bindsym $mod+f fullscreen
# Toggle tra modalità tiling e floating
bindsym $mod+Shift+space floating toggle
# Passa dal tiling alla sezione floating
bindsym $mod+space focus mode_toggle
# Sposta il focus al contenitore padre
bindsym $mod+a focus parent
### Scratchpad
bindsym $mod+Shift+minus move scratchpad
bindsym $mod+minus scratchpad show
### Modalità "resize" per ridimensionare le finestre
mode "resize" {
bindsym Left resize shrink width 10px
bindsym Down resize grow height 10px
bindsym Up resize shrink height 10px
bindsym Right resize grow width 10px
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
bindsym --locked XF86AudioRaiseVolume exec $ipc volume increase
bindsym --locked XF86AudioLowerVolume exec $ipc volume decrease
bindsym --locked XF86AudioMute exec $ipc volume muteOutput
bindsym --locked XF86MonBrightnessUp exec $ipc brightness increase
bindsym --locked XF86MonBrightnessDown exec $ipc brightness decrease
# Controlli multimediali
bindsym XF86AudioPlay exec $ipc media playPause
bindsym XF86AudioNext exec $ipc media next
bindsym XF86AudioPrev exec $ipc media previous
bindsym $mod+Shift+h exec handy --toggle-transcription
bindsym $mod+v exec $ipc launcher clipboard
### Screenshot e Registrazione Schermo
bindsym Print exec grimshot --notify copy output && \
notify-send -u normal "📸 Screenshot" "Full screen copied to clipboard"
# Screenshot selected area
bindsym $mod+Print exec grimshot --notify copy area && \
notify-send -u normal "📸 Screenshot" "Selected area copied to clipboard"
# Alternative bindings
bindsym $mod+P exec grimshot --notify copy output && \
notify-send -u normal "📸 Screenshot" "Full screen copied to clipboard"
bindsym $mod+Shift+P exec grimshot --notify copy area && \
notify-send -u normal "📸 Screenshot" "Selected area copied to clipboard"
# this one includes audio track in the recording
bindsym $mod+XF86AudioMedia exec ~/.config/sway/scripts/screen-recording.sh audio
# this one not
bindsym XF86AudioMedia exec ~/.config/sway/scripts/screen-recording.sh
### Borders e Gaps
default_border pixel
smart_gaps on
gaps outer 2
gaps inner 3
# Impostazioni dei colori per il focus delle finestre
# client.focused $gruvbox_orange $gruvbox_orange $gruvbox_bg_dark $gruvbox_orange
hide_edge_borders smart
### Impostazioni GTK per tema scuro
set $qt_theme qt5ct
exec_always {
# Questi servono ancora per le app GTK4/Libadwaita native
gsettings set org.gnome.desktop.interface gtk-theme 'adw-gtk3-dark'
gsettings set org.gnome.desktop.interface icon-theme 'Adwaita'
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
# Forza il refresh delle variabili ambiente
systemctl --user import-environment QT_QPA_PLATFORMTHEME
}
# sudo pacman -S xorg-xhost
# xhost +SI:localuser:root
exec xhost +SI:localuser:root
# Aggiungi QT_QPA_PLATFORMTHEME alla lista delle variabili da importare
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP QT_QPA_PLATFORMTHEME
exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP SWAYSOCK QT_QPA_PLATFORMTHEME=$qt_theme
### Applicazioni in autostart
exec keepassxc
exec nextcloud
# exec wlsunset -S 08:00 -s 18:00
exec blueman-applet
# exec xss-lock -- swaylock -f -i $wallpaper
exec --no-startup-id easyeffects --gapplication-service
exec --no-startup-id wluma
# Avvio del polkit agent GNOME
# exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
# (Se preferisci il KDE agent, commenta la riga sopra e decommenta quella sottostante)
# exec "/usr/lib/polkit-kde-authentication-agent-1"
exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec --no-startup-id gnome-keyring-daemon --start --components=pkcs11,secrets,ssh
# Importa variabili ambiente per DBus e il desktop corrente
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
exec dbus-update-activation-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP SWAYSOCK I3SOCK XCURSOR_SIZE XCURSOR_THEME
### Notifiche Desktop e Clip History
# exec swaync
# exec mako
### Applet di rete
exec nm-applet --indicator
exec handy --start-hidden # speek to text
exec wl-paste --type text --watch cliphist store # Stores only text data
exec wl-paste --type image --watch cliphist store # Stores only image data
exec_always sh -c '/usr/bin/pkill -x qs || true; exec /usr/sbin/qs -d -c noctalia-shell'
# comando per capire come si chiama l'id della app per le regole delle finestre
# swaymsg -t get_tree
### Regole personalizzate per le finestre
for_window [app_id="blueman-manager"] floating enable, resize set width 70 ppt height 60 ppt
for_window [app_id="org.keepassxc.KeePassXC"] floating enable, resize set width 70 ppt height 60 ppt
for_window [instance="keepassxc"] floating enable, resize set width 70 ppt height 60 ppt
for_window [app_id="pavucontrol"] floating enable, resize set width 70 ppt height 60 ppt
for_window [app_id="org.gnome.Nautilus"] floating enable, resize set width 60 ppt height 50 ppt
for_window [app_id="thunar"] floating enable, resize set width 60 ppt height 50 ppt
for_window [window_role="pop-up"] floating enable
for_window [window_role="bubble"] floating enable
for_window [window_role="Preferences"] floating enable
for_window [window_type="dialog"] floating enable
for_window [window_type="menu"] floating enable
for_window [window_role="About"] floating enable
for_window [title="File Operation Progress"] floating enable, border pixel 1, sticky enable, resize set width 40 ppt height 30 ppt
for_window [app_id="floating_shell_portrait"] floating enable, border pixel 1, sticky enable, resize set width 30 ppt height 40 ppt
for_window [title="Picture in picture"] floating enable, sticky enable
for_window [title="Save File"] floating enable
for_window [app_id="firefox" title="Firefox — Sharing Indicator"] kill
include ~/.config/sway/noctalia