Refactor xst; bring back scratch term; add emacs scratch frame

This commit is contained in:
Henrik Lissner 2019-12-03 20:33:31 -05:00
parent 712c886b09
commit 85c78ca316
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 24 additions and 4 deletions

View file

@ -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

View file

@ -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
'')
];
};