diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-04 10:25:48 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-04 10:28:51 -0700 |
commit | 8c52926df4fb12ab571f71414edaf3279c337ac7 (patch) | |
tree | 52cb55edc9c7c0230a167e34591866949faebafc /.config/sway | |
parent | 752aa419fde8838f79115ee109bcdbd7d6e9230e (diff) | |
download | dotfiles-8c52926df4fb12ab571f71414edaf3279c337ac7.tar.gz |
add sway config
Diffstat (limited to '.config/sway')
-rw-r--r-- | .config/sway/config | 361 | ||||
-rw-r--r-- | .config/sway/melete/bg | 1 | ||||
-rw-r--r-- | .config/sway/melete/kb | 3 |
3 files changed, 365 insertions, 0 deletions
diff --git a/.config/sway/config b/.config/sway/config new file mode 100644 index 00000000..3c1a0c85 --- /dev/null +++ b/.config/sway/config @@ -0,0 +1,361 @@ +include /etc/sway/config.d/* + +font pango:Cousine 10 + +# class border bground text indicator child_border +client.focused #000000 #B4EEB4 #000000 #B4EEB4 #000000 +client.focused_inactive #000000 #FFFFF6 #000000 #BFBFBF #E5E5E5 +client.unfocused #000000 #E5E5E5 #000000 #E5E5E5 #E5E5E5 +client.urgent #000000 #900000 #FFFFF6 #900000 #900000 +client.placeholder #000000 #000000 #FFFFF6 #000000 #000000 + +client.background #FFFFF6 + +# Use Mouse+Mod4 to drag floating windows to their wanted position +floating_modifier Mod4 + +# default workspace layout +workspace_layout tabbed + +# this is so that C-i o will stay within the same output; I have convenient +# bindings to get to other outputs so no need for directional movement to +# permit moving between outputs (it would be even better if we could just +# toggle this setting around the execution of C-i o, however) +focus_wrapping workspace + +# Put bindings I don't need to repeat under C-i, so that we have enough keys +# left on the right hand that caps lock can be our only Super modifier, yet we +# do not need any one-handed chording. *Only* bindings I might want to hit more +# than once in a row should be outside of this C-i map +mode "C-i-" { + # make a fresh Emacs frame -- typically this gets invoked only on + # empty workspaces, as otherwise I use commands under `C-x 5` to get + # more Emacs frames + bindsym Return exec emacsclient -a "" -nc, mode "default" + + # start a terminal emulator + bindsym BackSpace exec foot, mode "default" + + # make a fresh browser window + bindsym b exec firefox -new-window, mode "default" + + # lock screen -- relies on swayidle + # note that this won't lock other VTs (lock-session*s* + # requires root password) + bindsym l exec loginctl lock-session, mode "default" + + # go to sleep -- xss-lock will lock screen + bindsym Shift+l exec systemctl suspend, mode "default" + + # kill focused window + bindsym k kill, mode "default" + + # TODO sway sample config says to pipe dmenu into xargs swaymsg exec -- + + # start dmenu (a program launcher) + bindsym Shift+p exec dmenu_run \ + -nf '#000000' -nb '#FFFFF6' -sb '#B4EEB4' -sf '#000000', \ + mode "default" + + # There also is the (new) i3-dmenu-desktop which only displays applications + # shipping a .desktop file. It is a wrapper around dmenu, so you need that + # installed. + bindsym p exec i3-dmenu-desktop \ + --dmenu="dmenu -i -nf '#000000' -nb '#FFFFF6' -sb '#B4EEB4' -sf '#000000'", \ + mode "default" + + bindsym s exec dmenu_ssh \ + -nf '#000000' -nb '#FFFFF6' -sb '#B4EEB4' -sf '#000000', \ + mode "default" + + # split in horizontal orientation + bindsym h split h, mode "default" + + # split in vertical orientation + bindsym v split v, mode "default" + + # enter fullscreen mode for the focused container + bindsym f fullscreen toggle, mode "default" + + # change container layout (stacked, tabbed, toggle split) + # bindsym s layout stacking, mode "default" + bindsym w layout tabbed, mode "default" + + # toggle tiling / floating + bindsym t floating toggle, mode "default" + + # change focus between tiling / floating windows + bindsym Tab focus mode_toggle, mode "default" + + # focus the parent container + bindsym a focus parent, mode "default" + bindsym u focus parent, mode "default" + + # focus the child container + bindsym d focus child, mode "default" + + # when screen is divided into two containers where at least one has + # several tabs, as I usually have it on a small laptop screen, this + # works well to go back and forth + bindsym o focus parent, focus right, mode "default" + + # switch to workspace + bindsym 1 workspace 1, mode "default" + bindsym 2 workspace 2, mode "default" + bindsym 3 workspace 3, mode "default" + bindsym 4 workspace 4, mode "default" + bindsym 5 workspace 5, mode "default" + bindsym 6 workspace 6, mode "default" + bindsym 7 workspace 7, mode "default" + bindsym 8 workspace 8, mode "default" + bindsym 9 workspace 9, mode "default" + bindsym 0 workspace 10, mode "default" + bindsym F1 workspace 11:F1, mode "default" + bindsym F2 workspace 12:F2, mode "default" + bindsym F3 workspace 13:F3, mode "default" + bindsym F4 workspace 14:F4, mode "default" + bindsym F5 workspace 15:F5, mode "default" + bindsym F6 workspace 16:F6, mode "default" + bindsym F7 workspace 17:F7, mode "default" + bindsym F8 workspace 18:F8, mode "default" + bindsym F9 workspace 19:F9, mode "default" + bindsym F10 workspace 20:F10, mode "default" + bindsym F11 workspace 21:F11, mode "default" + bindsym F12 workspace 22:F12, mode "default" + bindsym semicolon workspace back_and_forth, mode "default" + + # move focused container to workspace + bindsym Shift+1 move container to workspace 1, mode "default" + bindsym Shift+2 move container to workspace 2, mode "default" + bindsym Shift+3 move container to workspace 3, mode "default" + bindsym Shift+4 move container to workspace 4, mode "default" + bindsym Shift+5 move container to workspace 5, mode "default" + bindsym Shift+6 move container to workspace 6, mode "default" + bindsym Shift+7 move container to workspace 7, mode "default" + bindsym Shift+8 move container to workspace 8, mode "default" + bindsym Shift+9 move container to workspace 9, mode "default" + bindsym Shift+0 move container to workspace 10, mode "default" + bindsym Shift+F1 move container to workspace 11:F1, mode "default" + bindsym Shift+F2 move container to workspace 12:F2, mode "default" + bindsym Shift+F3 move container to workspace 13:F3, mode "default" + bindsym Shift+F4 move container to workspace 14:F4, mode "default" + bindsym Shift+F5 move container to workspace 15:F5, mode "default" + bindsym Shift+F6 move container to workspace 16:F6, mode "default" + bindsym Shift+F7 move container to workspace 17:F7, mode "default" + bindsym Shift+F8 move container to workspace 18:F8, mode "default" + bindsym Shift+F9 move container to workspace 19:F9, mode "default" + bindsym Shift+F10 move container to workspace 20:F10, mode "default" + bindsym Shift+F11 move container to workspace 21:F11, mode "default" + bindsym Shift+F12 move container to workspace 22:F12, mode "default" + bindsym Shift+semicolon move container to workspace back_and_forth, \ + mode "default" + + # next unused workspace + bindsym j exec \ + ~/src/dotfiles/scripts/desktop/fresh-workspace, \ + mode "default" + # sends window to next unused but doesn't change view to that + # workspace because this binding is more like C-i [0-9]+ than it is + # like Mod4+Ctrl+j/k + bindsym Shift+j exec \ + ~/src/dotfiles/scripts/desktop/fresh-workspace --send, \ + mode "default" + + # reload the configuration file -- useful simply to reexecute + # startup scripts + bindsym c reload, mode "default" + # exit i3 (logs you out of your X session) + bindsym Ctrl+Shift+e exit + + bindsym g mode "C-i g-" + + # bindsym bracketleft exec debian-ftp-master-cut-note, mode "default" + # bindsym Shift+bracketleft exec xdo-evince-highlight, mode "default" + + # Workspaces do not ever get assigned to particular purposes / windows + # don't get assigned to particular workspaces. If I can't find where + # I was working on something, there's my bindings to `workspace + # {next,prev}_on_output`. Long-running processes like builds, for + # example, stay in the workspace(s) where I'm working on that + # task/project + # + # Previously I thought that instead of having them on a dedicated + # workspace, windows that are almost always open should be put on the + # scratcpad: + # + # Note that we have to move to scratchpad at startup ('move to + # scratchpad' below), or the toggle key won't work. + # + # Once every so often I'll have to launch the program, and then + # immediately use the toggle key to make it visible. This is a + # bit inelegant, but much more reliable than binding the key to a + # script which starts the program if it's not around and otherwise + # toggles + # + # However, I now think that scratchpad windows are unwieldy for + # various reasons, so just having them as regular windows with + # shortcuts to get back to them is better. + + # calendar, contacts & some HTML mail + bindsym Shift+r exec evolution, mode "default" + bindsym r [class="Evolution" title=" — Evolution$"] focus, mode "default" + + # chat + bindsym Shift+n exec foot \ + /bin/sh -c "mosh athena /home/spwhitton/src/dotfiles/bin/ii", \ + mode "default" + # unfortunately foot's --title option does not survive being overriden by mosh + # TODO this doesn't work either + bindsym n [appid="foot" title="[mosh] spwhitton@athena"] focus, mode "default" + + bindsym Shift+c [con_mark=caffeinated] inhibit_idle none; \ + mark --toggle caffeinated; mode "default" + + # This says: resize so that an Emacs window taking up the rest of the + # width has (eq (frame-width) 160). So should be <<33. The value 32 + # is for melete's monitor, using the Cousine font as installed from + # the Debian archive. We don't choose this value with any hope of + # fitting 80 columns into the smaller window, note, though sometimes + # we'll be able to. Idea is to have something we want to stay visible + # in the right split and Emacs frame where we're doing most of our + # work taking up the larger portion of the screen, and such that Emacs + # will prefer to split horizontally to pop to or display other buffers + bindsym minus resize set width 32 ppt, mode "default" + # And this says ensure that the current window can be an Emacs frame + # with at least 80 columns. Value is based on melete's monitor, using + # the Inconsolata font as installed from athena's apt repo (see + # spw/maybe-change-frame-font function for why one of these bindings + # is based on Cousine and the other is based on Inconsolata) + bindsym equal resize set width 39 ppt, mode "default" + + bindsym space mode "default" + bindsym Ctrl+g mode "default" + +} +# C-i is perfect for window manager bindings because it will never be +# bound in my Emacs config, as text terminals typically cannot +# distinguish between <tab> and C-i +bindsym Ctrl+i mode "C-i-" + +for_window [con_mark=caffeinated] inhibit_idle visible + +# change focus +bindsym Mod4+j focus left +bindsym Mod4+k focus right +bindsym Mod4+n focus down +bindsym Mod4+p focus up + +# move focused window +bindsym Mod4+Ctrl+j move left +bindsym Mod4+Ctrl+k move right +bindsym Mod4+Ctrl+n move down +bindsym Mod4+Ctrl+p move up + +bindsym Mod4+apostrophe layout toggle split + +# maybe C-M-i for this? +bindsym Mod4+l kill + +# Cycle through all workspaces on monitor. Unlike C-i j and C-i [0-9]+, these +# move the container *and* switch view to the other workspace, because there +# are more like Mod4+Ctrl+j/k than they are like the C-i bindings +bindsym Mod4+comma workspace prev_on_output +bindsym Mod4+period workspace next_on_output +bindsym Mod4+Ctrl+comma move container to workspace prev_on_output, \ + workspace prev_on_output +bindsym Mod4+Ctrl+period move container to workspace next_on_output, \ + workspace next_on_output + +bindsym Mod4+i focus output left +bindsym Mod4+Ctrl+i move workspace to output left +bindsym Mod4+o focus output right +bindsym Mod4+Ctrl+o move workspace to output right + +# Start swaybar to display a workspace bar (plus the system information +# i3status finds out, if available) +bar { + # i3status is designed to be highly performant so it continues + # to be refreshed when the system is under load; we're giving + # up some of that with i3status-wrapper, but let's see if it + # actually matters + status_command i3status | ~/src/dotfiles/scripts/desktop/i3status-wrapper + + # default behaviour is to cycle through workspaces when scroll + # wheel is used on the bar. However, don't think I've ever + # used this deliberately, and often I do it by mistake, so + # let's disable it + bindsym button4 nop + bindsym button5 nop + + colors { + background #FFFFF6 + statusline #000000 + separator #000000 + + focused_workspace #000000 #B4EEB4 #000000 + active_workspace #000000 #FFFFF6 #000000 + inactive_workspace #000000 #E5E5E5 #000000 + urgent_workspace #000000 #900000 #FFFFF6 + binding_mode #000000 #900000 #FFFFF6 + } + + position bottom + strip_workspace_numbers yes + + tray_output primary +} + +# single key launching +mode "C-i g-" { + # start a graphical file manager + bindsym g exec thunar , mode "default" + + # open virt-viewer pointed at develacc + bindsym d exec develacc-please , mode "default" + + # connect to Debian's ftp-master server for ftpteam work + bindsym f mode "C-i g f-" + + bindsym t exec foot top , mode "default" + + bindsym Ctrl+g mode "default" +} + +mode "C-i g f-" { + bindsym f exec debian-ftp-master , mode "default" + + bindsym n exec debian-ftp-master-cut-note , mode "default" + + bindsym Ctrl+g mode "default" +} + +bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +10% +bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -10% +bindsym --locked XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle + +bindsym --locked XF86MonBrightnessUp exec brightnessctl set +10% +bindsym --locked XF86MonBrightnessDown exec brightnessctl set 10%- + +popup_during_fullscreen leave_fullscreen + +# windows that should always float +for_window [title="^Ediff"] floating enable + +input type:keyboard xkb_model "pc105" +input type:keyboard xkb_layout "us+spw(emacs)" +input type:keyboard repeat_rate 25 +input type:keyboard repeat_delay 380 + +seat * hide_cursor 5000 + +exec mako +exec gammastep +exec update-emacs-daemon-environment + +exec swayidle -w \ + lock 'swaylock -f' \ + before-sleep 'swaylock -f' \ + timeout 300 'swaylock -f' \ + timeout 305 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' + +include ~/.config/sway/$(hostname)/* diff --git a/.config/sway/melete/bg b/.config/sway/melete/bg new file mode 100644 index 00000000..e6524647 --- /dev/null +++ b/.config/sway/melete/bg @@ -0,0 +1 @@ +output "eDP-1" bg $HOME/local/wallpaper.png fill diff --git a/.config/sway/melete/kb b/.config/sway/melete/kb new file mode 100644 index 00000000..5b80db97 --- /dev/null +++ b/.config/sway/melete/kb @@ -0,0 +1,3 @@ +# melete's laptop keyboard doesn't have numlock, so we can just use '*' rather +# than specifying the external keyboard +input * xkb_numlock enable |