Drop support for i3

While I first switched to EXWM warily and thinking it would only be temporary,
it seems like this switch is here to stay. It turns out that EXWM was exactly
the integration I've been looking for. How serendipitous it that I found it when
I did.

Thank you, @tazjin.
This commit is contained in:
William Carroll 2019-12-23 11:19:42 +00:00
parent 25ce422abd
commit 7ae17daa98
21 changed files with 5 additions and 1156 deletions

View file

@ -17,7 +17,6 @@ $ cd ..
$ gclone FabriceCastel/gvcci
```
- TODO: Ensure edits to `i3.base` work as expected.
- TODO: Integrate Emacs themes into wpgtk.
- TODO: Integrate Vim themes into wpgtk.
- TODO: add these to the install script
@ -85,12 +84,6 @@ $ for p in $(cat nix-env.txt); do
> done
```
1. Install i3
```bash
$ sudo apt-get install i3
```
1. Install dotfiles
- TODO: include steps 2-4 in the `make install` command.

View file

@ -262,7 +262,6 @@ abbr --add ea e ~/aliases.zsh
abbr --add ef e ~/functions.zsh
abbr --add el e ~/variables.zsh
abbr --add ex e ~/.Xresources
abbr --add ei e ~/.config/i3/config
abbr --add em e ~/.tmux.conf
abbr --add er e ~/Dropbox/dotfiles/README.md
# TODO: consider DRYing this up with `e`. Unfortunately, `sudo` won't support
@ -275,7 +274,6 @@ abbr --add sa source ~/aliases.zsh
abbr --add sf source ~/functions.zsh
abbr --add sl source ~/variables.zsh
abbr --add sx xrdb ~/.Xresources
abbr --add si i3-msg restart
abbr --add sm tmux source-file ~/.tmux.conf
abbr --add sn sudo nixos-rebuild switch

View file

@ -1,329 +0,0 @@
# 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
# is a really well-known KBD. One notable difference is that when I'm borrowing
# OSX KBDs, I prefer using Alt instead of Super since the keyboard that I'm
# using has the Alt key in the same location as the Super key on my mac
# keyboard. I could rebind this, and I just may. But for now, that's worth
# pointing out.
# The reason behind borrowing from Windows and OSX is that some of these
# keybindings are hardwired into my muscle memory. I also tend to work between
# Linux and OSX quite often. Since OSX is much more difficult to remap KBDs
# 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 $window Mod1+Ctrl
set $super Mod4
set $terminal terminator
set $browser google-chrome
# 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 10px
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# i3-gaps (depends on i3-gaps installation)
# gaps inner 7
# gaps outer 0
# smart_gaps on
#
# bindsym $mod+Ctrl+plus gaps outer current plus 5
# bindsym $mod+Ctrl+minus gaps outer current minus 5
# bindsym $mod+Shift+plus gaps inner current plus 5
# bindsym $mod+Shift+minus gaps inner current minus 5
# Support XF86 keys for audio playback and volume control
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10%
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10%
bindsym XF86AudioPrev exec --no-startup-id playerctl previous
bindsym XF86AudioNext exec --no-startup-id playerctl next
bindsym XF86AudioStop exec --no-startup-id playerctl play-pause
bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause
# KBD Principles:
# $mod+Ctrl+<app_char> = starting an application
# where <app_char> is a reserved character for a commonly used application.
#
# <app_char> definitions:
# terminal = t, Return
# emacs = e
# chrome = c
# spotify = s
# intellij = i
bindsym $mod+Ctrl+t exec $terminal
bindsym $mod+Return exec $terminal
bindsym $mod+Ctrl+e exec emacsclient --create-frame
bindsym $mod+Ctrl+c exec $browser
bindsym $mod+Ctrl+s exec spotify
bindsym $mod+Ctrl+i exec zsh -i -c intellij
# support dmenu-based bookmarks
# bindsym $mod+Ctrl+b exec rofi -dmenu <$DOTFILES/bookmarks.txt | xargs $browser
set $bookmarks_mode Bookmarks (a) add, (d) delete, (b) browse
mode "$bookmarks_mode" {
bindsym a exec zsh -i -c add_bookmark, mode "default"
bindsym d exec zsh -i -c rm_bookmark, mode "default"
bindsym b exec zsh -i -c open_bookmark, mode "default"
bindsym Escape mode "default"
bindsym Ctrl+g mode "default"
bindsym Ctrl+c mode "default"
}
bindsym $mod+Ctrl+b mode "$bookmarks_mode"
# pass integration
bindsym $mod+Ctrl+backslash exec ~/.config/i3/passmenu # mirroring the 1password KBD
# integrate with Emacs's org-mode
bindsym $mod+o exec zsh -i -c org_capture
# TODO: Support "coding size", "dialog-size" (for org_capture)
# TODO: Support way to cycle through predefined sizes.
for_window [class="GoogleEmacs" instance="floating"] floating enable, resize set height 1200px, resize set width 780px
# Here is a sketch of the cycle sizes idea.
# TODO: Support this.
# mode "cycle_sizes_floating_mode" {
# # coding mode
# bindsym a for_window [mode="floating", class="actively-selected"] resize set height 1200px, resize set width 780px
# bindsym b for_window [mode="floating", class="actively-selected"] resize set height 500px, resize set width 500px
#
# bindsym Escape mode "default"
# bindsym Ctrl+g mode "default"
# bindsym Ctrl+c mode "default"
# }
# ensure Spotify windows float
for_window [class="Spotify"] floating enable
# ensure system service that run through XDG start
exec --no-startup-id dex -ae i3
# rofi configuration
bindsym $mod+space exec --no-startup-id rofi -show combi
bindsym $mod+t exec --no-startup-id ~/.config/i3/dmenu_timer.sh ~/.local/share/sounds/gong.mp3
# switch workspaces
bindsym $mod+Tab workspace next
bindsym $mod+Shift+Tab workspace prev
# file manager
bindsym $mod+n exec $terminal -x lf ~/Dropbox
# clipboard manager
# NOTE: Ctrl-c is already covered since `clipmenu` listens for X clipboard
# events using `clipnotify`.
# NOTE: `clipmenud` is started in `.xsessionrc.shared`
# NOTE: This is a bit of a hack intended to support pasting in both the terminal
# and in GUI applications. `st` expects `ctrl+Shift+v` while GUIs expect
# `ctrl+v`. In the instances where GUIs don't support `ctrl+Shift+v` already, it
# acts like `ctrl+v`, so it should "just work".
bindsym Ctrl+$mod+v exec clipmenu && xdotool key --clearmodifiers ctrl+Shift+v
# Screenshot
# TODO: Support variants: (a) App (r) Region (f) Fullscreen.
# TODO: Support hosting to third-party image hosting.
set $screenshot_mode Screenshot (g) googleplex (l) local
mode "$screenshot_mode" {
bindsym g exec zsh -i -c snipit, mode "default"
bindsym l exec zsh -i -c screenshot, mode "default"
bindsym Escape mode "default"
bindsym Ctrl+g mode "default"
bindsym Ctrl+c mode "default"
}
bindsym $mod+s mode "$screenshot_mode"
# online documentation
bindsym $mod+Shift+slash exec $browser https://i3wm.org/docs/userguide.html
# no title bars
for_window [class="^.*"] border pixel 1
# disable mouse hover focus
focus_follows_mouse no
# kill focused window
bindsym $window+q kill
# Toggle focus
bindsym $window+f floating toggle
# GTK Themes
exec --no-startup-id gnome-settings-daemon
# wireless selection mechanism
exec --no-startup-id nm-applet
# set the split direction
bindsym $mod+v split vertical
# cannot bind $mod+h because of movement commands
bindsym $mod+Shift+v split horizontal
# sound applet
exec --no-startup-id gnome-sound-applet
# change focus
bindsym $window+h focus left
bindsym $window+j focus down
bindsym $window+k focus up
bindsym $window+l focus right
# move focused window
bindsym $mod+Shift+h move left 100
bindsym $mod+Shift+j move down 100
bindsym $mod+Shift+k move up 100
bindsym $mod+Shift+l move right 100
# enter fullscreen mode for the focused container
bindsym $window+z fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $super+e layout toggle split
bindsym $super+s layout stacking
bindsym $super+t layout tabbed
# toggle tiling / floating
bindsym $mod+Shift+f floating toggle
# toggle stickiness
bindsym $mod+Shift+s sticky toggle
# focus the parent container
# bindsym $mod+a focus parent
bindsym $mod+Shift+a focus child
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
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"
# jump to workspace
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
# edit configuration files
# TODO: Standardize KBDs for C,R,U,D operations.
# TODO: Move shell script to /usr/local/bin
# Create
# TODO: Choose another KBD. This is temporary.
bindsym $mod+a exec zsh -i -c add_config
# Read
bindsym $mod+c exec zsh -i -c edit_config
# Update
# TODO: Support operation to update_config label and path
# Delete
bindsym $mod+Shift+c exec zsh -i -c rm_config
# move and follow focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1; workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2; workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3; workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4; workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5; workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6; workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7; workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8; workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9; workspace $ws9
bindsym $mod+Shift+0 move container to workspace $ws10; workspace $ws10
# move focused container to workspace
bindsym $mod+Ctrl+1 move container to workspace $ws1
bindsym $mod+Ctrl+2 move container to workspace $ws2
bindsym $mod+Ctrl+3 move container to workspace $ws3
bindsym $mod+Ctrl+4 move container to workspace $ws4
bindsym $mod+Ctrl+5 move container to workspace $ws5
bindsym $mod+Ctrl+6 move container to workspace $ws6
bindsym $mod+Ctrl+7 move container to workspace $ws7
bindsym $mod+Ctrl+8 move container to workspace $ws8
bindsym $mod+Ctrl+9 move container to workspace $ws9
bindsym $mod+Ctrl+0 move container to workspace $ws10
# reload, restart i3
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
# logout dialog
set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown
mode "$mode_system" {
bindsym l exec --no-startup-id xsecurelock, mode "default"
bindsym e exit, mode "default"
bindsym s exec --no-startup-id xsecurelock && systemctl suspend, mode "default"
bindsym h exec --no-startup-id xsecurelock && systemctl hibernate, mode "default"
bindsym r exec --no-startup-id systemctl reboot, mode "default"
bindsym Shift+s exec --no-startup-id systemctl poweroff, mode "default"
# back to normal: Enter or Escape
bindsym Escape mode "default"
bindsym Ctrl+g mode "default"
bindsym Ctrl+c mode "default"
}
bindsym Ctrl+Mod1+Delete mode "$mode_system"
# resize window (you can also use the mouse for that)
mode "resize" {
bindsym h resize shrink width 10 px or 10 ppt
bindsym j resize shrink height 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize grow width 10 px or 10 ppt
bindsym Escape mode "default"
bindsym Ctrl+g mode "default"
bindsym Ctrl+c mode "default"
}
bindsym $mod+Shift+r mode "resize"
# passthrough mode to support Emacs, Tmux, Vim KBDs for window and pane management
mode "passthrough" {
bindsym $mod+Escape mode "default"
}
bindsym $mod+Escape mode "passthrough"
# class border backgr text indicator child_border
client.focused #83526a #83526a #8de0e1 #E8C35F #83526a
client.focused_inactive #83526a #83526a #8de0e1 #E8C35F #5a3849
client.unfocused #5a3849 #5a3849 #8de0e1 #E8C35F #5a3849
client.urgent #E8C35F #E8C35F #8de0e1 #E8C35F #E8C35F
client.placeholder #31213f #629c9d #8de0e1 #31213f #629c9d
client.background #31213f
bar {
status_command i3status
font pango:Monospace 10px
position top
# disable system tray icons
tray_output none
colors {
background #31213f
statusline #83526a # text color in status line
separator #83526a
# class border text indicator
focused_workspace #83526a #8de0e1 #31213f
active_workspace #83526a #5a3849 #83526a
inactive_workspace #5a3849 #83526a #5a3849
urgent_workspace #5a3849 #83526a #5a3849
}
}
# wpg integration
exec --no-startup-id ~/.config/wpg/wp_init.sh

View file

@ -1,330 +0,0 @@
# 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
# is a really well-known KBD. One notable difference is that when I'm borrowing
# OSX KBDs, I prefer using Alt instead of Super since the keyboard that I'm
# using has the Alt key in the same location as the Super key on my mac
# keyboard. I could rebind this, and I just may. But for now, that's worth
# pointing out.
# The reason behind borrowing from Windows and OSX is that some of these
# keybindings are hardwired into my muscle memory. I also tend to work between
# Linux and OSX quite often. Since OSX is much more difficult to remap KBDs
# 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 $window Mod1+Ctrl
set $super Mod4
# TODO: Support alacritty or another fast terminal.
set $terminal terminator
set $browser google-chrome
# 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 10px
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# i3-gaps (depends on i3-gaps installation)
# gaps inner 7
# gaps outer 0
# smart_gaps on
#
# bindsym $mod+Ctrl+plus gaps outer current plus 5
# bindsym $mod+Ctrl+minus gaps outer current minus 5
# bindsym $mod+Shift+plus gaps inner current plus 5
# bindsym $mod+Shift+minus gaps inner current minus 5
# Support XF86 keys for audio playback and volume control
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10%
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10%
bindsym XF86AudioPrev exec --no-startup-id playerctl previous
bindsym XF86AudioNext exec --no-startup-id playerctl next
bindsym XF86AudioStop exec --no-startup-id playerctl play-pause
bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause
# KBD Principles:
# $mod+Ctrl+<app_char> = starting an application
# where <app_char> is a reserved character for a commonly used application.
#
# <app_char> definitions:
# terminal = t, Return
# emacs = e
# chrome = c
# spotify = s
# intellij = i
bindsym $mod+Ctrl+t exec $terminal
bindsym $mod+Return exec $terminal
bindsym $mod+Ctrl+e exec emacsclient --create-frame
bindsym $mod+Ctrl+c exec $browser
bindsym $mod+Ctrl+s exec spotify
bindsym $mod+Ctrl+i exec zsh -i -c intellij
# support dmenu-based bookmarks
# bindsym $mod+Ctrl+b exec rofi -dmenu <$DOTFILES/bookmarks.txt | xargs $browser
set $bookmarks_mode Bookmarks (a) add, (d) delete, (b) browse
mode "$bookmarks_mode" {
bindsym a exec zsh -i -c add_bookmark, mode "default"
bindsym d exec zsh -i -c rm_bookmark, mode "default"
bindsym b exec zsh -i -c open_bookmark, mode "default"
bindsym Escape mode "default"
bindsym Ctrl+g mode "default"
bindsym Ctrl+c mode "default"
}
bindsym $mod+Ctrl+b mode "$bookmarks_mode"
# pass integration
bindsym $mod+Ctrl+backslash exec ~/.config/i3/passmenu # mirroring the 1password KBD
# integrate with Emacs's org-mode
bindsym $mod+o exec zsh -i -c org_capture
# TODO: Support "coding size", "dialog-size" (for org_capture)
# TODO: Support way to cycle through predefined sizes.
for_window [class="GoogleEmacs" instance="floating"] floating enable, resize set height 1200px, resize set width 780px
# Here is a sketch of the cycle sizes idea.
# TODO: Support this.
# mode "cycle_sizes_floating_mode" {
# # coding mode
# bindsym a for_window [mode="floating", class="actively-selected"] resize set height 1200px, resize set width 780px
# bindsym b for_window [mode="floating", class="actively-selected"] resize set height 500px, resize set width 500px
#
# bindsym Escape mode "default"
# bindsym Ctrl+g mode "default"
# bindsym Ctrl+c mode "default"
# }
# ensure Spotify windows float
for_window [class="Spotify"] floating enable
# ensure system service that run through XDG start
exec --no-startup-id dex -ae i3
# rofi configuration
bindsym $mod+space exec --no-startup-id rofi -show combi
bindsym $mod+t exec --no-startup-id ~/.config/i3/dmenu_timer.sh ~/.local/share/sounds/gong.mp3
# switch workspaces
bindsym $mod+Tab workspace next
bindsym $mod+Shift+Tab workspace prev
# file manager
bindsym $mod+n exec $terminal -x lf ~/Dropbox
# clipboard manager
# NOTE: Ctrl-c is already covered since `clipmenu` listens for X clipboard
# events using `clipnotify`.
# NOTE: `clipmenud` is started in `.xsessionrc.shared`
# NOTE: This is a bit of a hack intended to support pasting in both the terminal
# and in GUI applications. `st` expects `ctrl+Shift+v` while GUIs expect
# `ctrl+v`. In the instances where GUIs don't support `ctrl+Shift+v` already, it
# acts like `ctrl+v`, so it should "just work".
bindsym Ctrl+$mod+v exec clipmenu && xdotool key --clearmodifiers ctrl+Shift+v
# Screenshot
# TODO: Support variants: (a) App (r) Region (f) Fullscreen.
# TODO: Support hosting to third-party image hosting.
set $screenshot_mode Screenshot (g) googleplex (l) local
mode "$screenshot_mode" {
bindsym g exec zsh -i -c snipit, mode "default"
bindsym l exec zsh -i -c screenshot, mode "default"
bindsym Escape mode "default"
bindsym Ctrl+g mode "default"
bindsym Ctrl+c mode "default"
}
bindsym $mod+s mode "$screenshot_mode"
# online documentation
bindsym $mod+Shift+slash exec $browser https://i3wm.org/docs/userguide.html
# no title bars
for_window [class="^.*"] border pixel 1
# disable mouse hover focus
focus_follows_mouse no
# kill focused window
bindsym $window+q kill
# Toggle focus
bindsym $window+f floating toggle
# GTK Themes
exec --no-startup-id gnome-settings-daemon
# wireless selection mechanism
exec --no-startup-id nm-applet
# set the split direction
bindsym $mod+v split vertical
# cannot bind $mod+h because of movement commands
bindsym $mod+Shift+v split horizontal
# sound applet
exec --no-startup-id gnome-sound-applet
# change focus
bindsym $window+h focus left
bindsym $window+j focus down
bindsym $window+k focus up
bindsym $window+l focus right
# move focused window
bindsym $mod+Shift+h move left 100
bindsym $mod+Shift+j move down 100
bindsym $mod+Shift+k move up 100
bindsym $mod+Shift+l move right 100
# enter fullscreen mode for the focused container
bindsym $window+z fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $super+e layout toggle split
bindsym $super+s layout stacking
bindsym $super+t layout tabbed
# toggle tiling / floating
bindsym $mod+Shift+f floating toggle
# toggle stickiness
bindsym $mod+Shift+s sticky toggle
# focus the parent container
# bindsym $mod+a focus parent
bindsym $mod+Shift+a focus child
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
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"
# jump to workspace
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
# edit configuration files
# TODO: Standardize KBDs for C,R,U,D operations.
# TODO: Move shell script to /usr/local/bin
# Create
# TODO: Choose another KBD. This is temporary.
bindsym $mod+a exec zsh -i -c add_config
# Read
bindsym $mod+c exec zsh -i -c edit_config
# Update
# TODO: Support operation to update_config label and path
# Delete
bindsym $mod+Shift+c exec zsh -i -c rm_config
# move and follow focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1; workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2; workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3; workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4; workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5; workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6; workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7; workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8; workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9; workspace $ws9
bindsym $mod+Shift+0 move container to workspace $ws10; workspace $ws10
# move focused container to workspace
bindsym $mod+Ctrl+1 move container to workspace $ws1
bindsym $mod+Ctrl+2 move container to workspace $ws2
bindsym $mod+Ctrl+3 move container to workspace $ws3
bindsym $mod+Ctrl+4 move container to workspace $ws4
bindsym $mod+Ctrl+5 move container to workspace $ws5
bindsym $mod+Ctrl+6 move container to workspace $ws6
bindsym $mod+Ctrl+7 move container to workspace $ws7
bindsym $mod+Ctrl+8 move container to workspace $ws8
bindsym $mod+Ctrl+9 move container to workspace $ws9
bindsym $mod+Ctrl+0 move container to workspace $ws10
# reload, restart i3
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
# logout dialog
set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown
mode "$mode_system" {
bindsym l exec --no-startup-id xsecurelock, mode "default"
bindsym e exit, mode "default"
bindsym s exec --no-startup-id xsecurelock && systemctl suspend, mode "default"
bindsym h exec --no-startup-id xsecurelock && systemctl hibernate, mode "default"
bindsym r exec --no-startup-id systemctl reboot, mode "default"
bindsym Shift+s exec --no-startup-id systemctl poweroff, mode "default"
# back to normal: Enter or Escape
bindsym Escape mode "default"
bindsym Ctrl+g mode "default"
bindsym Ctrl+c mode "default"
}
bindsym Ctrl+Mod1+Delete mode "$mode_system"
# resize window (you can also use the mouse for that)
mode "resize" {
bindsym h resize shrink width 10 px or 10 ppt
bindsym j resize shrink height 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize grow width 10 px or 10 ppt
bindsym Escape mode "default"
bindsym Ctrl+g mode "default"
bindsym Ctrl+c mode "default"
}
bindsym $mod+Shift+r mode "resize"
# passthrough mode to support Emacs, Tmux, Vim KBDs for window and pane management
mode "passthrough" {
bindsym $mod+Escape mode "default"
}
bindsym $mod+Escape mode "passthrough"
# class border backgr text indicator child_border
# client.focused {active} {active} {color15} {color2} {active}
# client.focused_inactive {active} {active} {color15} {color2} {inactive}
# client.unfocused {inactive} {inactive} {color15} {color2} {inactive}
# client.urgent {color2} {color2} {color15} {color2} {color2}
# client.placeholder {color0} {color8} {color15} {color0} {color8}
# client.background {color0}
bar {
status_command i3status
font pango:Monospace 10px
position top
# disable system tray icons
tray_output none
colors {
# background {color0}
# statusline {inactive}
# separator {active}
# class border text indicator
# focused_workspace {active} {color15} {color0}
# active_workspace {active} {inactive} {active}
# inactive_workspace {inactive} {active} {inactive}
# urgent_workspace {inactive} {active} {inactive}
}
}
# wpg integration
exec --no-startup-id ~/.config/wpg/wp_init.sh

View file

@ -1,113 +0,0 @@
#!/usr/bin/env bash
# Select common timer intervals with dmenu and play an alarm sound when
# finished. Useful if you bind a KBD in a window manager such as i3. Pass the
# path to the alarm mp3 as the only argument.
#
# Usage: ./dmenu_timer.sh path/to/alarm.mp3
times=$(cat <<EOF
1 minute
2 minutes
3 minutes
4 minutes
5 minutes
10 minutes
15 minutes
20 minutes
30 minutes
45 minutes
1 hour
2 hours
EOF
)
selection=$(echo "$times" | dmenu)
case $selection in
'1 minute')
notify-send 'Timer' 'Set for 1 minute' && \
sleep 1m && \
notify-send 'Timer' 'Finished.' && \
mpg123 $1 && \
exit 0
;;
'2 minutes')
notify-send 'Timer' 'Set for 2 minute' && \
sleep 2m && \
notify-send 'Timer' 'Finished.' && \
mpg123 $1 && \
exit 0
;;
'3 minutes')
notify-send 'Timer' 'Set for 3 minutes' && \
sleep 3m && \
notify-send 'Timer' 'Finished.' && \
mpg123 $1 && \
exit 0
;;
'4 minutes')
notify-send 'Timer' 'Set for 4 minutes' && \
sleep 4m && \
notify-send 'Timer' 'Finished.' && \
mpg123 $1 && \
exit 0
;;
'5 minutes')
notify-send 'Timer' 'Set for 5 minutes' && \
sleep 5m && \
notify-send 'Timer' 'Finished.' && \
mpg123 $1 && \
exit 0
;;
'10 minutes')
notify-send 'Timer' 'Set for 10 minutes' && \
sleep 10m && \
notify-send 'Timer' 'Finished.' && \
mpg123 $1 && \
exit 0
;;
'15 minutes')
notify-send 'Timer' 'Set for 15 minutes' && \
sleep 15m && \
notify-send 'Timer' 'Finished.' && \
mpg123 $1 && \
exit 0
;;
'20 minutes')
notify-send 'Timer' 'Set for 20 minutes' && \
sleep 20m && \
notify-send 'Timer' 'Finished.' && \
mpg123 $1 && \
exit 0
;;
'30 minutes')
notify-send 'Timer' 'Set for 30 minutes' && \
sleep 30m && \
notify-send 'Timer' 'Finished.' && \
mpg123 $1 && \
exit 0
;;
'45 minutes')
notify-send 'Timer' 'Set for 45 minutes' && \
sleep 45m && \
notify-send 'Timer' 'Finished.' && \
mpg123 $1 && \
exit 0
;;
'1 hour')
notify-send 'Timer' 'Set for 1 hour' && \
sleep 1h && \
notify-send 'Timer' 'Finished.' && \
mpg123 $1 && \
exit 0
;;
'2 hours')
notify-send 'Timer' 'Set for 2 hours' && \
sleep 2h && \
notify-send 'Timer' 'Finished.' && \
mpg123 $1 && \
exit 0
;;
*)
notify-send 'Timer' 'No supported time selected. Exiting...' && exit 1
esac

View file

@ -1,25 +0,0 @@
#!/usr/bin/env bash
shopt -s nullglob globstar
typeit=0
if [[ $1 == "--type" ]]; then
typeit=1
shift
fi
prefix=${PASSWORD_STORE_DIR-~/.password-store}
password_files=( "$prefix"/**/*.gpg )
password_files=( "${password_files[@]#"$prefix"/}" )
password_files=( "${password_files[@]%.gpg}" )
password=$(printf '%s\n' "${password_files[@]}" | dmenu "$@")
[[ -n $password ]] || exit
if [[ $typeit -eq 0 ]]; then
pass show -c "$password" 2>/dev/null
else
pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } |
xdotool type --clearmodifiers --file -
fi

View file

@ -1,76 +0,0 @@
// vim:ts=4:sw=4:et
{
// splitv split container with 2 children
"border": "normal",
"floating": "auto_off",
"layout": "splitv",
"percent": 0.5,
"type": "con",
"nodes": [
{
"border": "pixel",
"current_border_width": 3,
"floating": "auto_off",
"geometry": {
"height": 925,
"width": 1072,
"x": 0,
"y": 0
},
"name": "emacs@wpcarro.lon.corp.google.com",
"percent": 0.5,
"swallows": [
{
"class": "^GoogleEmacs$",
"instance": "^emacs$",
"title": "^google-emacs$"
}
],
"type": "con"
},
{
"border": "pixel",
"current_border_width": 3,
"floating": "auto_off",
"geometry": {
"height": 484,
"width": 724,
"x": 0,
"y": 0
},
"name": "i3-save-tree",
"percent": 0.5,
"swallows": [
{
"class": "^st\\-256color$",
"instance": "^st\\-256color$",
"title": "^st-term$"
}
],
"type": "con"
}
]
}
{
"border": "pixel",
"current_border_width": 3,
"floating": "auto_off",
"geometry": {
"height": 2125,
"width": 1914,
"x": 1923,
"y": 32
},
"name": "i3: Layout saving in i3 - Google Chrome",
"percent": 0.5,
"swallows": [
{
"class": "^Google\\-chrome$",
"instance": "^google\\-chrome$",
"title": "Chrome",
"window_role": "^browser$"
}
],
"type": "con"
}

View file

@ -1,58 +0,0 @@
general {
markup = pango
separator = " "
colors = true
}
/* order += "battery 0" # TODO: remove this if "battery 1" works for Dell */
order += "battery 1" # trying to support two different laptops
order += "tztime local"
order += "tztime lon"
order += "tztime est"
order += "tztime pst"
order += "disk /"
disk "/" {
prefix_type = "decimal"
format = "%used/%total"
}
# Useful commands for dealing with timezones:
# - cat /etc/timezone
# - man date
# - timedatectl
tztime local {
format = "%d/%m/%Y"
}
tztime lon {
format = "LON %H:%M"
timezone = "Europe/London"
}
tztime est {
format = "NYC %H:%M"
timezone = "US/Eastern"
}
tztime pst {
format = "MTV %H:%M"
timezone = "US/Pacific"
}
# TODO: remove this if "battery 1" works for Dell laptop
/* battery 0 { */
/* format = "Battery %percentage" */
/* format_down = "" # This hides the battery when there isn't any (e.g. on a Desktop) */
/* low_threshold = 30 */
/* threshold_type = time */
/* integer_battery_capacity = true */
/* } */
battery 1 {
format = "Battery %percentage"
format_down = "" # This hides the battery when there isn't any (e.g. on a Desktop)
low_threshold = 30
threshold_type = time
integer_battery_capacity = true
}

View file

@ -1,4 +1,3 @@
':/usr/local/google/home/wpcarro/Dropbox/programming/i3-quickterm
D:~/Dropbox
G:/usr/local/google/home/wpcarro/Downloads
M:/usr/local/google/home/wpcarro/Downloads

View file

@ -253,7 +253,6 @@ 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.shared<CR>
" quickly source your vimrc
nnoremap <leader>sv :source $MYVIMRC<CR>

View file

@ -23,7 +23,6 @@
("variables" . "~/variables.zsh")
("Xresources" . "~/.Xresources.shared")
("tmux" . "~/.tmux.conf")
("i3" . "~/.config/i3/config") ;; TODO: Remove this one day.
("zshrc" . "~/.zshrc")
("configuration.nix" . "~/Dropbox/programming/nixify/configuration.nix")
("init.el" . "~/.emacs.d/init.el")

View file

@ -124,7 +124,6 @@
"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.shared"))
"em" (lambda () (interactive) (wpc/find-file-split "~/.tmux.conf"))
"l" #'locate

View file

@ -60,19 +60,5 @@
:config
(general-add-hook 'org-mode-hook (enable org-bullets-mode)))
;; i3, `org-mode' integration
;; Heavily influenced by: https://somethingsomething.us/post/i3_and_orgmode/
;; TODO: Consider generalizing this since we're using "floating".
(defadvice org-switch-to-buffer-other-window
(after supress-window-splitting activate)
"Delete the extra window if we're in a capture frame."
(if (equal "floating" (wpc/frame-name))
(delete-other-windows)))
(add-hook 'org-capture-after-finalize-hook
(lambda ()
(when (equal "floating" (wpc/frame-name))
(delete-frame))))
(provide 'wpc-org)
;;; wpc-org.el ends here

View file

@ -1,10 +1,10 @@
;;; window-manager.el --- Functions to ease my transition to EXWM. -*- lexical-binding: t -*-
;;; window-manager.el --- Functions augmenting my usage of EXWM. -*- lexical-binding: t -*-
;; Author: William Carroll <wpcarro@gmail.com>
;;; Commentary:
;; It's possible that this module will be entirely temporary. Creating it after
;; switching to EXWM to help transfer my reliance from i3 to EXWM.
;;
;; I switched to EXWM from i3, and I haven't looked back. One day I may write a
;; poem declaring my love for Emacs and EXWM. For now, I haven't the time.
;; Wish list:
;; - TODO: Support different startup commands and layouts depending on laptop or
;; desktop.

View file

@ -30,7 +30,6 @@ chatnets = {
channels = (
{ name = "#nixos"; chatnet = "Freenode"; autojoin = "No"; },
{ name = "#i3"; chatnet = "Freenode"; autojoin = "No"; },
{ name = "#pass"; chatnet = "Freenode"; autojoin = "No"; },
);

View file

@ -5,13 +5,6 @@
export DESKTOP_SESSION=cinnamon # gnome for trusty.
# NOTE: This may break your compose key.
# See http://g/i3-users/YBexXGbik7E for more details.
# NOTE: IM_MODULE is an "Input Method" module, which I believe affects the way
# keyboard events are processed. `xim` is "X Input Method"; other options
# include: `ibus`, `fcitx`, but I'm unsure what features each offers.
# export GTK_IM_MODULE=xim
# Desktop background color.
xsetroot -solid "#333333"

View file

@ -221,7 +221,6 @@ 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 em='e ~/.tmux.conf'
# TODO: consider DRYing this up with `e`. Unfortunately, `sudo` won't support
# aliases.
@ -234,7 +233,6 @@ alias sa='source ~/aliases.zsh'
alias sf='source ~/functions.zsh'
alias sl='source ~/variables.zsh'
alias sx='xrdb ~/.Xresources'
alias si='i3-msg restart'
alias sm='tmux source-file ~/.tmux.conf'
alias sn='sudo nixos-rebuild switch'

View file

@ -431,7 +431,6 @@ snipit() {
# Take a screenshot and host it at https://screenshot.googleplex.com
# Adapted from SnipIt to fit my workflow.
# depends alert_echo
# TODO: Ensure C-c works with i3 integration.
server="https://screenshot.googleplex.com/upload"
file="${TEMP:-/tmp}/snipit_temp_$$.png"
@ -477,33 +476,6 @@ dkish() {
docker run -it $@
}
# Emacs
dired() {
# Opens either the `$(pwd)` or `$1` in Emacs's `dired`.
# Uses i3 to focus Emacs.
directory=${1:-$(pwd)}
echo $directory
emacsclient --eval "(dired \"$directory\")" && focus Emacs
}
emacsclient_floating() {
# Creates an Emacs frame that i3 will float.
# All additional arguments are forwarded to `emacsclient`.
# Usage: emacs_floating [...additional-args]
# depends emacsclient
emacsclient \
--create-frame \
--frame-parameters '(quote (name . "floating"))' \
"$@"
}
org_capture() {
# Spawns an Emacs frame running org-capture.
# Usage: org_capture
# depends emacsclient_floating
emacsclient_floating --eval '(org-capture)'
}
# gist
gistp() {
# Creates a gist with the contents of the clipboard.
@ -684,8 +656,7 @@ update_x11_forwarding() {
}
monzo_balance() {
# Return the balance of my Monzo bank account. Intended to be used in my i3
# status bar.
# Return the balance of my Monzo bank account.
# Usage: monzo_balance
# Depends:
# - ~/Dropbox/monzo_creds.json.gpg (encrypted asymmetrically for yourself)
@ -699,7 +670,6 @@ monzo_balance() {
"Authorization: Bearer ${access_token}" \
"account_id==${account_id}" | \
jq .balance)
echo "£$balance"
}
@ -1129,12 +1099,6 @@ cider() {
--app="https://cider.corp.google.com/?ws=$(citc_workspace)"
}
# i3
focus() {
# Focuses an i3 window by application name.
i3-msg "[class=\"$1\"] focus" >/dev/null
}
# C
runc() {
# Compile and run $1. Pass $1 as file.c.
@ -1208,71 +1172,3 @@ gvcci() {
# TODO: Why do I need this?
sleep 0.1 && feh --bg-scale $1
}
################################################################################
# Configuration file management
################################################################################
# Easily management the myriad of configuration files required to set my
# preferences. This is intended to be integrated with i3.
# TODO: Support editing config name.
# TODO: Support editing config filepath.
# TODO: Is there a way to get rofi to just display information.
# E.g. output of `ls_configs`.
prompt_config() {
# Asks the user which file they'd like to edit. Returns the filepath to that
# configuration file.
local name=$(kv_keys configuration_files | rofi -dmenu)
kv_get configuration_files "$name"
}
add_config() {
# Adds a configuration file to the configuration file database.
# NOTE: Cannot use `local` here if I want to capture the exit code of the
# subshell.
name=$(rofi_prompt 'Config name')
local ec=$?
if [ $ec -eq 0 ]; then
filepath=$(rofi_prompt 'Path to file')
ec=$?
if [ $ec -eq 0 ]; then
kv_set configuration_files "$name" "$filepath"
else
echo 'Failed to get a path for the config. Exiting...'
return $ec
fi
else
echo 'Failed to get a name for the config. Exiting...'
return $ec
fi
}
edit_config() {
# Opens the selected configuration file in an editor.
# depends emacsclient_floating
emacsclient_floating "$(prompt_config)"
}
rm_config() {
# Removes a configuration file from the configuration file database.
name=$(kv_keys configuration_files | rofi -dmenu)
local ec=$?
if [ $ec -eq 0 ]; then
kv_delete configuration_files "$name"
else
echo 'Failed to get a name for the config. Exiting...'
return $ec
fi
}
ls_configs() {
# Lists
kv_entries configuration_files
}

View file

@ -1,48 +0,0 @@
general {
markup = "pango"
separator = " "
colors = true
}
order += "battery 0"
order += "tztime local"
order += "tztime lon"
order += "tztime est"
order += "tztime pst"
order += "disk /"
disk "/" {
prefix_type = "decimal"
format = "%used/%total"
}
# Useful commands for dealing with timezones:
# - cat /etc/timezone
# - man date
# - timedatectl
tztime local {
format = "%d/%m/%Y"
}
tztime lon {
format = "LON %H:%M"
timezone = "Europe/London"
}
tztime est {
format = "NYC %H:%M"
timezone = "US/Eastern"
}
tztime pst {
format = "MTV %H:%M"
timezone = "US/Pacific"
}
battery 0 {
format = "Battery %percentage"
format_down = "" # This hides the battery when there isn't any (e.g. on a Desktop)
low_threshold = 30
threshold_type = time
integer_battery_capacity = true
}

View file

@ -63,5 +63,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"
n="/etc/nixos/configuration.nix"

30
i3_exit
View file

@ -1,30 +0,0 @@
#!/bin/sh
lock() {
i3lock
}
case "$1" in
lock)
xsecurelock
;;
logout)
i3-msg exit
;;
suspend)
lock && systemctl suspend
;;
hibernate)
lock && systemctl hibernate
;;
reboot)
systemctl reboot
;;
shutdown)
systemctl poweroff
;;
*)
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"
exit 2
esac
exit 0