Switch to bspwm

This commit is contained in:
David Holland 2020-03-04 03:51:39 +01:00
parent 60a9a548ae
commit e31da14de5
Signed by: DustVoice
GPG key ID: 47068995A14EDCA9
11 changed files with 584 additions and 128 deletions

3
.config/.gitignore vendored
View file

@ -4,9 +4,12 @@
!/.compton.conf/
!/alacritty/
!/bspwm/
!/dmenu/
!/fish/
!/i3/
!/i3status/
!/nitrogen/
!/nvim/
!/polybar/
!/sxhkd/

52
.config/bspwm/bspwmrc Executable file
View file

@ -0,0 +1,52 @@
#!/bin/sh
sxhkd &
nitrogen --restore &
/usr/lib/xfce-polkit/xfce-polkit &
xss-lock -- i3lock -n -e -c 333333
i=1
for monitor in $(bspc query -M); do
bspc monitor $monitor -d 1
let i++
done
NMON=$i
unset i
bspc config border_width 2
bspc config window_gap 0
bspc config top_padding 20
bspc config bottom_padding 0
bspc config left_padding 0
bspc config right_padding 0
bspc config single_monocle false
bspc config click_to_focus true
bspc config split_ratio 0.50
bspc config borderless_monocle true
bspc config gapless_monocle true
bspc config focus_by_distance true
bspc config focus_follows_pointer true
bspc config history_aware_focus true
bspc config remove_disabled_monitors true
bspc config merge_overlapping_monitors true
bspc config pointer_modifier mod1
bspc config pointer_action1 move
bspc config pointer_action2 resize_side
bspc config pointer_action3 resize_corner
bspc config normal_border_color "#4c566a"
bspc config active_border_color "#1e1e1e"
bspc config focused_border_color "#5e81cc"
bspc config presel_feedback_color "#5e81ac"
bspc config urgent_border_color "#dd2727"
#polybar hidden when fullscreen for vlc, youtube, mpv ...
#find out the name of your monitor with xrandr
xdo below -t $(xdo id -n root) $(xdo id -a polybar-main_DisplayPort-0)
xdo below -t $(xdo id -n root) $(xdo id -a polybar-main_DisplayPort-1)
xdo below -t $(xdo id -n root) $(xdo id -a polybar-main_HDMI-A-0)
bspc rule -a Screenkey manage=off
$HOME/.config/polybar/launch.sh

View file

@ -0,0 +1,40 @@
#!/bin/sh
dmenu_string="Wrong parameter"
case $1 in
"goto")
dmenu_string="Switch to desktop: " ;;
"move")
dmenu_string="Move node to desktop: " ;;
"movefollow")
dmenu_string="Move and follow node to desktop: " ;;
esac
desktop=$(bspc query -m focused -D --names | dmenu -p "$dmenu_string")
found=false
desktop_list=$(bspc query -m focused -D --names | tr '\n' ' ')
if [[ $desktop != "" ]];
then
for name in $desktop_list; do
if [[ $name == $desktop ]]; then
found=true
fi
done
fi
if [ ! $found = true ]; then
bspc monitor -d $desktop_list $desktop
fi
case $1 in
"goto")
bspc desktop -f $desktop ;;
"move")
bspc node -d $desktop ;;
"movefollow")
bspc node -d $desktop --follow ;;
esac

View file

@ -0,0 +1,35 @@
#!/bin/sh
dmenu_string="Wrong parameter"
case $1 in
"goto")
dmenu_string="Switch to monitor: " ;;
"swap")
dmenu_string="Swap monitor with monitor: " ;;
"movenode")
dmenu_string="Move node to monitor: " ;;
"movenodefollow")
dmenu_string="Move and follow node to monitor: " ;;
"movedesktop")
dmenu_string="Move desktop to monitor: " ;;
"movedesktopfollow")
dmenu_string="Move and follow desktop to monitor: " ;;
esac
monitor=$(bspc query -M --names | dmenu -p "$dmenu_string")
case $1 in
"goto")
bspc monitor -f $monitor ;;
"swap")
bspc monitor -s $monitor ;;
"movenode")
bspc node -m $monitor ;;
"movenodefollow")
bspc node -m $monitor --follow ;;
"movedesktop")
bspc desktop -m $monitor ;;
"movedesktopfollow")
bspc desktop -m $monitor --follow ;;
esac

View file

@ -0,0 +1,34 @@
#!/bin/sh
dmenu_string="Wrong parameter"
case $1 in
"rename")
dmenu_string="Rename desktop to: " ;;
"swap")
dmenu_string="Swap desktop with desktop: " ;;
"swapfollow")
dmenu_string="Swap and follow desktop with desktop: " ;;
esac
desktop=$(bspc query -m focused -D --names | dmenu -p "$dmenu_string")
case $1 in
"rename")
if [[ $desktop != "" ]];
then
bspc desktop -n $desktop
else
response=$(echo "" | dmenu -p 'Really remove this desktop? (n = abort): ')
if [[ $response != "n" ]];
then
bspc desktop -r
fi
fi
;;
"swap")
bspc desktop -s $desktop ;;
"swapfollow")
bspc desktop -s $desktop --follow ;;
esac

View file

@ -1,157 +1,291 @@
[bar/i3wmthemer_bar]
width = 100%
height = 27
radius = 0
[colors]
background = #000000
background-alt = #000000
foreground = #cccccc
foreground-alt = #cccccc
primary = #526274
secondary = #57553a
alert = #a17c38
active = {active}
inactive = {inactive}
highlight = #57553a
error = #a64848
bspwmborder = #57553a
pulse = #41434f
xkb = #844d2c
memory = #57553a
eth = #a17c38
pc = #41434f
xwindow = #a17c38
mus = #57553a
[bar/top]
monitor = ${env:MONITOR:}
font-0 = Hack:pixelsize=10;2
monitor-strict = false
override-redirect = false
bottom = false
fixed-center = false
width = 100%
height = 20
offset-x = 0%
offset-y = 0%
background = #1f1f1f
foreground = #c6c6c6
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3
line-color =
radius = 3
line-size = 2
line-color = #000000
border-size = 0
border-color =
border-color = #000000
padding-left = 0
padding-right = 2
padding-right = 0
module-margin-left = 1
module-margin-right = 2
module-margin-left = 0
module-margin-right = 0
font-0 = "Source Code Pro Semibold:size=10;1"
font-1 = "Font Awesome 5 Free:style=Solid:size=10;1"
font-2 = "Font Awesome 5 Brands:size=10;1"
modules-left = bspwm sep
modules-left = wlan eth
modules-center = i3
modules-right = date powermenu
;modules-center = xwindow
tray-position =
;tray-padding =
modules-right = date sep xkeyboard sep cpu space temperature sep memory sep filesystem sep pulseaudio sep
tray-position = right
tray-padding = 0
tray-maxsize = 14
tray-background = #000000
wm-restack = bspwm
;override-redirect = true
scroll-up = bspwm-desknext
scroll-down = bspwm-deskprev
cursor-click = pointer
cursor-scroll = ns-resize
[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false
label-mode-padding = 2
label-mode-foreground = #828282
label-mode-background = #1f1f1f
label-focused = %index%
label-focused-background = #8abeb7
label-focused-foreground = #1f1f1f
label-focused-padding = 2
label-unfocused = %index%
label-unfocused-background = #8abeb7
label-unfocused-foreground = #1f1f1f
label-unfocused-padding = 2
label-visible = %index%
label-visible-background = #8abeb7
label-visible-foreground = #1f1f1f
label-visible-padding = 2
label-urgent = %index%
label-urgent-background = #BA2922
label-urgent-padding = 2
[module/wlan]
type = internal/network
interface = net1
interval = 3.0
format-connected = <ramp-signal> <label-connected>
format-connected-foreground = #1f1f1f
format-connected-background = #8abeb7
format-connected-padding = 2
label-connected = %essid%
format-disconnected =
ramp-signal-0 = 
ramp-signal-1 = 
ramp-signal-2 = 
ramp-signal-3 = 
ramp-signal-4 = 
ramp-signal-foreground = #1f1f1f
[module/eth]
type = internal/network
interface = enp0s3
interval = 3.0
format-connected-padding = 2
format-connected-foreground = #1f1f1f
format-connected-background = #8abeb7
format-connected-prefix = " "
format-connected-prefix-foreground = #1f1f1f
label-connected = %local_ip%
format-disconnected =
[module/date]
type = internal/date
interval = 5
interval = 1
date =
date-alt = " %Y-%m-%d"
format = <label>
format-foreground = ${colors.foreground}
format-background = ${colors.background}
time = %H:%M
time-alt = %H:%M:%S
label = "%date% %time%"
label-padding = 1
label-foreground = ${colors.foreground}
format-prefix = 
format-foreground = #1f1f1f
format-background = #8abeb7
format-padding = 2
date = %F
label = %date% %time%
time = %H:%M:%S %p
[module/filesystem]
type = internal/fs
mount-0 = /
interval = 10
fixed-values = true
spacing = 1
format-mounted = <label-mounted>
format-foreground = ${colors.foreground}
format-background = ${colors.background}
label-mounted = "DISK %used% / %total%"
label-mounted-padding = 1
label-mounted-foreground = ${colors.foreground}
label-mounted-background = ${colors.background}
[module/xwindow]
type=internal/xwindow
format=<label>
label="%title%"
label-foreground=${colors.foreground}
label-padding = 1
label-maxlen = 50
[module/pulseaudio]
type = internal/pulseaudio
format-volume = <label-volume>
label-volume = "VOL: %percentage%%"
label-volume-padding = 1
label-volume-foreground = ${colors.foreground}
label-muted = "muted"
label-muted-padding = 1
label-muted-foreground = #333333
[module/xkeyboard]
type = internal/xkeyboard
format=<label-layout><label-indicator>
label-layout = "%name%"
label-layout-padding = 1
label-indicator-on = %name%
label-indicator-on-padding-right = 1
label-indicator-on-foreground = #333333
[module/battery]
type = internal/battery
battery = BAT0
adapter = ADP1
full-at = 100
format-charging = <label-charging>
format-discharging = <label-discharging>
label-charging = CHR %percentage%%
label-discharging = BAT %percentage%%
[module/sep]
type = custom/text
content = "|"
[module/space]
type = custom/text
content = " "
[module/bspwm]
type = internal/bspwm
pin-workspaces = true
label-focused = %name%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 1
label-occupied = %name%
label-occupied-padding = 1
label-urgent = %name%
label-urgent-background = ${colors.alert}
label-urgent-padding = 1
label-empty = %name%
label-empty-foreground = #333333
label-empty-padding = 1
; label-separator = |
[module/cpu]
type = internal/cpu
label = CPU %percentage%%
label-padding-left = 1
[module/memory]
type = internal/memory
format = <label>
label = RAM %gb_used% / %gb_total% | SWAP %gb_swap_used% / %gb_swap_total%
label-padding = 1
[module/temperature]
type = internal/temperature
format = <label>
format-warn = <label-warn>
label = %temperature-c%
label-padding-right = 1
label-warn = ! %temperature-c%
label-warn-padding-right = 1
label-warn-foreground = ${colors.alert}
[module/powermenu]
type = custom/menu
expand-right = true
format-spacing = 1
label-open = 
label-open-foreground = #8abeb7
label-close =  cancel
label-close-foreground = #8abeb7
label-separator = |
label-separator-foreground = #8abeb7
label-open ="[I/O]"
label-open-padding = 1
label-open-font = 0
label-open-background = ${colors.background}
label-open-foreground = ${colors.secondary}
label-close = "[ X ]"
label-close-padding-left = 1
label-close-font = 0
label-close-background = ${colors.background}
label-close-foreground = ${colors.secondary}
label-separator = "|"
label-separator-foreground = ${colors.foreground-alt}
menu-0-0 = reboot
menu-0-0 = Reboot
menu-0-0-font = 0
menu-0-0-exec = menu-open-1
menu-0-1 = power off
menu-0-1 = Power Off
menu-0-1-font = 0
menu-0-1-exec = menu-open-2
menu-0-2 = log off
menu-0-2 = Hibernate
menu-0-2-font = 0
menu-0-2-exec = menu-open-3
menu-0-3 = Suspend
menu-0-3-font = 0
menu-0-3-exec = menu-open-4
menu-0-4 = Lock
menu-0-4-font = 0
menu-0-4-exec = menu-open-5
menu-0-5 = Logout
menu-0-5-font = 0
menu-0-5-exec = menu-open-6
menu-1-0 = cancel
menu-1-0-exec = menu-open-0
menu-1-1 = reboot
menu-1-1-exec = reboot
menu-1-0 = Reboot
menu-1-0-font = 0
menu-1-0-exec = systemctl reboot
menu-1-1 = Cancel
menu-1-1-font = 0
menu-1-1-exec = menu-open-0
menu-2-0 = power off
menu-2-0-exec = poweroff
menu-2-1 = cancel
menu-2-0 = Power Off
menu-2-0-font = 0
menu-2-0-exec = systemctl poweroff
menu-2-1 = Cancel
menu-2-1-font = 0
menu-2-1-exec = menu-open-0
menu-3-0 = log off
menu-3-0-exec = pkill -KILL -u $USER
menu-3-1 = cancel
menu-3-0 = Hibernate
menu-3-0-font = 0
menu-3-0-exec = systemctl hibernate
menu-3-1 = Cancel
menu-3-1-font = 0
menu-3-1-exec = menu-open-0
[settings]
screenchange-reload = true
menu-4-0 = Suspend
menu-4-0-font = 0
menu-4-0-exec = systemctl suspend
menu-4-1 = Cancel
menu-4-1-font = 0
menu-4-1-exec = menu-open-0
[global/wm]
margin-top = 0
margin-bottom = 0
menu-5-0 = Lock
menu-5-0-font = 0
menu-5-0-exec = loginctl lock-session
menu-5-1 = Cancel
menu-5-1-font = 0
menu-5-1-exec = menu-open-0
menu-6-0 = Logout
menu-6-0-font = 0
menu-6-0-exec = kill -9 -1
menu-6-1 = Cancel
menu-6-1-font = 0
menu-6-1-exec = menu-open-0

View file

@ -1 +0,0 @@
/home/dustvoice/Projects/dotfiles/.config/i3

View file

@ -1,7 +0,0 @@
#!/bin/env sh
pkill polybar
sleep 1;
polybar i3wmthemer_bar &

13
.config/polybar/launch.sh Executable file
View file

@ -0,0 +1,13 @@
#!/bin/sh
killall -q polybar
# Wait until the processes have been shut down
while pgrep -u $UID -x polybar > /dev/null; do sleep 1; done
for m in $(polybar --list-monitors | cut -d":" -f1);
do
MONITOR=$m polybar -r top &
done
# notify-send "Bars launched..."

View file

@ -1 +0,0 @@
/home/dustvoice/Projects/dotfiles/.config/nitrogen

154
.config/sxhkd/sxhkdrc Normal file
View file

@ -0,0 +1,154 @@
# WM INDEPENDENT KEYBINDINGS
# make sxhkd reload its configuration files:
alt + Escape
pkill -USR1 -x sxhkd
# BSPWM HOTKEYS
# quit/restart bspwm
alt + shift + {ctrl + q,e}
bspc {quit,wm -r}
# close and kill
alt + shift + c
bspc node -c
alt + ctrl + shift + c
bspc node -k
# alternate between the tiled and monocle layout
alt + m
bspc desktop -l next
# send the newest marked node to the newest preselected node
alt + y
bspc node newest.marked.local -n newest.!automatic.local
# swap the current node and the biggest node
alt + g
bspc node -s biggest
# STATE/FLAGS
# set the window state
alt + {t,shift + t,s,f}
bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
# set the node flags
alt + ctrl + {m,x,y,z}
bspc node -g {marked,locked,sticky,private}
# FOCUS/SWAP
# focus the node in the given direction
alt + {_,shift + }{h,j,k,l}
bspc node -{f,s} {west,south,north,east}
# focus the node for the given path jump
alt + {p,b,comma,period}
bspc node -f @{parent,brother,first,second}
# focus the next/previous node in the current desktop
alt + {_,shift + }n
bspc node -f {next,prev}.local
# focus the next/previous desktop in the current monitor
alt + bracket{left,right}
bspc desktop -f {prev,next}.local
# focus the last node/desktop
alt + {grave,Tab}
bspc {node,desktop} -f last
# focus the older or newer node in the focus history
alt + {o,i}
bspc wm -h off; \
bspc node {older,newer} -f; \
bspc wm -h on
# focus or send to the given desktop
alt + {_,shift + ,ctrl + shift + }{1-9,0}
bspc {desktop -f,node -d, node -f -d} focused:'^{1-9,10}'
# PRESELECT
# preselect the direction
alt + ctrl + {h,j,k,l}
bspc node -p {west,south,north,east}
# preselect the ratio
alt + ctrl + {1-9}
bspc node -o 0.{1-9}
# cancel the preselection for the focused node
alt + ctrl + space
bspc node -p cancel
# cancel the preselection for the focused desktop
alt + ctrl + shift + space
bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
# MOVE/RESIZE
# expand a window by moving one of its side outward
alt + r; alt + {h,j,k,l}
bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
# contract a window by moving one of its side inward
alt + shift + r ; alt + shift + {h,j,k,l}
bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
# move a floating window
alt + ctrl + {Left,Down,Up,Right}
bspc node -v {-20 0,0 20,0 -20,20 0}
alt + Return
alacritty
# DMENU SCRIPTS
# run program launcher
alt + d
dmenu_run
alt + x
$HOME/.config/dmenu/dmenu-bspwm-movement-desktop.sh goto
alt + shift + x
$HOME/.config/dmenu/dmenu-bspwm-movement-desktop.sh move
alt + ctrl + shift + x
$HOME/.config/dmenu/dmenu-bspwm-movement-desktop.sh movefollow
alt + z
$HOME/.config/dmenu/dmenu-bspwm-rename-desktop.sh rename
alt + shift + z
$HOME/.config/dmenu/dmenu-bspwm-rename-desktop.sh swap
alt + ctrl + shift + z
$HOME/.config/dmenu/dmenu-bspwm-rename-desktop.sh swapfollow
alt + a; g
$HOME/.config/dmenu/dmenu-bspwm-movement-monitor.sh goto
alt + a; s
$HOME/.config/dmenu/dmenu-bspwm-movement-monitor.sh swap
alt + a; shift + n
$HOME/.config/dmenu/dmenu-bspwm-movement-monitor.sh movenode
alt + a; ctrl + shift + n
$HOME/.config/dmenu/dmenu-bspwm-movement-monitor.sh movenodefollow
alt + a; shift + d
$HOME/.config/dmenu/dmenu-bspwm-movement-monitor.sh movedesktop
alt + a; ctrl + shift + d
$HOME/.config/dmenu/dmenu-bspwm-movement-monitor.sh movedesktopfollow