From 365b995c3a832589602cbeb60b5f047d7052359a Mon Sep 17 00:00:00 2001 From: Tobias Manske Date: Thu, 5 Apr 2018 16:17:46 +0200 Subject: [PATCH] modular i3 --- Makefile | 3 +- i3/conf/build.sh | 14 ++++++- i3/conf/client/Cyb3r/assignments | 21 ++++++++++ i3/conf/client/Cyb3r/header | 29 ++++++++++++++ i3/conf/client/ThinkPad/header | 2 +- i3/conf/client/default/assignments | 16 ++++++++ i3/conf/client/default/header | 25 ++++++++++++ i3/conf/common/base | 59 ++--------------------------- i3/conf/common/footer | 5 +++ i3/scripts/dmenu/database.sqlite | Bin 90112 -> 90112 bytes tmux/plugins/tmux-copycat | 2 +- tmux/plugins/tmux-prefix-highlight | 2 +- 12 files changed, 117 insertions(+), 61 deletions(-) create mode 100644 i3/conf/client/Cyb3r/assignments create mode 100644 i3/conf/client/Cyb3r/header create mode 100644 i3/conf/client/default/assignments create mode 100644 i3/conf/client/default/header create mode 100644 i3/conf/common/footer diff --git a/Makefile b/Makefile index ca770d3..9395336 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,7 @@ zsh: i3: dep ln -s ~/.dotfiles/i3 ~/.config/i3 + cd i3/conf/ && ./build.sh .PHONY: clean zsh git vim tmux i3 clean: @@ -40,6 +41,6 @@ dep: cd /tmp/powerline-font && makepkg -Acs && sudo pacman -U *.pkg.* git clone https://aur.archlinux.org/bumblebee-status-git.git /tmp/bumblebee cd /tmp/bumblebee && makepkg -Acs && sudo pacman -U *.pkg.* - sudo pacman -S awesome-terminal-fonts + sudo pacman -S awesome-terminal-fonts perl-anyevent-i3 perl-json-xs all: clean tmux vim git zsh i3 xresources diff --git a/i3/conf/build.sh b/i3/conf/build.sh index 9d0a4c5..7d5cca6 100755 --- a/i3/conf/build.sh +++ b/i3/conf/build.sh @@ -1,3 +1,13 @@ #!/bin/bash -rm ~/.dotfiles/i3/config -cat ~/.dotfiles/i3/conf/client/$(hostname)/head ~/.dotfiles/i3/conf/common/base > ~/.dotfiles/i3/config +COMMON=~/.dotfiles/i3/conf/common/ +CLIENT=~/.dotfiles/i3/conf/client/$(hostname)/ + +if [ -f "~/.dotfiles/i3/config" ]; then + rm ~/.dotfiles/i3/config +fi + +if [ ! -d $CLIENT ]; then + cp -r ~/.dotfiles/i3/conf/client/default ~/.dotfiles/i3/conf/client/$(hostname) +fi + +cat ${CLIENT}header ${COMMON}base ${CLIENT}assignments ${COMMON}footer > ~/.dotfiles/i3/config diff --git a/i3/conf/client/Cyb3r/assignments b/i3/conf/client/Cyb3r/assignments new file mode 100644 index 0000000..43d7ad2 --- /dev/null +++ b/i3/conf/client/Cyb3r/assignments @@ -0,0 +1,21 @@ +# {{{ ASSIGNMENTS }}} + + # Browser + # workspace $ws1 gaps outer 0 + # workspace $ws1 gaps inner 0 + assign [class="Firefox"] $ws1 + + # Terminal + assign [class="URxvt"] $ws2 + + # CHAT + assign [class="discord"] $ws4 + assign [class="TelegramDesktop"] $ws4 + exec_always 'i3-msg "workspace number 4; append_layout ~/.layout/ws-4.json"' + + # Mail + workspace $ws5 gaps outer 0 + workspace $ws5 gaps inner 0 + assign [class="Thunderbird"] $ws5 + # KeepassXC + assign [class="keepassxc"] $ws10 diff --git a/i3/conf/client/Cyb3r/header b/i3/conf/client/Cyb3r/header new file mode 100644 index 0000000..2496918 --- /dev/null +++ b/i3/conf/client/Cyb3r/header @@ -0,0 +1,29 @@ +set $CLIENT_BUMBLEBEE -m mpd load memory disk nic caffeine amixer datetime -p nic.states=^down -t greyish-powerline + +# {{{ VARIABLES }}} + + set $mod Mod4 + set $TERMINAL urxvt + + # gaps + set $gap_outer 25 + set $gap_inner 15 + + set $ws1 "1 " + # Terminal + set $ws2 "2 " + # Work + set $ws3 "3 " + # Chat + set $ws4 "4 " + # Mail + set $ws5 "5 " + set $ws6 "6" + set $ws7 "7" + set $ws8 "8" + set $ws9 "9" + set $ws10 "10" + +# {{{ SPECIAL KEYBINDINGS }}} + +bindsym $mod+m move workspace to output right diff --git a/i3/conf/client/ThinkPad/header b/i3/conf/client/ThinkPad/header index 4a73b9d..ebada29 100644 --- a/i3/conf/client/ThinkPad/header +++ b/i3/conf/client/ThinkPad/header @@ -1 +1 @@ -set $CLIENT_BUMBLEBEE "-m disk nic sensors battery caffeine amixer brightness datetime -p battery.device=BAT0,BAT1 brightness.device_path=/sys/class/backlight/acpi_video0 disk.format={left} nic.states=^down sensors.path=/sys/class/thermal/thermal_zone2/temp -t greyish-powerline" +set $CLIENT_BUMBLEBEE -m disk nic sensors battery caffeine amixer brightness datetime -p battery.device=BAT0,BAT1 brightness.device_path=/sys/class/backlight/acpi_video0 disk.format={left} nic.states=^down sensors.path=/sys/class/thermal/thermal_zone2/temp -t greyish-powerline diff --git a/i3/conf/client/default/assignments b/i3/conf/client/default/assignments new file mode 100644 index 0000000..6b58d0d --- /dev/null +++ b/i3/conf/client/default/assignments @@ -0,0 +1,16 @@ +# {{{ WORKSPACES }}} + + # Browser + workspace $ws1 gaps outer 0 + workspace $ws1 gaps inner 0 + assign [class="Firefox"] $ws1 + + # Terminal + assign [class="URxvt"] $ws2 + + # Mail + workspace $ws5 gaps outer 0 + workspace $ws5 gaps inner 0 + assign [class="Thunderbird"] $ws5 + # KeepassXC + assign [class="keepassxc"] $ws10 diff --git a/i3/conf/client/default/header b/i3/conf/client/default/header new file mode 100644 index 0000000..2d55f69 --- /dev/null +++ b/i3/conf/client/default/header @@ -0,0 +1,25 @@ +set $CLIENT_BUMBLEBEE -m disk nic sensors battery caffeine amixer brightness datetime -p battery.device=BAT0,BAT1 brightness.device_path=/sys/class/backlight/acpi_video0 disk.format={left} nic.states=^down sensors.path=/sys/class/thermal/thermal_zone2/temp -t greyish-powerline + + +# {{{ VARIABLES }}} + + set $mod Mod4 + set $TERMINAL urxvt + + # gaps + set $gap_outer 25 + set $gap_inner 15 + + set $ws1 "1 " + # Terminal + set $ws2 "2 " + # Work + set $ws3 "3 " + set $ws4 "4" + # Mail + set $ws5 "5 " + set $ws6 "6" + set $ws7 "7" + set $ws8 "8" + set $ws9 "9" + set $ws10 "10" diff --git a/i3/conf/common/base b/i3/conf/common/base index 5647f8e..99404f6 100644 --- a/i3/conf/common/base +++ b/i3/conf/common/base @@ -10,32 +10,6 @@ # Please see https://i3wm.org/docs/userguide.html for a complete reference! -# {{{ VARIABLES }}} - - set $mod Mod4 - set $TERMINAL urxvt - - # gaps - set $gap_outer 25 - set $gap_inner 15 - - # Define names for default workspaces for which we configure key bindings later on. - # We use variables to avoid repeating the names in multiple places. - # Browser - set $ws1 "1 " - # Terminal - set $ws2 "2 " - # Work - set $ws3 "3 " - set $ws4 "4" - # Mail - set $ws5 "5 " - set $ws6 "6" - set $ws7 "7" - set $ws8 "8" - set $ws9 "9" - set $ws10 "10" - # {{{ FONT }}} font pango:Hack 8 @@ -145,10 +119,10 @@ floating_modifier $mod bindsym XF86AudioRaiseVolume exec --no-startup-id amixer set Master 2%+ bindsym XF86AudioLowerVolume exec --no-startup-id amixer set Master 2%- bindsym XF86AudioMute exec --no-startup-id amixer set Master toggle - bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause - bindsym XF86AudioNext exec --no-startup-id playerctl next - bindsym XF86AudioPrev exec --no-startup-id playerctl previous - bindsym XF86AudioStop exec --no-startup-id playerctl stop + bindsym XF86AudioPlay exec --no-startup-id mpc toggle + bindsym XF86AudioNext exec --no-startup-id mpc next + bindsym XF86AudioPrev exec --no-startup-id mpc prev + bindsym XF86AudioStop exec --no-startup-id mpc stop # Screensaver || ThinkVantage bindsym XF86ScreenSaver exec xscreensaver-command -lock @@ -215,28 +189,3 @@ bar { default_border none default_floating_border normal - -# {{{ WORKSPACES }}} - - # Browser - workspace $ws1 gaps outer 0 - workspace $ws1 gaps inner 0 - assign [class="Firefox"] $ws1 - - # Terminal - assign [class="URxvt"] $ws2 - - # Mail - workspace $ws5 gaps outer 0 - workspace $ws5 gaps inner 0 - assign [class="Thunderbird"] $ws5 - # KeepassXC - assign [class="keepassxc"] $ws10 - - - -# {{{ KEYBOARD MAP }}} - exec_always setxkbmap de - -# {{{ AUTOSTART }}} -exec ~/.config/autorun.sh diff --git a/i3/conf/common/footer b/i3/conf/common/footer new file mode 100644 index 0000000..f8b3c4e --- /dev/null +++ b/i3/conf/common/footer @@ -0,0 +1,5 @@ +# {{{ KEYBOARD MAP }}} + exec_always setxkbmap de + +# {{{ AUTOSTART }}} +exec ~/.config/autorun.sh diff --git a/i3/scripts/dmenu/database.sqlite b/i3/scripts/dmenu/database.sqlite index e9a5a0e4d3b906dce92801b2221f391e726e86fc..c761121870536bde7e14e2365e98f54911873241 100644 GIT binary patch delta 34 qcmZoTz}j$tb%Hcw)I=F)#;A=6dy5&BCSP2yJo#M-|K@;_4X**^!w!r9 delta 34 qcmZoTz}j$tb%Hcw=tLQ3#?Xxkdy5%mCtqBzJo#M-|K@;_4X**@oDO{e diff --git a/tmux/plugins/tmux-copycat b/tmux/plugins/tmux-copycat index 6f9b9cd..bcb40ac 160000 --- a/tmux/plugins/tmux-copycat +++ b/tmux/plugins/tmux-copycat @@ -1 +1 @@ -Subproject commit 6f9b9cd2d93872cef60e3ea7f7ae89598569ed25 +Subproject commit bcb40aca696a8f80d67e1c97455afe3e2eb76dee diff --git a/tmux/plugins/tmux-prefix-highlight b/tmux/plugins/tmux-prefix-highlight index 34f7125..70d880b 160000 --- a/tmux/plugins/tmux-prefix-highlight +++ b/tmux/plugins/tmux-prefix-highlight @@ -1 +1 @@ -Subproject commit 34f7125ae46e5123bedad03e08027332d1186186 +Subproject commit 70d880b492b2f61e5304d3cce9bd1432c89cc8f9