You are not logged in.
Pages: 1
https://wiki.archlinux.org/title/Sxhkd
sxhkd is a simple X hotkey daemon, by the developer of bspwm, that reacts to input events by executing commands.
https://bbs.archlinux.org/viewtopic.php?id=155613
I had a few issues with xbindkeys which led me to write sxhkd:
It isn't KISS (Guile, -k, -mk, ...).
The commands of the configuration file have to be surrounded by double quotes and don't support environment variables.
There are two mechanisms for reloading the configuration file: none of them works.
Implicit modifier names ('alt', 'super', ...) are not supported.
Also:
https://github.com/baskerville/sxhkd
Once you get over that xbindkeys doesn't reload its config file as it claims - you have to restart it instead - I haven't had any issues with it. But sxhkd looks newer and has more features.
Is anyone using it now, and can speak for how wonderful it is? If not we can just continue with xbindkeys.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
I have used it for numerous years. I find it amazingly helpful & useful. It is also Desktop agnostic, allowing me to build common keybindings across multiple environments. Here's are old articles I wrote on the topic:
Pax vobiscum,
Mark Rabideau - https://many-roads.com https:/eirenicon.org
i3wm, dwm, hlwm on sid/ arch ~ Reg. Linux User #449130
"For every complex problem there is an answer that is clear, simple, and wrong." H. L. Mencken
Offline
^many thanks!
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
I've been using it for years with bspwm and, more recently, with dk window manager.
Works great, pretty straight forward setup. The example sxhkdrc from the bspwm git page works as an excellent template - https://github.com/baskerville/bspwm/bl … es/sxhkdrc
Note the reload command is in the example file.
The only bug (if it even qualifies as one) I've encountered is that it stays persistent in memory if you log out of an X-session and change window managers. That can cause problems if your switching from a window manager like bspwm to openbox where the keybind commands are radically different. I usually have restart or killall commands in the window managers' autostart file to get around that.
For example, in my bspwmrc I have:
# (re)load sxhkd for keybinds
if hash sxhkd >/dev/null 2>&1; then
pkill sxhkd
sxhkd -c $HOME/.config/bspwm/sxhkdrc &
fi
Solid program for keybinds. For a single window manager release, it will work great for starting applications like gimp etc ...
Last edited by PackRat (2023-04-24 13:41:55)
You must unlearn what you have learned.
-- yoda
Offline
@manyroads and @PackRat thanks for the feedback.
Are there some major advantages of sxhkd over xbindkeys that would justify switching the BL default?
Anyway, I'll try changing over on my own desktop and see how it goes.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
I don't know if there is a "major" advantage to using sxhkd instead of xbindkeys.
As I recall, the developer coded sxhkd because he needed a key grabber to work a certain way with bspwm (which he also develops).
So it's newer, maybe cleaner, code. I think it has a slightly smaller memory footprint.
You must unlearn what you have learned.
-- yoda
Offline
@johnraff I have really only used sxhkd for my keybinds (those I create for custom uses such as program launching, etc.).
Pax vobiscum,
Mark Rabideau - https://many-roads.com https:/eirenicon.org
i3wm, dwm, hlwm on sid/ arch ~ Reg. Linux User #449130
"For every complex problem there is an answer that is clear, simple, and wrong." H. L. Mencken
Offline
So it's newer, maybe cleaner, code. I think it has a slightly smaller memory footprint.
Looks like a slightly superior alternative. Anyway I'll install sxhkd and see how hard it is to configure (xbindkeys' file is fairly simple).
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
I've been using it for a few months now. Really easy to configure and use. I don't use keybinds enough to have any particular opinion regarding function except to say I've had zero issues for all the common install items.
Last edited by sleekmason (2023-04-26 02:35:05)
Offline
@johnraff Here is a copy of my common keybinds. Use whatever of it might be of use, freely. I'm certain they will thrill our audience.
#
# sxhkdrc ~ common functions
# i3wm/dwm/bspwm - and most other wms
#
#########################
# SUPER + FUNCTION KEYS #
#########################
# if you want to assign applications to specific tags or workspaces
# add a command behind the application to focus on that workspace if required
# index 0 corresponds to tag or HLWM workspace 1
# index 1 corresponds to tag or HLWM workspace 2
# example
# Firefox & herbstclient use_index 1
# this sxhkd script developed by ManyRoads https://eirenicon.org
# Open Terminal
super + Return
# st -g=100x34+100+300
# st -g=84X36+500+34
# urxvt
# xfce4-terminal
urxvt -geometry 100x34+100+300
# Drop-down Terminal
F12
# negative -w arg to account for a border width (default: 100%)
tdrop --y-offset=36 urxvt
# xfce4-terminal --drop-down
# ~/.local/share/scripts/urxvt-dropdown.sh
# dmenu
super + d
dmenu_run
# dmenu_run -c -l 20 -nb '#2E3440' -nf '#E5E9F0' -sb '#DFAF8F' -sf '#000000' -fn '-xos4-terminus-medium-r-*-*-14-*'
# dmenu_run -c -l 20 -nb '#2E3440' -sb '#88C0D0' -sf '#3B4252' -fn '-xos4-terminus-medium-r-*-*-14-*'
# jgmenu & j4-dmenu-desktop
alt + F1
jgmenu_run
super + F1
j4-dmenu-desktop --dmenu="rofi -modi drun,window,run -show drun -show-icons -sidebar-mode -location 0 -width 360"
# Show Keybinding Index
super + F2
zenity --text-info --width=640 --height=640 --html --filename=/home/mark/.local/share/help-files/app-keybindings.html --ok-label="Quit"
# system utilities
super + F3
~/.local/share/scripts/system-monitors.sh
# system maintenance links
super + F4
~/.local/share/scripts/system-links.sh
# old game links
super + F5
~/.local/share/scripts/old-games.sh
# Pavucontrol
#super + s
# pavucontrol
# System Quit Options
super + q
# ld-logout
~/.local/share/scripts/logout.sh
# ~/.local/bin/fblogout/fblogout
# Urxvt /st
super + s
# urxvt
st
#Lock screen
super + x
i3lock-fancy
# dm-tool lock
# Relaunch Polybar
super + shift + p
~/.config/polybar/launch.sh --forest &
# Kill Window
alt + F4
xdotool getwindowfocus windowkill
# Touchpad
F9
#touchpad-indicator
sh -c .local/share/scripts/touchpad-toggle.sh
# Gamma Toggle
alt + F9
sh -c .local/share/scripts/Day-Night-toggle.sh
# sh -c .local/share/scripts/nightlight.sh
# Screenshot
F10
#Print
xfce4-screenshooter
# Linux Links
super + F11
zenity --text-info --width=640 --height=640 --html --filename=/home/mark/.local/share/help-files/linux-links.html --ok-label="Quit"
# rofi Active Tasks
super + F12
rofi -modi window -show window -show-icons -sidebar-mode
# gsimplecal
alt + shift + c
gsimplecal
# calibre (reading)
alt + c
sh -c .local/share/scripts/dark-calibre-launch.sh
# day-night (toggle)
alt + d
sh -c .local/share/scripts/Day-Night-toggle.sh
# editor
alt + e
st -e micro
# mousepad
# st -g=84x24+100+300 -e vim & herbstclient use_index 3
# file manager1
alt + f
# thunar
sh -c .local/share/scripts/filemanager-launch.sh
# caja, nemo, thunar, nautilus
# file manager2
ctrl + alt + f
st -g=84x24+100+300 -e fff
# geany
super + g
sh -c .local/share/scripts/geany-launch.sh
# geany
# j4-desktop-menu
alt + j
j4-dmenu-desktop --dmenu='rofi -modi drun,window,run -show drun -show-icons -location 0 -width 480 '
# j4-dmenu-desktop --dmenu="dmenu -c -l 20 -nb '#2E3440' -sb '#88C0D0' -sf '#3B4252' -nf '#E5E9F0' -fn '-xos4-terminus-medium-r-*-*-14-*' -i"
# j4-dmenu-desktop --dmenu='rofi -modi drun,window,run -show drun -show-icons -sidebar-mode -location 0 -width 480 '
# Lock Screen
alt + l
i3lock-fancy
# eMail
alt + m
sh -c .local/share/scripts/thunderbird-launch.sh
# thunderbird
# TextMaker (Office)
alt + o
/usr/bin/textmaker21free
# PlanMaker
alt + p
/usr/bin/planmaker21free
# Presentation (slides)
#alt + s
# /usr/bin/presentations21free
# eMail
alt + t
telegram-desktop
# nitrogen wallpaper
alt + n
nitrogen
# package manager
alt + p
sh -c .local/share/scripts/synaptic.sh
# ranger- file manager
alt + r
st -e ranger
# uxterm -e ranger
# xfce4-terminal --geometry 100x30+100+300 -e ranger
# st -g=84x24+100+300 -e ranger & herbstclient use_index 2
# xfce4-terminal -e ranger & xfwm4 use_index 5
# skype
alt + s
sh -c .local/share/scripts/skype-launch.sh
# skypeforlinux
# Debian clean & update
alt + u
# xfce4-terminal -e ~/.local/share/scripts/clean-update.sh
st -e ~/.local/share/scripts/clean-update.sh
# Virtualbox
alt + v
sh -c .local/share/scripts/virtualbox-launch.sh
# virtualbox -style kvantum & herbstclient use_index 4
# web browser
alt + w
sh -c .local/share/scripts/browser-launch.sh
# chromium
# firefox
# chromium opera & herbstclient use_index 1
# zim wiki
alt + z
sh -c .local/share/scripts/zim-launch.sh
# zoom
super + z
sh -c .local/share/scripts/zoom-launch.sh
# Reboot
ctrl + alt + Delete
reboot
#Volume Control
XF86AudioLowerVolume
pamixer --decrease 5 && notify-send "Volume (Down)" -u low -t 5000
XF86AudioRaiseVolume
pamixer --increase 5 && notify-send "Volume (Up)" -u low -t 5000
XF86AudioMute
pamixer --toggle-mute && notify-send "Sound (Toggle)" -u low -t 5000
#Brightness control
#XF86MonBrightnessDown
F6
sudo brightnessctl s 10%- && notify-send -u normal -t 5000 "Backlight (Down)"
#XF86MonBrightnessUp
F7
sudo brightnessctl s 10%+ && notify-send -u normal -t 5000 "Backlight (Up)"
Pax vobiscum,
Mark Rabideau - https://many-roads.com https:/eirenicon.org
i3wm, dwm, hlwm on sid/ arch ~ Reg. Linux User #449130
"For every complex problem there is an answer that is clear, simple, and wrong." H. L. Mencken
Offline
^thanks!
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
Pages: 1