1
1
Fork 0
nixos/options/custom/scripts/menu.sh
Myned 4242d5cdd5
menu: add ability to close menu with invocation
Signed-off-by: Myned <dev@bjork.tech>
2024-10-27 14:40:37 -05:00

60 lines
1.1 KiB
Bash

#! /usr/bin/env bash
# Menu wrapper
#?? menu
command=walker
while (("$#" > 0)); do
case "$1" in
--applications)
command="walker --modules applications"
;;
--calculator)
command="walker --modules calc"
;;
--clipboard)
command="walker --modules clipboard"
;;
--files)
command="walker --modules finder"
;;
--input)
command="walker --dmenu"
;;
--networks)
command="networkmanager_dmenu"
;;
--passwords)
command="rofi-rbw"
;;
--runner)
command="walker --modules runner"
;;
--search)
command="walker --modules websearch"
;;
--ssh)
command="walker --modules ssh"
;;
--unicode)
command="walker --modules emojis"
;;
--windows)
command="walker --modules windows"
;;
--)
shift
command+=" $*"
break
;;
esac
shift
done
# HACK: Restart service to close existing menu
if hyprctl -j layers | jq -e '.[][][][] | select(.namespace == "walker")'; then
systemctl --user restart walker.service
else
$command
fi