From 19120d4f9761c67d99ed1ce3da6084b83f5a49c9 Mon Sep 17 00:00:00 2001 From: srdusr Date: Sat, 30 Aug 2025 19:22:59 +0200 Subject: Linux-specific dotfiles --- linux/home/.config/sxhkd/sxhkdrc | 490 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 490 insertions(+) create mode 100755 linux/home/.config/sxhkd/sxhkdrc (limited to 'linux/home/.config/sxhkd/sxhkdrc') diff --git a/linux/home/.config/sxhkd/sxhkdrc b/linux/home/.config/sxhkd/sxhkdrc new file mode 100755 index 0000000..1b276c7 --- /dev/null +++ b/linux/home/.config/sxhkd/sxhkdrc @@ -0,0 +1,490 @@ +################################################# +# ███████╗██╗ ██╗██╗ ██╗██╗ ██╗██████╗ # +# ██╔════╝╚██╗██╔╝██║ ██║██║ ██╔╝██╔══██╗ # +# ███████╗ ╚███╔╝ ███████║█████╔╝ ██║ ██║ # +# ╚════██║ ██╔██╗ ██╔══██║██╔═██╗ ██║ ██║ # +# ███████║██╔╝ ██╗██║ ██║██║ ██╗██████╔╝ # +# ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ # +################################################# + +#--------------------------------------------------------------- +# +# WM independent hotkeys +# + +# Help +super + slash + ~/.config/sxhkd/show_help.sh -m -3 + +# Application menu +super + a + ~/.config/polybar/scripts/menu.sh + +# Shutdown menu +#super + alt + Delete +# ~/.config/polybar/scripts/sysmenu.sh + +# lockscreen +super + Escape + betterlockscreen -l + +# Program launcher +super + @space + rofi -show drun + +# Run launcher (commands) +super + r + rofi -show run + +# Task switcher +alt + Tab + rofi -show window + +# Turn off compositor +super + shift + p + toggleprogram "picom" "--experimental-backends" + +#picom-trans -c -10 +#picom-trans -c +10 + +# Close all active notifications. +# ~button1 +# bspc query -D -d .focused.!occupied && $HOME/.local/bin/eww update noti=false; sleep 0.270; $HOME/.local/bin/eww close notification-popup; pkill openEwwPopup.sh + +# Toggle control center using middle click. +~button2 + xqp 0 $(xdo id -N Bspwm -n root) && sh $HOME/.config/jgmenu/scripts/windows.sh +#bspc query -D -d .focused.!occupied && sh $HOME/.config/eww/scripts/openControlCenter.sh + +# Right click menu +~button3 + xqp 0 $(xdo id -N Bspwm -n root) && sh $HOME/.config/jgmenu/scripts/jgmenu.sh + +# Toggle control center. +super + shift + c + sh $HOME/.config/eww/scripts/openControlCenter.sh + +# Toggle notification center. +super + shift + n + sh $HOME/.config/eww/scripts/openNotificationCenter.sh + +## Toggle info center. +#super + shift + i +# sh $HOME/.config/eww/scripts/openInfoCenter.sh +# +## Toggle color picker. +#super + shift + x +# sh $HOME/.local/bin/xcolor-pick +# +## Toggle bar. +#super + shift + b +# sh $HOME/.local/bin/tglbar +# +## Toggle exit screen. +#super + Escape +# sh $HOME/.config/eww/scripts/openExitScreen.sh +# +## Close exit screen when it's enabled. +#~Escape +# [[ -f "$HOME/.cache/eww-escreen.lock" ]] && sh $HOME/.config/eww/scripts/openExitScreen.sh + +## Open web browser, and file manager. +#super + shift + {w,f} +# {firefox-developer-edition,thunar} + +# Terminal emulator +#super + Return +# $TERMINAL + +# Browser +super + w + $BROWSER + +# Keyboard +super + o + onboard + +# Show clipmenu +#alt + x +# parcellite + #~/.scripts/clip.sh + +# Screenshots tool (selection) +ctrl + Print + screenshot crop + +# Screenshots tool (screen) +shift + Print + screenshot full + +# make sxhkd reload its configuration files: +super + ctrl + x + pkill -USR1 -x sxhkd; dunstify "Sxhkd configuration reloaded" + +# Kill window +ctrl + alt + Escape + xkill + +# Un/mount drives +ctrl + alt + {m,u} + {_,u}mnt + + +#--------------------------------------------------------------- +# +# bspwm hotkeys +# + +# Quit/restart bspwm +super + alt + shift + {q,r} + bspc {quit,wm -r} + +# Close and kill +super + d + bspc node -c + +# Alternate between the tiled and monocle layout +super + m + bspc desktop -l next +super + z + bspc desktop -l next + +# Send the newest marked node to the newest preselected node +super + y + bspc node newest.marked.local -n newest.!automatic.local + +# Swap the current node and the biggest window +super + g + bspc node -s biggest.window + + +#--------------------------------------------------------------- +# +# state/flags +# + +# Set the window state +#super + {t,shift + t,s,f} +# bspc node -t {tiled,pseudo_tiled,floating,fullscreen} + +# Floating into monocle layout +super + shift + m + bspc node -t pseudo_tiled; bspc node -t floating && wtp 10 36 $(($(bspc query -T -m | jq '.rectangle.width') * 98 / 100)) $(($(($(bspc query -T -m | jq '.rectangle.height') - $(bspc config top_padding))) * 96 / 100)) "$(pfw)" + +# Floating window pane left +super + shift + h + bspc node -t pseudo_tiled; bspc node -t floating && wtp 10 36 $(($(($(bspc query -T -m | jq '.rectangle.width') / 2)) - 5)) $(($(($(bspc query -T -m | jq '.rectangle.height') - $(bspc config top_padding))) * 96 / 100)) "$(pfw)" + +# Floating window pane right +super + shift + l + bspc node -t pseudo_tiled && bspc node -t floating && wtp $(($(bspc query -T -m | jq '.rectangle.width') - $(($(bspc query -T -m | jq '.rectangle.width') / 2)))) 36 $(($(($(bspc query -T -m | jq '.rectangle.width') / 2)) - 15)) $(($(($(bspc query -T -m | jq '.rectangle.height') - $(bspc config top_padding))) * 96 / 100)) "$(pfw)" + +# Set the window state +super + {t,shift + t,s} + bspc node -t {tiled,pseudo_tiled,floating}; \ + xdo raise -N Plank; \ + xdo raise -N '*:*:Picture in picture'; \ + xdo raise -N "Picture-in-Picture" + +# Toggle fullscreen +super + {f} + bspc node -t \~fullscreen + +# Toggle sticky +#super + q +# bspc node -g sticky=on + +# Set the node flags +super + ctrl + {m,x,y,z} + bspc node -g {marked,locked,sticky,private} + +# Move layers of windows above/below each other (script) +super + {equal,minus} + layer.sh {+,-} + + +#--------------------------------------------------------------- +# +# Focus/Swap +# + +# Focus the node in the given direction +super + {_,shift + }{h,j,k,l} + bspc node -{f,s} {west,south,north,east} + +# Focus the node for the given path jump +#super + {p,b,comma,period} +# bspc node -f @{parent,brother,first,second} + +# Focus the next/previous window in the current desktop +super + {_,shift + }c + bspc node -f {next,prev}.local.!hidden.window + +# Focus the next/previous desktop in the current monitor +super + bracket{left,right} + bspc desktop -f {prev,next}.local + +# Focus the last node/desktop +super + {grave,Tab} + bspc {node,desktop} -f last + +# Focus the older or newer node in the focus history +#super + {o,i} +# bspc wm -h off; \ +# bspc node {older,newer} -f; \ +# bspc wm -h on + +# Focus or send to the given desktop +super + {_,shift + }{1-9,0} + bspc {desktop -f,node -d} '^{1-9,10}' + +# Hide window +super + comma + bspc node -g hidden + +# Unhide window (script) +super + period + ${HOME}/.config/bspwm/scripts/hide-window unhide + +# Toggle the hidden state of the focused node +super + q + ~/.scripts/bspwm-toggle-visibility.sh + +#--------------------------------------------------------------- +# +# Preselect +# + +# Preselect the direction +super + ctrl + {h,j,k,l} + bspc node -p {west,south,north,east} + +# Preselect the ratio +super + ctrl + {1-9} + bspc node -o 0.{1-9} + +# Cancel the preselection for the focused node +super + ctrl + space + bspc node -p cancel + +# Cancel the preselection for the focused desktop +super + ctrl + shift + space + bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel + +# Close all receptacle +super + shift + i + for win in `bspc query -N -n .leaf.\!window`; do bspc node $win -k ; done; + +# Insert receptacle +super + i; {h,j,k,l} + bspc node --presel-dir {west,south,north,east} -i + +# Move to rectacle +super + ctrl + i + bspreceptacle + +# Balance nodes +super + alt + i + bspc node @/ -B + + + +#--------------------------------------------------------------- +# +# Move/resize +# + +## Drag tiling window to floating +alt + button1 + bspdragtofloat +alt + @button1 + bspdragtofloat stop +@button1 + bspdragtofloat stop +~button1 + : + +# Move a floating window or swap with any other adjacent tiled/pseudo_tiled window +ctrl + alt + {h,j,k,l} + { dir=west dx=-20 dy=0 \ + , dir=south dx=0 dy=20 \ + , dir=north dx=0 dy=-20 \ + , dir=east dx=20 dy=0 \ + }; \ + bspc node --move "$dx" "$dy" || bspc node --swap $dir + +# Rotate windows to different nodes +super + ctrl + r + bspc node @parent -R 90 + +# Resize tiled/floating windows (script) +shift + alt + {h,j,k,l} + bspwm_resize.sh {west,south,north,east} +#shift + alt + {h,j,k,l} +# {bspc node @parent/second -z left -20 0; \ +# bspc node @parent/first -z right -20 0, \ +# bspc node @parent/second -z top 0 +20; \ +# bspc node @parent/first -z bottom 0 +20, \ +# bspc node @parent/first -z bottom 0 -20; \ +# bspc node @parent/second -z top 0 -20, \ +# bspc node @parent/first -z right +20 0; \ +# bspc node @parent/second -z left +20 0} + +# Resize window into predefined pseudo_tiled window +super + shift + s + bspc node -t pseudo_tiled; bspc node -t floating && wtp 396 185 570 394 "$(pfw)" + +# Spawn next window/program into predefined floating window +super + ctrl + s + bspc rule -a '*' -o state=floating rectangle=720x480+320+200 + +# Spawn next window/program into another desktop +super + alt + {1-9,0} + bspc rule -a '*' -o desktop=^{1-9,10} + +# Focused desktop window gaps scroll +shift + alt + {1,2} + bspc config -d focused window_gap $((`bspc config -d focused window_gap` {-,+} 5 )) + +# Global window gaps scroll +ctrl + alt + {1,2} + bspc config window_gap $(( $(bspc config window_gap) {-,+} 5 )) + +#--------------------------------------------------------------- +# +# Multimedia +# +# Multimedia control +{XF86AudioStop,XF86AudioPlay,XF86AudioPrev,XF86AudioNext} + playerctl {stop,play-pause,previous,next} + +# Use arrow keys as multimedia keys +alt + shift + {Left,Up,Right} + playerctl {previous,play-pause,next} + +# Brightness control +XF86MonBrightness{Up,Down} + brightnessctl s 5%{+,-} + +# Use arrow keys as brightness keys +alt + {Right,Left} + brightnessctl s 5%{+,-} + +# Volume control +XF86Audio{Raise,Lower}Volume + pulsemixer --change-volume {+,-}5 + +# Use arrow keys as volume keys +alt + {Up,Down} + pulsemixer --change-volume {+,-}5 + + +#--------------------------------------------------------------- +# +# Xdotool keys +# + +# Move mouse cursor north, west, south, east +alt + {w,a,s,d} + xdotool mousemove_relative --sync {-- 0 -24, -- -24 0, 0 24, 24 0} + +# Move mouse cursor diagonally north-west, north-east, south-west, south-east +shift + alt + {q,e,a,d} + xdotool mousemove_relative --sync {-- -24 -24, -- 24 -24, -- -24 24,-- 24 24} + +# Emulate left mouse click +alt + i + xdotool click --clearmodifiers 1 + +# Emulate left mouse click select +alt + shift + i + xdotool mousedown 1 sleep 0.5 mousemove_relative --sync {-- -8 0, 0 8, -- 0 -8, 8 0} sleep 0.5 mouseup 1 + +# Emulate mouse right click +alt + o + xdotool click --clearmodifiers 3 + +# Emulate mouse scroll up +alt + n + xdotool click --clearmodifiers 4 + +# Emulate mouse scroll down +alt + m + xdotool click --clearmodifiers 5 + +# Emulate mouse scroll button +alt + p + xdotool click --clearmodifiers 2 + +# Emulate home key +alt + ctrl + Left + xdotool keyup Left key --clearmodifiers Home + +# Emulate end key +alt + ctrl + Right + xdotool keyup Right key --clearmodifiers End + +# Emulate delete key +~alt + BackSpace + xte 'keyup Alt_L' 'key Delete' 'keydown Alt_L' + + +#--------------------------------------------------------------- +# +# Programs +# + +# Scratchpd +super + semicolon + ~/.scripts/scratchpad + +super + x + ~/.scripts/scratchpad + +# Heads-Up-Display scratchpad terminal +super + e + ~/.scripts/heads-up-display + +## File manager nnn +#super + shift + n +# $TERMINAL -e nnn + +# File manager pcmanfm (GUI) +super + shift + f + pcmanfm + +# Bitwarden-rofi +super + shift + b + rofi-rbw + +# Thunderbird mail +#super + shift + m +# thunderbird + +# VirtualBox gui +super + v + /usr/bin/VirtualBox -- :0 vt1 + +# Discord +super + shift + d + discord + +# Spotify +super + shift + y + spotify + +# Book reader (zathura) +super + shift + z + zathura + +# Dictionary +super + ctrl + w + goldendict + +# Thesaurus +super + shift + w + artha + +# Suspend +alt + F4 + systemctl suspend && betterlockscreen --lock dimblur -- cgit v1.2.3