about summary refs log tree commit diff
path: root/configs/shared/misc/.config
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2019-03-18T14·14+0000
committerWilliam Carroll <wpcarro@gmail.com>2019-03-18T14·14+0000
commitf7b3e0a7a92903307ef1f4c66992721be6e01e08 (patch)
tree11f1959ee6dc34d2f8b20e6425cbb85700b55c63 /configs/shared/misc/.config
parentbf33edaa6efbf3572d9335bb07b530af249de0d2 (diff)
Drop OSX support; support desktop, laptop, cloudtop
Dropping support for OSX. Moving forward these dotfiles will depend on Linux
systems. Furthermore, since I'm support a ~/bin, the machines that consume these
dotfiles depend on i386 architectures. Linux and i386 are two dependencies that
I'm okay with since the leverage this assumption provides, makes their existence
tolerable.

There is some Google leakage herein, which includes aliases, functions, and
mentions of cloudtop. For now, this is okay. I may break the Google specific
code into its own repository, but for now, this is less maintenance.

This also introduces a ~/.profile instead of erroneously defining environment
variables in my zshrc file, which was unadvised.

This is a large commit and also introduces new aliases, variables, functions
that I accumulated over the past week or so while migrating away from OSX and
onto my new setup. Hopefully in the future I'll be more precise with my commits.
Diffstat (limited to 'configs/shared/misc/.config')
-rw-r--r--configs/shared/misc/.config/i3/config248
-rwxr-xr-xconfigs/shared/misc/.config/i3/dmenu_timer.sh113
-rwxr-xr-xconfigs/shared/misc/.config/i3/passmenu25
-rw-r--r--configs/shared/misc/.config/i3/workspace_1.json76
-rw-r--r--configs/shared/misc/.config/i3status/config29
-rw-r--r--configs/shared/misc/.config/lf/lfrc1
-rw-r--r--configs/shared/misc/.config/nvim/init.vim4
-rw-r--r--configs/shared/misc/.config/rofi/config1
-rw-r--r--configs/shared/misc/.config/terminator/config20
9 files changed, 514 insertions, 3 deletions
diff --git a/configs/shared/misc/.config/i3/config b/configs/shared/misc/.config/i3/config
new file mode 100644
index 000000000000..d020ace806a4
--- /dev/null
+++ b/configs/shared/misc/.config/i3/config
@@ -0,0 +1,248 @@
+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
+# 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.
+
+# 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
+
+# Use Mouse+$mod to drag floating windows to their wanted position
+floating_modifier $mod
+
+# gaps
+# gaps inner 20
+# gaps outer 0
+# smart_gaps on
+
+# KBD Principles:
+# $mod+Ctrl+<app_char>       = starting an application vertically
+# $mod+Ctrl+Shift+<app_char> = starting an application horizontally
+# where <app_char> is a reserved character for a commonly used application.
+#
+# <app_char> definitions:
+# terminal = t, Return
+# emacs    = e
+# chrome   = c
+# spotify  = s
+#
+# Vertical
+bindsym $mod+Ctrl+t            split v; exec st
+bindsym $mod+Ctrl+Return       split v; exec st
+bindsym $mod+Ctrl+e            split v; exec emacs
+bindsym $mod+Ctrl+c            split v; exec google-chrome
+bindsym $mod+Ctrl+s            split v; exec spotify
+# Horizontal
+bindsym $mod+Ctrl+Shift+t      split h; exec st
+bindsym $mod+Ctrl+Shift+Return split h; exec st
+bindsym $mod+Ctrl+Shift+e      split h; exec emacs
+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
+
+# ensure Spotify windows float
+for_window [class="Spotify"] floating enable
+
+# ensure wallpaper
+exec --no-startup-id feh --bg-scale ~/.local/share/wallpaper/cartoon-outdoors.jpg
+
+# ensure system service that run through XDG start
+exec dex -ae i3
+
+# dmenu configuration
+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 ~/bin/lf # TODO: reconsider hardlink and expose ZSH's PATH to i3
+
+# 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
+
+# Screenshot
+bindsym $mod+s       exec zsh -i -c snipit
+bindsym Ctrl+Print   exec scrot  ~/Pictures/screenshots/%b-%d-%Y_%T.png          # Windows 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
+# TODO: debug
+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
+bindsym $mod+Shift+slash exec google-chrome https://i3wm.org/docs/userguide.html
+
+# no title bars
+for_window [class="^.*"] border pixel 2
+
+# disable mouse hover focus
+focus_follows_mouse no
+
+# kill focused window
+bindsym $mod+q kill
+
+# GTK Themes
+exec --no-startup-id gnome-settings-daemon
+
+# wireless selection mechanism
+exec --no-startup-id nm-applet
+
+# lock the screen (Window's famous Ctrl-Alt-Delete)
+bindsym $mod+Ctrl+Delete exec "/usr/share/goobuntu-desktop-files/xsecurelock.sh"
+bindsym $mod+Shift+q     exec "/usr/share/goobuntu-desktop-files/xsecurelock.sh"
+
+# sound applet
+exec --no-startup-id gnome-sound-applet
+
+# change focus
+bindsym $mod+h focus left
+bindsym $mod+j focus down
+bindsym $mod+k focus up
+bindsym $mod+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
+
+# enable duplicating the current window vertically or horizontally
+# bindsym $mod+- split v exec terminator
+# bindsym $mod+\ split h exec terminator
+
+# enter fullscreen mode for the focused container
+bindsym $mod+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
+
+# change focus between tiling / floating windows
+bindsym $mod+f focus mode_toggle
+
+# focus the parent container
+bindsym $mod+a focus parent
+
+# 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
+
+# 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 # commented out to support screenshot KBD
+# bindsym $mod+Shift+4 move container to workspace $ws4;  workspace $ws4 # commented out to support screenshot KBD
+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       reload
+bindsym $super+Shift+r restart
+
+
+# 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 Return       mode "default"
+        bindsym Caps_Lock    mode "default"
+        bindsym $mod+Shift+r 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"
+
+# Colors
+set $foreground #61afef
+set $background #dfdfdf
+
+# window borders
+# Format:      border      background  text        indicator   child_border
+client.focused $foreground $background $foreground $foreground $foreground
+
+bar {
+    status_command i3status
+    position top
+}
diff --git a/configs/shared/misc/.config/i3/dmenu_timer.sh b/configs/shared/misc/.config/i3/dmenu_timer.sh
new file mode 100755
index 000000000000..9d62ead73091
--- /dev/null
+++ b/configs/shared/misc/.config/i3/dmenu_timer.sh
@@ -0,0 +1,113 @@
+#!/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
diff --git a/configs/shared/misc/.config/i3/passmenu b/configs/shared/misc/.config/i3/passmenu
new file mode 100755
index 000000000000..71c4538fa61a
--- /dev/null
+++ b/configs/shared/misc/.config/i3/passmenu
@@ -0,0 +1,25 @@
+#!/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
\ No newline at end of file
diff --git a/configs/shared/misc/.config/i3/workspace_1.json b/configs/shared/misc/.config/i3/workspace_1.json
new file mode 100644
index 000000000000..b5d3f9d8c53f
--- /dev/null
+++ b/configs/shared/misc/.config/i3/workspace_1.json
@@ -0,0 +1,76 @@
+// 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"
+}
diff --git a/configs/shared/misc/.config/i3status/config b/configs/shared/misc/.config/i3status/config
new file mode 100644
index 000000000000..9df0af323846
--- /dev/null
+++ b/configs/shared/misc/.config/i3status/config
@@ -0,0 +1,29 @@
+general {
+        markup = "pango"
+        separator = " "
+        colors = true
+}
+
+order += "time"
+order += "tztime est"
+order += "tztime pst"
+order += "disk /"
+
+disk "/" {
+     prefix_type = "decimal"
+     format = "%avail / %total"
+}
+
+time {
+     format = "%H:%M - %D"
+}
+
+tztime est {
+     format = "%H:%M EST"
+     timezone = "US/Eastern"
+}
+
+tztime pst {
+     format = "%H:%M PST"
+     timezone = "US/Pacific"
+}
\ No newline at end of file
diff --git a/configs/shared/misc/.config/lf/lfrc b/configs/shared/misc/.config/lf/lfrc
new file mode 100644
index 000000000000..59b8e5d80676
--- /dev/null
+++ b/configs/shared/misc/.config/lf/lfrc
@@ -0,0 +1 @@
+map D delete
\ No newline at end of file
diff --git a/configs/shared/misc/.config/nvim/init.vim b/configs/shared/misc/.config/nvim/init.vim
index 4da8a5537076..148341a2c2ef 100644
--- a/configs/shared/misc/.config/nvim/init.vim
+++ b/configs/shared/misc/.config/nvim/init.vim
@@ -375,9 +375,6 @@ let g:airline_theme = 'hybrid'
 let g:swoopHighlight = ["hi! link SwoopBufferLineHi Warning", "hi! link SwoopPatternHi Error"]
 
 
-nnoremap <M-q> :q<CR>
-
-
 " Jump to buffers.
 nmap <F1> :1b<CR>
 nmap <F2> :2b<CR>
@@ -525,6 +522,7 @@ nnoremap <silent> <M-h> :TmuxNavigateLeft<CR>
 nnoremap <silent> <M-j> :TmuxNavigateDown<CR>
 nnoremap <silent> <M-k> :TmuxNavigateUp<CR>
 nnoremap <silent> <M-l> :TmuxNavigateRight<CR>
+nnoremap <silent> <M-q> :q<CR>
 
 " make Y do what is intuitive given:
 "   D: deletes until EOL
diff --git a/configs/shared/misc/.config/rofi/config b/configs/shared/misc/.config/rofi/config
new file mode 100644
index 000000000000..3bc0a7cab04e
--- /dev/null
+++ b/configs/shared/misc/.config/rofi/config
@@ -0,0 +1 @@
+rofi.theme: /usr/share/rofi/themes//lb.rasi
diff --git a/configs/shared/misc/.config/terminator/config b/configs/shared/misc/.config/terminator/config
new file mode 100644
index 000000000000..5e62b9d4be5c
--- /dev/null
+++ b/configs/shared/misc/.config/terminator/config
@@ -0,0 +1,20 @@
+[global_config]
+[keybindings]
+[layouts]
+  [[default]]
+    [[[child1]]]
+      parent = window0
+      type = Terminal
+    [[[window0]]]
+      parent = ""
+      type = Window
+[plugins]
+[profiles]
+  [[default]]
+    background_type = transparent
+    cursor_color = "#aaaaaa"
+    cursor_shape = ibeam
+    font = Source Code Pro 12
+    scrollbar_position = hidden
+    show_titlebar = False
+    use_system_font = False