bar
This commit is contained in:
37
home-modules/bar/submap-indicator.nix
Normal file
37
home-modules/bar/submap-indicator.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{ pkgs, ... }: {
|
||||
home.packages = [
|
||||
(pkgs.writeShellApplication { name = "submap_indicator"; text = /*bash*/ ''
|
||||
print_help() {
|
||||
echo "Usage: submap_indicator {set <string>|unset}"
|
||||
}
|
||||
if [ $# -lt 1 ]; then
|
||||
print_help; exit 1;
|
||||
fi
|
||||
case "$1" in
|
||||
set)
|
||||
# Check if there is a second argument for the 'set' operation
|
||||
if [ $# -eq 2 ]; then
|
||||
echo "$2" > /tmp/submap-indictor
|
||||
pkill -RTMIN+8 waybar
|
||||
pkill -RTMIN+8 hyprpanel
|
||||
else
|
||||
echo "Error: 'set' operation requires exactly one string argument."
|
||||
print_help
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
unset)
|
||||
echo "" > /tmp/submap-indictor
|
||||
pkill -RTMIN+8 waybar
|
||||
pkill -RTMIN+8 hyprpanel
|
||||
;;
|
||||
*)
|
||||
echo "Error: Unknown command '$1'"
|
||||
print_help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
'';})
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user