diff --git a/config/sxhkd/sxhkdrc b/config/sxhkd/sxhkdrc index eddeaa46..e275dfaa 100644 --- a/config/sxhkd/sxhkdrc +++ b/config/sxhkd/sxhkdrc @@ -24,7 +24,10 @@ super + Return xst super + grave - emacsclient -a "" -e "(open-scratch-frame)" + st-scratch + +super + shift + grave + emacsclient -e '(open-scratch-frame)' super + space rofi -monitor -4 -show drun -show-icons diff --git a/modules/desktop/bspwm.nix b/modules/desktop/bspwm.nix index 4bf3e9eb..d28c4574 100644 --- a/modules/desktop/bspwm.nix +++ b/modules/desktop/bspwm.nix @@ -8,17 +8,34 @@ environment = { systemPackages = with pkgs; [ - xst # st + nice-to-have extensions - lightdm bspwm dunst libnotify - (polybar.override { pulseSupport = true; nlSupport = true; }) + + xst # st + nice-to-have extensions + (writeScriptBin "st-scratch" '' + #!${stdenv.shell} + SCRID=st-scratch + focused=$(xdotool getactivewindow) + scratch=$(xdotool search --onlyvisible --classname $SCRID) + if [[ -n $scratch ]]; then + if [[ $focused == $scratch ]]; then + xdotool windowkill $scratch + else + xdotool windowactivate $scratch + fi + else + xst -t $SCRID -n $SCRID -c $SCRID \ + -f "$(xrdb -query | grep 'st-scratch\.font' | cut -f2)" \ + -g 100x26 \ + -e $SHELL + fi + '') ]; };