Browse Source

Add bspwm, stalonetray config, bspwm hotkeys

master
Riyyi 5 years ago
parent
commit
25150ca19b
  1. 52
      .config/bspwm/bspwmrc
  2. 2
      .config/i3/config
  3. 128
      .config/sxhkd/bspwm
  4. 34
      .config/sxhkd/i3
  5. 3
      .config/xorg/xinitrc
  6. 12
      .scripts/panel/lemonbar.sh
  7. 24
      .stalonetrayrc
  8. 3
      packages

52
.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

2
.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

128
.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

34
.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}

3
.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

12
.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
}

24
.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

3
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

Loading…
Cancel
Save