(define-library (config sway) (export sway-config) (import (scheme base) (config-generation sway)) (begin (define screenshot-menu "guile --r7rs -L ~/src/wofi-guile/lib/ ~/src/screenshot-menu.scm") (define sway-config (scm->sway-config ;;; Variables `((set $mod Mod4 ; Logo key. Use Mod1 for Alt. $hyper Mod1+Mod4+Shift+Control $meh Mod1+Shift+Control ;; Home row directions keys, like vim. $left h $down j $up k $right l ;; Prefered terminal emulator $term "foot" ;; Preferred editor $editor "emacsclient -c -a emacs" ;; Preferred application launcher $menu "wofi -c ~/.config/wofi/config -I" ;; Preferred music player $music "foot cmus") ;; Output configuration (output ((* bg "#2E3440" solid_color) (HDMI-A-1 mode 1920x1080@144Hz))) ;; Input configuration ;; (input "9580:110:HUION_Huion_Tablet_Pen" map_to_output HDMI-A-1) ;; Hide cursor after 3 seconds (seat * hide_cursor 3000) (input "1133:50504:Logitech_USB_Receiver_Mouse" ((accel_profile flat) (pointer_accel -0.4))) ;;; Key bindings (bindsyms ;; Kill focused window ;; (($mod+Shift+q $meh+q) kill) ;; Start launcher ;; (($hyper+d $mod+d) exec $menu) ;; Reload the config file ;; ($mod+Shift+c reload) ;; Lock sway (($meh+l $mod+Semicolon) exec swaylock -c "#000000") ;; Exit sway ;; ($mod+Shift+e exec swaynag -t warning -m "You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session." -b "Yes, exit sway" "herd stop sway") ;; Screenshot menu ($meh+a exec ,screenshot-menu)) ;; Drag floating windows by holding down $mod and left mouse button. ;; Resize them with right mouse button + $mod. ;; Also works for non-floating windows. ;; Change normal to inverse to use left mouse buttor for resizing and right ;; mouse button for dragging. (floating_modifier $mod normal) ;; Moving around ;; (bindsyms ;; ;; Moving focus around ;; (($mod+$left $mod+Left) focus left) ;; (($mod+$down $mod+Down) focus down) ;; (($mod+$up $mod+Up) focus up) ;; (($mod+$right $mod+Right) focus right) ;; ;; Move the focused window by adding Shift ;; (($mod+Shift+$left $mod+Shift+Left) move left) ;; (($mod+Shift+$down $mod+Shift+Down) move down) ;; (($mod+Shift+$up $mod+Shift+Up) move up) ;; (($mod+Shift+$right $mod+Shift+Right) move right)) ;; Workspaces (bindsyms ;; Switch to workspace ;; ($mod+1 workspace number 1) ;; ($mod+2 workspace number 2) ;; ($mod+3 workspace number 3) ;; ($mod+4 workspace number 4) ;; ($mod+5 workspace number 5) ;; ($mod+6 workspace number 6) ;; ($mod+7 workspace number 7) ;; ($mod+8 workspace number 8) ;; ($mod+9 workspace number 9) ;; ($mod+0 workspace number 10) ;; Move focused container to workspace ;; ($mod+Shift+1 move container to workspace number 1) ;; ($mod+Shift+2 move container to workspace number 2) ;; ($mod+Shift+3 move container to workspace number 3) ;; ($mod+Shift+4 move container to workspace number 4) ;; ($mod+Shift+5 move container to workspace number 5) ;; ($mod+Shift+6 move container to workspace number 6) ;; ($mod+Shift+7 move container to workspace number 7) ;; ($mod+Shift+8 move container to workspace number 8) ;; ($mod+Shift+9 move container to workspace number 9) ;; ($mod+Shift+0 move container to workspace number 10) ;; Split the current object ;; ($mod+b splith) ;; ($mod+v splitv) ;; Switch the current container layout style ;; ($mod+s layout stacking) ;; ($mod+w layout tabbed) ;; ($mod+e layout toggle split) ;; Make the current focus fullscreen ;; ($mod+f fullscreen) ;; Toggle focus between tiling and floating mode ;; ($mod+Shift+space floating toggle) ;; Swap focus between the tiling area and the floating area ;; ($mod+space focus mode_toggle) ;; Move focus to the parent container ;; ($mod+a focus parent) ) ;;; Scratchpad ;; (bindsyms ;; ;; Move the currently focused window to the scratchpad ;; ($mod+Shift+minus move scratchpad) ;; ;; Show the next scratchpad window or hide the focused scratchpad window. ;; ;; If there are multiple scratchpad windows, this command cycles through them. ;; ($mod+minus scratchpad show)) ;;; Resizing ;; (mode "resize" ;; ((bindsyms ;; (($left Left) resize shrink width 10px) ;; (($down Down) resize grow height 10px) ;; (($up Up) resize shrink height 10px) ;; (($right Right) resize grow width 10px) ;; ;; Return to default mode ;; (Return mode "default") ;; (Escape mode "default")))) ;; (bindsym $mod+r mode "resize") ;;; Media (bindsyms (XF86AudioRaiseVolume exec pamixer --increase 5) (XF86AudioLowerVolume exec pamixer --decrease 5) (XF86AudioMute exec pamixer --toggle-mute) (XF86AudioPlay exec emacsclient -e "(emms-pause)") (XF86AudioNext exec emacsclient -e "(emms-next)") (XF86AudioPrev exec emacsclient -e "(emms-previous)") (XF86Search exec $menu)) ;; Applications (bindsyms ;; Start music player on workspace 5 ($hyper+m (workspace 5) (exec $music) (workspace back_and_forth)) ;; Start terminal ;; (($mod+Return $mod+Shift+t) exec emacsclient -c -e "(new-eshell)") ;; Start editor (($mod+t $hyper+t) exec $editor)) ;; TODO REMOVE (exec "hash dbus-update-activation-environment 2>/dev/null") (exec_always "dbus-update-activation-environment --all") (exec "dbus-update-activation-environment DISPLAY MOZ_DBUS_REMOTE") ;;; Styling (font "pango:Noto Sans Mono" 8) (titlebar_padding 7 1) ;; Remove titlebar by default (for-window (title ".*") border pixel 2) (for-window (class ".*") inhibit_idle fullscreen) (for-window (app_id ".*") inhibit_idle fullscreen) ;; Class border backgr. text indicator child_border (client.focused "#bf616a" "#bf616a" "#ffffff" "#bf616a" "#bf616a") (client.focused_inactive "#333333" "#5f676a" "#ffffff" "#484e50" "#5f676a") (client.unfocused "#333333" "#222222" "#888888" "#292d2e" "#222222") (client.urgent "#2f343a" "#900000" "#ffffff" "#900000" "#900000") (client.placeholder "#000000" "#0c0c0c" "#ffffff" "#000000" "#0c0c0c"))))))