Add zmenu

This commit is contained in:
muon 2025-09-24 22:08:02 +00:00
parent cb7e26983e
commit 2036170ce3
6 changed files with 223 additions and 29 deletions

View file

@ -17,6 +17,23 @@
curl -H "authorization: $AUTH" https://share.muon.host/api/upload -F file=@/tmp/ss.png -H "Content-Type: multipart/form-data" -H "Format: date" -H "Image-Compression-Percent: 90" -H "No-JSON: true" | tr -d '\n' | xsel -ib;
'';
};
zmenu = with pkgs;
writeShellApplication {
name = "zmenu";
runtimeInputs = [zellij zoxide wmctrl i3 rofi alacritty zsh];
text = ''
ZPATH=$(zoxide query -l | sed -e "s|$HOME||g" | cut -b 2- | rofi -dmenu)
[[ -z "$ZPATH" ]] && exit
ZSESH=$(echo "$ZPATH" | tr / -)
ZWIND=$(wmctrl -l | grep "$ZSESH" || echo "")
cd "$ZPATH"
if [[ -z "$ZWIND" ]]; then
alacritty -T "$ZSESH" -e zsh -c "zellij -s $ZSESH -n compact || zellij a $ZSESH"
else
wmctrl -a "$ZSESH"
fi
'';
};
in
with lib; {
options.mods.i3.enable = mkEnableOption "enables i3";
@ -139,6 +156,7 @@ in
"XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume 0 +2%";
"XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume 0 -2%";
"Print" = "exec ${getExe fsss}";
"${modifier}+z" = "exec ${getExe zmenu}";
"${modifier}+y" = "sticky toggle";
});