166 lines
5.0 KiB
Org Mode
166 lines
5.0 KiB
Org Mode
#+TITLE: Sway Config
|
|
#+PROPERTY: header-args+ :mkdirp yes
|
|
#+PROPERTY: header-args+ :tangle ~/.config/sway/config
|
|
|
|
* Variables
|
|
Logo key
|
|
#+begin_src conf
|
|
set $mod Mod4
|
|
#+end_src
|
|
Movement
|
|
#+begin_src conf
|
|
set $left h
|
|
set $down j
|
|
set $up k
|
|
set $right l
|
|
#+end_src
|
|
Some default programs
|
|
#+begin_src conf
|
|
set $term exec termite
|
|
set $menu exec dmenu_run
|
|
#+end_src
|
|
* Window Borders
|
|
#+begin_src conf
|
|
default_border pixel 0
|
|
default_floating_border normal
|
|
#+end_src
|
|
* Layouts
|
|
Changing the container layout
|
|
#+begin_src conf
|
|
bindsym $mod+s layout stacking
|
|
bindsym $mod+w layout tabbed
|
|
bindsym $mod+e layout toggle split
|
|
#+end_src
|
|
* Focus
|
|
Change focus between tiling / floating windows
|
|
#+begin_src conf
|
|
bindsym $mod+space focus mode_toggle
|
|
#+end_src
|
|
Focus the parent container
|
|
#+begin_src conf
|
|
bindsym $mod+a focus parent
|
|
#+end_src
|
|
* Workspaces
|
|
Define name for default workspaces for which key bindings will be configured.
|
|
Use variables to avoid repeating the names in multiple places.
|
|
#+begin_src conf
|
|
set $ws1 "1"
|
|
set $ws2 "2"
|
|
set $ws3 "3"
|
|
set $ws4 "4"
|
|
set $ws5 "5"
|
|
set $ws6 "6"
|
|
set $ws7 "7"
|
|
set $ws8 "8"
|
|
set $ws9 "9"
|
|
set $ws10 "10"
|
|
#+end_src
|
|
Switching to workspaces
|
|
#+begin_src conf
|
|
bindsym $mod+1 workspace $ws1
|
|
bindsym $mod+2 workspace $ws2
|
|
bindsym $mod+3 workspace $ws3
|
|
bindsym $mod+4 workspace $ws4
|
|
bindsym $mod+5 workspace $ws5
|
|
bindsym $mod+6 workspace $ws6
|
|
bindsym $mod+7 workspace $ws7
|
|
bindsym $mod+8 workspace $ws8
|
|
bindsym $mod+9 workspace $ws9
|
|
bindsym $mod+0 workspace $ws10
|
|
#+end_src
|
|
Move focused container to workspace
|
|
#+begin_src conf
|
|
|
|
bindsym $mod+Shift+1 move container to workspace $ws1
|
|
bindsym $mod+Shift+2 move container to workspace $ws2
|
|
bindsym $mod+Shift+3 move container to workspace $ws3
|
|
bindsym $mod+Shift+4 move container to workspace $ws4
|
|
bindsym $mod+Shift+5 move container to workspace $ws5
|
|
bindsym $mod+Shift+6 move container to workspace $ws6
|
|
bindsym $mod+Shift+7 move container to workspace $ws7
|
|
bindsym $mod+Shift+8 move container to workspace $ws8
|
|
bindsym $mod+Shift+9 move container to workspace $ws9
|
|
bindsym $mod+Shift+0 move container to workspace $ws10
|
|
#+end_src
|
|
* Input Configurations
|
|
Swap `ctrl` for `caps lock`
|
|
#+begin_src conf
|
|
input * {
|
|
xkb_options ctrl:swapcaps
|
|
}
|
|
|
|
input * xkb_numlock enable
|
|
#+end_src
|
|
|
|
* Theme =class border background text indicator child-border=
|
|
#+begin_src conf
|
|
client.focused #C0C5CE #C0C5CE #1B2229 #C0C5CE #C0C5CE
|
|
client.focused_inactive #232830 #232830 #C0C5CE #232830 #232830
|
|
client.unfocused #1B2229 #1B2229 #C0C5CE #1B2229 #1B2229
|
|
client.urgent #65737E #65737E #D08770 #65737E #65737E
|
|
client.placeholder #4F5B66 #4F5B66 #D08770 #4F5B66 #4F5B66
|
|
client.background #2B303B
|
|
#+end_src
|
|
|
|
* Idle
|
|
Lock the screen after 600 seconds of inactivity, then turn off the display
|
|
after another 600 seconds. Turn on the screen when resumed. Lock the screen before
|
|
the computer goes to sleep too.
|
|
#+begin_src conf
|
|
exec swayidle -w \
|
|
timeout 600 'swaylock' \
|
|
timeout 1200 'swaymsg "output * dpms off"' \
|
|
resume 'swaymsg "output * dpms on"' \
|
|
before-sleep 'swaylock'
|
|
#+end_src
|
|
|
|
* Keybindings
|
|
Basics
|
|
#+begin_src conf
|
|
bindsym $mod+Shift+q kill
|
|
bindsym $mod+Shift+c reload
|
|
bindsym $mod+Shift+e exit
|
|
floating_modifier $mod normal
|
|
#+end_src
|
|
Focusing
|
|
#+begin_src conf
|
|
bindsym $mod+$left focus left
|
|
bindsym $mod+$down focus down
|
|
bindsym $mod+$up focus up
|
|
bindsym $mod+$right focus right
|
|
#+end_src
|
|
Move the focused window
|
|
#+begin_src conf
|
|
bindsym $mod+Shift+$left move left
|
|
bindsym $mod+Shift+$down move down
|
|
bindsym $mod+Shift+$up move up
|
|
bindsym $mod+Shift+$right move right
|
|
#+end_src
|
|
Resizing
|
|
#+begin_src conf
|
|
mode "resize" {
|
|
bindsym $left resize shrink width 1 px or 1 ppt
|
|
bindsym $down resize grow height 1 px or 1 ppt
|
|
bindsym $up resize shrink height 1 px or 1 ppt
|
|
bindsym $right resize grow width 1 px or 1 ppt
|
|
bindsym Return mode "default"
|
|
bindsym Escape mode "default"
|
|
}
|
|
bindsym $mod+r mode "resize"
|
|
#+end_src
|
|
Sway has a "scratchpad", which is a bag of holding for windows. Windows can be
|
|
sent there and back later.
|
|
#+begin_src conf
|
|
bindsym $mod+Shift+minus move scratchpad
|
|
bindsym $mod+minus scratchpad show
|
|
#+end_src
|
|
I run emacs as a server. I have keybindings to run specific programs in their own frame.
|
|
#+begin_src conf
|
|
bindsym $mod+grave exec emacsclient -c -a ''
|
|
bindsym $mod+Shift+b exec emacsclient -c -a '' -F '(quote (name . "buffers"))' --eval '(ibuffer)'
|
|
bindsym $mod+Shift+d exec emacsclient -c -a '' -F '(quote (name . "dired"))' --eval '(dired nil)'
|
|
bindsym $mod+Shift+f exec emacsclient -c -a '' -F '(quote (name . "feeds"))' --eval '(elfeed)'
|
|
bindsym $mod+Shift+s exec emacsclient -c -a '' -F '(quote (name . "eshell"))' --eval '(eshell)'
|
|
#+end_src
|