about summary refs log tree commit diff
path: root/configs/shared
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2019-03-23T16·31+0000
committerWilliam Carroll <wpcarro@gmail.com>2019-03-23T16·31+0000
commit7bcfa26f515c8f82a49510834fda0f029e33f48f (patch)
tree73307ab35c6c594e651c3994627b39d201653bc6 /configs/shared
parentef8621e7da7c6177efa47f66105243809f1aa27f (diff)
Support shared, device-specific i3 configurations
Separated i3/configuration since some of my devices support XFree86 keysyms
while others do not. This introduced some cascading changes.

- Removed ~/.config/i3/config from this repo. Since I will be switching between
  devices semi-regularly and that file will be generated each time I switch to a
  different device running an X session, I don't want the i3/config to spam my
  `gst` and `gd` when I haven't changed configuration in either config.shared or
  config.device.
- Update aliases, variables, etc. to point to config.shared instead of the
  generated file.
- Ensure that X sessions generate the i3/config file.
- Ensure that i3 reload and restart command generate the i3/config file.
Diffstat (limited to 'configs/shared')
-rw-r--r--configs/shared/emacs/.emacs.d/wpc/packages/wpc-keybindings.el2
-rw-r--r--configs/shared/emacs/.emacs.d/wpc/packages/wpc-misc.el2
-rw-r--r--configs/shared/misc/.config/i3/config.shared (renamed from configs/shared/misc/.config/i3/config)41
-rw-r--r--configs/shared/misc/.config/nvim/init.vim2
-rw-r--r--configs/shared/x_server/.xsessionrc.shared5
-rw-r--r--configs/shared/zsh/aliases.zsh2
-rw-r--r--configs/shared/zsh/variables.zsh2
7 files changed, 22 insertions, 34 deletions
diff --git a/configs/shared/emacs/.emacs.d/wpc/packages/wpc-keybindings.el b/configs/shared/emacs/.emacs.d/wpc/packages/wpc-keybindings.el
index 4f07a8ce70ad..9c04a1415380 100644
--- a/configs/shared/emacs/.emacs.d/wpc/packages/wpc-keybindings.el
+++ b/configs/shared/emacs/.emacs.d/wpc/packages/wpc-keybindings.el
@@ -70,7 +70,7 @@
     "ef" (lambda () (interactive) (wpc/find-file-split "~/functions.zsh"))
     "el" (lambda () (interactive) (wpc/find-file-split "~/variables.zsh"))
     "ex" (lambda () (interactive) (wpc/find-file-split "~/.Xresources"))
-    "ei" (lambda () (interactive) (wpc/find-file-split "~/.config/i3/config"))
+    "ei" (lambda () (interactive) (wpc/find-file-split "~/.config/i3/config.shared"))
     "em" (lambda () (interactive) (wpc/find-file-split "~/.tmux.conf"))
 
     "B"  #'magit-blame
diff --git a/configs/shared/emacs/.emacs.d/wpc/packages/wpc-misc.el b/configs/shared/emacs/.emacs.d/wpc/packages/wpc-misc.el
index cc7a8c86a1da..e60b97323307 100644
--- a/configs/shared/emacs/.emacs.d/wpc/packages/wpc-misc.el
+++ b/configs/shared/emacs/.emacs.d/wpc/packages/wpc-misc.el
@@ -59,7 +59,7 @@
 (set-register ?f '(file . "~/functions.zsh"))
 (set-register ?l '(file . "~/variables.zsh"))
 (set-register ?x '(file . "~/.Xresources"))
-(set-register ?i '(file . "~/.config/i3/config"))
+(set-register ?i '(file . "~/.config/i3/config.shared"))
 (set-register ?m '(file . "~/.tmux.conf"))
 
 (set-register ?p `(file . ,wpc/current-project))
diff --git a/configs/shared/misc/.config/i3/config b/configs/shared/misc/.config/i3/config.shared
index 564cfa969d65..6e2c96ae0931 100644
--- a/configs/shared/misc/.config/i3/config
+++ b/configs/shared/misc/.config/i3/config.shared
@@ -1,6 +1,3 @@
-set $mod Mod1
-set $super Mod4
-
 # Keymapping philosophy:
 # When I feel it's appropriate, I try to borrow existing KBDs from OSX or
 # Windows. For example, I use Ctrl+Alt+Del to start the screen lock, since this
@@ -15,6 +12,9 @@ set $super Mod4
 # than it is in Linux, I prefer to support the OSX KBDs to reduce the number of
 # KBDs my feeble memory needs to store.
 
+set $mod Mod1
+set $super Mod4
+
 # Font for window titles. Will also be used by the bar unless a different font
 # is used in the bar {} block below.
 font pango:monospace 8
@@ -51,21 +51,9 @@ bindsym $mod+Ctrl+Shift+e      split h; exec emacsclient --create-frame ~/progra
 bindsym $mod+Ctrl+Shift+c      split h; exec google-chrome
 bindsym $mod+Ctrl+Shift+s      split h; exec spotify
 
-# audio controls
-bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10%   # MBP Volume Up
-bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10%   # MBP Volume Down
-bindsym XF86AudioMute        exec --no-startup-id pactl set-sink-mute   @DEFAULT_SINK@ toggle # MBP Mute
-bindsym F12                  exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10%   # same Fn keys as MBP
-bindsym F11                  exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10%   # same Fn keys as MBP
-bindsym F10                  exec --no-startup-id pactl set-sink-mute   @DEFAULT_SINK@ toggle # same Fn keys as MBP
-
 # pass integration
 bindsym $mod+Ctrl+backslash exec ~/.config/i3/passmenu # mirroring the 1password KBD
 
-# screen brightness controls
-bindsym XF86MonBrightnessUp   exec light -A 10
-bindsym XF86MonBrightnessDown exec light -U 10
-
 # integrate with Emacs's org-mode
 bindsym $mod+o exec zsh -i -c org_capture
 for_window [class="GoogleEmacs" instance="org-protocol-capture"] floating enable
@@ -84,21 +72,16 @@ bindsym $mod+space exec --no-startup-id dmenu_run
 bindsym $mod+t exec --no-startup-id ~/.config/i3/dmenu_timer.sh ~/.local/share/sounds/gong.mp3
 
 # file manager
-bindsym $mod+x exec st -e lf
-
-# music player kbds
-bindsym F9 exec --no-startup-id playerctl next       # same Fn keys as MBP
-bindsym F8 exec --no-startup-id playerctl play-pause # same Fn keys as MBP
-bindsym F7 exec --no-startup-id playerctl previous   # same Fn keys as MBP
+bindsym $mod+n exec st -e lf
 
 # Screenshot
-bindsym $mod+s       exec zsh -i -c snipit
-bindsym Ctrl+Print   exec scrot  ~/Pictures/screenshots/%b-%d-%Y_%T.png          # Windows style
+bindsym $mod+Shift+4 exec zsh -i -c snipit
+bindsym Ctrl+Print   exec scrot ~/Pictures/screenshots/%b-%d-%Y_%T.png # Windows style
+bindsym $mod+Shift+3 exec scrot ~/Pictures/screenshots/%b-%d-%Y_%T.png # OSX style
 # TODO: debug
-bindsym $mod+Print   exec scrot --focused ~/Pictures/screenshots/%b-%d-%Y_%T.png # Windows style
-bindsym $mod+Shift+3 exec scrot ~/Pictures/screenshots/%b-%d-%Y_%T.png           # OSX style
+# bindsym $mod+Print   exec scrot --focused ~/Pictures/screenshots/%b-%d-%Y_%T.png # Windows style
 # TODO: debug
-bindsym $mod+Shift+4 exec scrot --select ~/Pictures/screenshots/%b-%d-%Y_%T.png  # OSX style
+# bindsym $mod+Shift+4 exec scrot --select ~/Pictures/screenshots/%b-%d-%Y_%T.png  # OSX style
 # Integration with Google's screenshot hosting server
 
 # online documentation
@@ -212,8 +195,8 @@ bindsym $mod+Ctrl+9 move container to workspace $ws9
 bindsym $mod+Ctrl+0 move container to workspace $ws10
 
 # reload, restart i3
-bindsym $super+r       reload
-bindsym $super+Shift+r restart
+bindsym $super+r       exec cat ~/.config/i3/config.shared ~/.config/i3/config.device >~/.config/i3/config; reload
+bindsym $super+Shift+r exec cat ~/.config/i3/config.shared ~/.config/i3/config.device >~/.config/i3/config; restart
 
 
 # resize window (you can also use the mouse for that)
@@ -268,6 +251,6 @@ bar {
            focused_workspace  $black $black $bright_cyan
            active_workspace   $red $bright_blue $blue
            inactive_workspace $black $black $bright_black
-           urgent_workspace   $bright_black $black $magenta
+           urgent_workspace   $magenta $black $magenta
     }
 }
diff --git a/configs/shared/misc/.config/nvim/init.vim b/configs/shared/misc/.config/nvim/init.vim
index 148341a2c2ef..6e4122b40d39 100644
--- a/configs/shared/misc/.config/nvim/init.vim
+++ b/configs/shared/misc/.config/nvim/init.vim
@@ -267,7 +267,7 @@ nnoremap <leader>ea :vsplit ~/aliases.zsh<CR>
 nnoremap <leader>ef :vsplit ~/functions.zsh<CR>
 nnoremap <leader>el :vsplit ~/variables.zsh<CR>
 nnoremap <leader>ex :vsplit ~/.Xresources<CR>
-nnoremap <leader>ei :vsplit ~/.config/i3/config<CR>
+nnoremap <leader>ei :vsplit ~/.config/i3/config.shared<CR>
 
 " quickly source your vimrc
 nnoremap <leader>sv :source $MYVIMRC<CR>
diff --git a/configs/shared/x_server/.xsessionrc.shared b/configs/shared/x_server/.xsessionrc.shared
index b19e3359efd0..25346eab1cf8 100644
--- a/configs/shared/x_server/.xsessionrc.shared
+++ b/configs/shared/x_server/.xsessionrc.shared
@@ -23,5 +23,10 @@ emacs --daemon
 xmodmap -e 'remove Lock = Caps_Lock'
 xmodmap -e 'keysym Caps_Lock = Escape'
 
+# since we separated our i3 configurations between a shared and device-specific
+# setup, we need to make sure that when we start an X session, our i3
+# configuration is up-to-date.
+cat ~/.config/i3/config.{shared,device} >~/.config/i3/config
+
 # set key repeat preferences
 xset r rate 250 60
diff --git a/configs/shared/zsh/aliases.zsh b/configs/shared/zsh/aliases.zsh
index 7a8c0dafb6c6..30497a05fc80 100644
--- a/configs/shared/zsh/aliases.zsh
+++ b/configs/shared/zsh/aliases.zsh
@@ -142,7 +142,7 @@ alias ea='e ~/aliases.zsh'
 alias ef='e ~/functions.zsh'
 alias el='e ~/variables.zsh'
 alias ex='e ~/.Xresources'
-alias ei='e ~/.config/i3/config'
+alias ei='e ~/.config/i3/config.shared'
 alias em='e ~/.tmux.conf'
 
 # couple the s* aliases to the <leader>s* kbds in vim
diff --git a/configs/shared/zsh/variables.zsh b/configs/shared/zsh/variables.zsh
index 6e3a91d6280a..b45ea9eae1c0 100644
--- a/configs/shared/zsh/variables.zsh
+++ b/configs/shared/zsh/variables.zsh
@@ -48,4 +48,4 @@ a="$HOME/aliases.zsh"
 f="$HOME/functions.zsh"
 l="$HOME/variables.zsh" # v is taken by vim
 x="$HOME/.Xresources"
-i="$HOME/.config/i3/config"
+i="$HOME/.config/i3/config.shared"