From 25150ca19bbf689acdb3667b30de9678a676771f Mon Sep 17 00:00:00 2001 From: Riyyi Date: Wed, 29 May 2019 21:00:42 +0200 Subject: [PATCH] Add bspwm, stalonetray config, bspwm hotkeys --- .config/bspwm/bspwmrc | 52 +++++++++++++++ .config/i3/config | 2 +- .config/sxhkd/bspwm | 128 +++++++++++++++++++++++++++++++++++++ .config/sxhkd/i3 | 34 +++++----- .config/xorg/xinitrc | 3 + .scripts/panel/lemonbar.sh | 12 +++- .stalonetrayrc | 24 +++++++ packages | 3 + 8 files changed, 238 insertions(+), 20 deletions(-) create mode 100755 .config/bspwm/bspwmrc create mode 100644 .config/sxhkd/bspwm create mode 100644 .stalonetrayrc diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc new file mode 100755 index 0000000..d691085 --- /dev/null +++ b/.config/bspwm/bspwmrc @@ -0,0 +1,52 @@ +#! /bin/sh + +#--- General ---# + +# Basic definitions +bspc config border_width 4 +bspc config window_gap 20 +bspc config split_ratio 0.502 +bspc config top_padding "$PANEL_HEIGHT" + +# Program startup +"$HOME"/.scripts/wm/pidctl.sh -p & + +# Colors +bspc config focused_border_color "$FGCOLOR_INACTIVE" +bspc config normal_border_color "$BGCOLOR_INACTIVE" +bspc config active_border_color "$BGCOLOR_INACTIVE" +bspc config presel_feedback_color "$FGCOLOR_INACTIVE" + +# Node +bspc config borderless_monocle true +bspc config gapless_monocle true +bspc config initial_polarity second_child +bspc config single_monocle true + +# Pointer +bspc config focus_follows_pointer true +bspc config pointer_follows_monitor true +bspc config pointer_modifier mod4 + +#--- Desktops ---# + +# Set desktops +bspc monitor -d "$WS1" "$WS2" "$WS3" "$WS4" "$WS5" \ + "$WS6" "$WS7" "$WS8" "$WS9" "$WS0" + +# Open program on specific desktop +bspc rule -a Firefox desktop="^$WS1" +bspc rule -a Thunar desktop="^$WS4" +bspc rule -a krita desktop="^$WS5" follow=on + +# Set program properties +bspc rule -a Arandr state=floating +bspc rule -a Bar layer=above +bspc rule -a feh state=floating +bspc rule -a Firefox:Places state=floating +bspc rule -a Lxappearance state=floating +bspc rule -a mpv state=floating center=on +bspc rule -a Pavucontrol state=floating +bspc rule -a Qemu-system-i386 state=floating +bspc rule -a Qemu-system-x86_64 state=floating +bspc rule -a Zathura state=tiled diff --git a/.config/i3/config b/.config/i3/config index dad2bdc..5a483d9 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -13,7 +13,7 @@ set $mod2 Mod1 floating_modifier $mod # Application startup -exec_always --no-startup-id $HOME/.scripts/wm/pidctl.sh -p +exec_always --no-startup-id $HOME/.scripts/wm/pidctl.sh -p & # Colors set_from_resource $bgcolor WmColor.bgcolor #000000 diff --git a/.config/sxhkd/bspwm b/.config/sxhkd/bspwm new file mode 100644 index 0000000..501a52e --- /dev/null +++ b/.config/sxhkd/bspwm @@ -0,0 +1,128 @@ +# -*-conf-*- + + +##--- Control ---## + + +# Restart bspwm +super + shift + r + bspc wm -r + +# Logout +super + shift + e + prompt.sh "Logout and exit bspwm?" "bspc quit" + + +##--- Node ---## + + +# Close and kill focused node +super + {_,shift} + q + bspc node -{c,k} + +#-- State/flags --# + +# Toggle fullscreen mode +super + f + bspc node -t \~fullscreen + +# Toggle tiled/floating +super + space + bspc query -N -n focused.tiled && \ + bspc node -t floating || bspc node -t tiled -g sticky=off + +# Sticky floating node +super + shift + f + bspc node -t floating -g sticky=on; $HOME/.scripts/wm/hover.sh + +# Set node flags +super + ctrl + {s,p,semicolon} + bspc node -g {sticky,private,locked} + +#-- Focus --# + +# Focus node in direction +super + {_,shift} + {h,j,k,l} + bspc node -{f,s} {west,south,north,east}.local +super + {_,shift} + {Left,Down,Up,Right} + bspc node -{f,s} {west,south,north,east}.local + +# Focus the node for the given path jump +super + {p,b,comma,period} + bspc node -f @{parent,brother,first,second}.local + +# Focus previous/next node +super + {_,shift} + Tab + bspc node -f {next,prev}.local + +# Focus previous/next monitor +super + bracket{left,right} + bspc monitor -f {prev,next} + +#-- Move --# + +# Move node to previous/next/last desktop +super + shift + {minus,equal,grave} + bspc node -d {prev.local,next.local,last} + +# Move node to previous/next monitor +super + shift + bracket{left,right} + bspc node -m {prev,next} --follow + +# Swap focused and biggest node +super + g + bspc node -s biggest.local + +# Send focused node to the latest preselect node +super + y + bspc node -n newest.!automatic.local + +#-- Resize --# + +# Expand node by moving its side outward +super + alt + {h,j,k,l} + bspc node -z {left -30 0,bottom 0 30,top 0 -30,right 30 0} +super + alt + {Left,Down,Up,Right} + bspc node -z {left -30 0,bottom 0 30,top 0 -30,right 30 0} + +# Contract node by moving its side inward +super + alt + ctrl + {h,j,k,l} + bspc node -z {right -30 0,top 0 30,bottom 0 -30,left 30 0} +super + alt + ctrl + {Left,Down,Up,Right} + bspc node -z {right -30 0,top 0 30,bottom 0 -30,left 30 0} + +#-- Preselect node --# + +# Preselect direction +super + ctrl + {h,j,k,l} + bspc node -p {west,south,north,east} +super + ctrl + {Left,Down,Up,Right} + bspc node -p {west,south,north,east} + +# Preselect ratio +super + ctrl + {1-9} + bspc node -o 0.{1-9} + +# Cancel preselection in focused node +super + ctrl + space + bspc node -p cancel + + +##--- Desktop ---## + + +# Toggle tiled/monocle layout +super + z + bspc desktop -l next + +# Focus/send node to desktop +super + {_,shift} + {1-9,0} + bspc {desktop -f,node -d} '^{1-9,10}' + +# Focus the previous/next desktop on current monitor +super + {minus,equal} + bspc desktop -f {prev,next}.local + +# Focus last desktop +super + grave + bspc desktop -f last diff --git a/.config/sxhkd/i3 b/.config/sxhkd/i3 index 802bb28..a144389 100644 --- a/.config/sxhkd/i3 +++ b/.config/sxhkd/i3 @@ -1,19 +1,5 @@ # -*-conf-*- -#--- General ---# - -# Kill focused window -super + shift + q - i3-msg kill - -# Split container horizontal / vertical -super + {h,v} - i3-msg split {h,v} - -# Container layout -super + {s,w,e} - i3-msg layout {stacking,tabbed,toggle split} - #--- Control ---# # Reload i3 config @@ -26,6 +12,10 @@ super + shift + e #--- Window ---# +# Kill focused window +super + shift + q + i3-msg kill + # Fullscreen window super + f i3-msg fullscreen toggle @@ -52,13 +42,21 @@ super + shift + f #--- Workspace ---# +# Toggle container horizontal/vertical split +super + {h,v} + i3-msg split {h,v} + +# Container layout +super + {s,w,e} + i3-msg layout {stacking,tabbed,toggle split} + # Switch to workspace -super + {0-9} - i3-msg workspace $WS{0-9} +super + {1-9,0} + i3-msg workspace $WS{1-9,0} # Move focused container to workspace -super + shift + {0-9} - i3-msg move container to workspace $WS{0-9} +super + shift + {1-9,0} + i3-msg move container to workspace $WS{1-9,0} # Move workspace to monitor super + ctrl + {Left,Right} diff --git a/.config/xorg/xinitrc b/.config/xorg/xinitrc index 9209e37..3af139a 100644 --- a/.config/xorg/xinitrc +++ b/.config/xorg/xinitrc @@ -7,6 +7,9 @@ xrandr --newmode "3000x2000_48.00" 405.25 3000 3232 3552 4104 2000 2003 2013 205 xrandr --addmode eDP-1 3000x2000_48.00 xrandr --output eDP-1 --mode 3000x2000_48.00 --primary +# Set default X cursor to arrow +xsetroot -cursor_name left_ptr + # Disable screensaver xset s off xset -dpms diff --git a/.scripts/panel/lemonbar.sh b/.scripts/panel/lemonbar.sh index 25ceb5a..dd1ccb8 100755 --- a/.scripts/panel/lemonbar.sh +++ b/.scripts/panel/lemonbar.sh @@ -31,7 +31,7 @@ clock() { bar() { lemonbar \ - -a 20 -g x$PANEL_HEIGHT -n "$PANEL_NAME" \ + -a 20 -g x"$PANEL_HEIGHT" -n "$PANEL_NAME" \ -f "DejaVu Sans-8" -o 0 \ -f "FontAwesome5Free Solid-8" -o -3 \ -f "FontAwesome5Free Regular-8" -o -3 \ @@ -44,6 +44,8 @@ start() { while [ "$(pgrep -cx lemonbar.sh)" -gt 1 ]; do pkill -ox -9 lemonbar.sh; done + pkill xprop + pkill sleep # Trap all subshells trap 'trap - TERM; kill 0' INT TERM QUIT EXIT @@ -106,6 +108,14 @@ start() { printf "%s\n" "%{l}$workspaces%{c}$title%{r}$volume $brightness $wifi $iface $battery $clock " done < "$PANEL_PIPE" | bar | sh & + # Tray and panel on top of the root window, fixes fullscreen programs + if [ "$WM" = "bspwm" ];then + ROOT="$(xdo id -N Bspwm -n root | sort | head -n 1)" + PANEL_ID=$(xdo id -m -a "$PANEL_NAME") + TRAY_ID=$(xdo id -a "stalonetray") + xdo above -t "$ROOT" "$TRAY_ID" "$PANEL_ID" + fi + wait } diff --git a/.stalonetrayrc b/.stalonetrayrc new file mode 100644 index 0000000..f40c8af --- /dev/null +++ b/.stalonetrayrc @@ -0,0 +1,24 @@ +# -*-conf-*- + +#--- General ---# + +background "#2b2e39" + +#--- Dimensions ---# + +geometry 8x1-730+4 +grow_gravity NW + +icon_size 30 +icon_gravity NE + +max_geometry 0x38 + +#--- Properties (atoms) ---# + +skip_taskbar true +sticky true + +window_layer top +window_strut none +window_type dock diff --git a/packages b/packages index 030d27c..dd7edd8 100644 --- a/packages +++ b/packages @@ -6,6 +6,7 @@ arc-gtk-theme arc-icon-theme breeze-icons-git brightnessctl +bspwm capitaine-cursors checkbashisms chromium @@ -102,6 +103,7 @@ scrot signal-desktop-bin sloccount smartmontools +stalonetray sxhkd texlive-bibtexextra texlive-core @@ -141,6 +143,7 @@ xorg-xinit xorg-xinput xorg-xprop xorg-xrandr +xorg-xsetroot xss-lock-git youtube-dl zathura