cleaner bar

This commit is contained in:
Lennart J. Kurzweg (Nx2)
2025-08-24 14:55:59 +02:00
parent f222c3b595
commit eba7f91576

View File

@@ -5,39 +5,39 @@ in {
"nx2site/radicale/password" = { };
};
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
'';})
# (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
# '';})
(pkgs.writeShellApplication { name = "cclock"; text = /*bash*/ ''
ord=$(date +"%e" | awk '{printf("%d%s\n", $1, ($1==11||$1==12||$1==13)?"th":((($1%10)==1)?"st":((($1%10)==2)?"nd":((($1%10)==3)?"rd":"th"))))}')
if [ $# -eq 0 ]; then
@@ -168,167 +168,167 @@ if __name__ == "__main__":
'')
];
programs = {
waybar = {
enable = false;
package = pkgs.waybar;
settings = {
bar = {
# height = 20;
layer = "top";
position = "bottom";
margin-top = 0;
# margin-left = rice.gap-size;
# margin-bottom = rice.gap-size;
# margin-right = rice.gap-size;
margin-left = 0;
margin-bottom = 0;
margin-right = 0;
spacing = 10;
fixed-center = true;
modules-left = [
# "cpu"
# "memory"
"wireplumber"
"backlight"
"battery"
"network"
"hyprland/window"
];
modules-center = [
"hyprland/workspaces"
];
modules-right = [
"custom/mode"
"custom/caldav_event"
"custom/cclock"
"tray"
];
"hyprland/workspaces" = {
on-click = "activate";
format = "{name}";
all-outputs = false;
active-only = false;
};
"hyprland/window" = {
# format = "${sep}{}";
format = "{}";
separate-outputs = true;
};
"custom/cclock" = {
exec = "cclock";
restart-interval = 60;
};
"custom/caldav_event" = {
format = "󰃰${sep}{}";
exec = "caldav_event";
restart-interval = 60;
max-width = 60;
};
"custom/mode" = {
exec = "cat /tmp/submap-indictor";
interval = "once";
signal = 8;
};
# waybar = {
# enable = false;
# package = pkgs.waybar;
# settings = {
# bar = {
# # height = 20;
# layer = "top";
# position = "bottom";
# margin-top = 0;
# # margin-left = rice.gap-size;
# # margin-bottom = rice.gap-size;
# # margin-right = rice.gap-size;
# margin-left = 0;
# margin-bottom = 0;
# margin-right = 0;
# spacing = 10;
# fixed-center = true;
# modules-left = [
# # "cpu"
# # "memory"
# "wireplumber"
# "backlight"
# "battery"
# "network"
# "hyprland/window"
# ];
# modules-center = [
# "hyprland/workspaces"
# ];
# modules-right = [
# "custom/mode"
# "custom/caldav_event"
# "custom/cclock"
# "tray"
# ];
# "hyprland/workspaces" = {
# on-click = "activate";
# format = "{name}";
# all-outputs = false;
# active-only = false;
# };
# "hyprland/window" = {
# # format = "${sep}{}";
# format = "{}";
# separate-outputs = true;
# };
# "custom/cclock" = {
# exec = "cclock";
# restart-interval = 60;
# };
# "custom/caldav_event" = {
# format = "󰃰${sep}{}";
# exec = "caldav_event";
# restart-interval = 60;
# max-width = 60;
# };
# "custom/mode" = {
# exec = "cat /tmp/submap-indictor";
# interval = "once";
# signal = 8;
# };
cpu = {
interval = 1;
format = "󰍛${sep}{}%";
max-length = 10;
};
memory = {
interval = 5;
format = "${sep}{avail:.0f}G free";
};
battery = {
interval = 60;
tooltip = false;
format = "{icon}${sep}{capacity}%";
states = {
warning = 15;
critical = 5;
};
format-icons = [ " " " " " " " " " " ];
format-charging = "{icon}${sep}+{capacity}%";
format-plugged = "{icon}${sep}P{capacity}%";
format-full = "{icon}${sep}F{capacity}%";
};
backlight = {
device = "eDP-1";
format = "{icon}${sep}{percent}%";
format-icons = [ "" "" "" "" "" "" "" "" "" ];
};
network = {
format-wifi = "${sep}{essid}";
format-ethernet = "󰈀${sep}Wired";
format-disconnected = "󰌙${sep}Disconnected";
};
wireplumber = {
format = "󰕾${sep}{volume}%";
format-muted = "󰝟${sep}--%";
};
};
};
style = with rice.color; let f = rice.lib.hex-to-rgb-comma-string; in /* css */ ''
* {
font-family: ${rice.font.code.name};
font-size: 1em;
min-height: 0px;
margin: 0px;
padding: 0px;
}
# cpu = {
# interval = 1;
# format = "󰍛${sep}{}%";
# max-length = 10;
# };
# memory = {
# interval = 5;
# format = "${sep}{avail:.0f}G free";
# };
# battery = {
# interval = 60;
# tooltip = false;
# format = "{icon}${sep}{capacity}%";
# states = {
# warning = 15;
# critical = 5;
# };
# format-icons = [ " " " " " " " " " " ];
# format-charging = "{icon}${sep}+{capacity}%";
# format-plugged = "{icon}${sep}P{capacity}%";
# format-full = "{icon}${sep}F{capacity}%";
# };
# backlight = {
# device = "eDP-1";
# format = "{icon}${sep}{percent}%";
# format-icons = [ "" "" "" "" "" "" "" "" "" ];
# };
# network = {
# format-wifi = "${sep}{essid}";
# format-ethernet = "󰈀${sep}Wired";
# format-disconnected = "󰌙${sep}Disconnected";
# };
# wireplumber = {
# format = "󰕾${sep}{volume}%";
# format-muted = "󰝟${sep}--%";
# };
# };
# };
# style = with rice.color; let f = rice.lib.hex-to-rgb-comma-string; in /* css */ ''
# * {
# font-family: ${rice.font.code.name};
# font-size: 1em;
# min-height: 0px;
# margin: 0px;
# padding: 0px;
# }
window#waybar {
background: rgba(${f background},${builtins.toString rice.transparency});
}
# window#waybar {
# background: rgba(${f background},${builtins.toString rice.transparency});
# }
#clock,
#custom-cclock,
#custom-mode,
#custom-caldav-event,
#battery,
#cpu,
#tray,
#disk,
#backlight,
#network,
#wireplumber,
#memory,
#window,
#workspaces {
padding: 0px 3px;
margin-top: 0.3em;
border-radius: ${builtins.toString rice.rounding}px;
color: rgb(${f accent.bright});
}
# #clock,
# #custom-cclock,
# #custom-mode,
# #custom-caldav-event,
# #battery,
# #cpu,
# #tray,
# #disk,
# #backlight,
# #network,
# #wireplumber,
# #memory,
# #window,
# #workspaces {
# padding: 0px 3px;
# margin-top: 0.3em;
# border-radius: ${builtins.toString rice.rounding}px;
# color: rgb(${f accent.bright});
# }
#workspaces button {
color: rgb(${f accent.base});
padding-left: 15px;
padding-right: 15px;
border-radius: ${builtins.toString rice.rounding}px;
}
#workspaces button.active { color: rgb(${f background}); background-color: rgb(${f accent.base}); }
#workspaces button:hover { color: rgb(${f tertiary.bright}); }
#workspaces button.urgent { background-color: rgba(${f magenta.base},${builtins.toString rice.transparency}); }
# #workspaces button {
# color: rgb(${f accent.base});
# padding-left: 15px;
# padding-right: 15px;
# border-radius: ${builtins.toString rice.rounding}px;
# }
# #workspaces button.active { color: rgb(${f background}); background-color: rgb(${f accent.base}); }
# #workspaces button:hover { color: rgb(${f tertiary.bright}); }
# #workspaces button.urgent { background-color: rgba(${f magenta.base},${builtins.toString rice.transparency}); }
#window, #custom-caldav_event {
font-family: ${rice.font.base.name}, ${rice.font.code.name};
color: rgb(${f tertiary.bright});
}
# #window, #custom-caldav_event {
# font-family: ${rice.font.base.name}, ${rice.font.code.name};
# color: rgb(${f tertiary.bright});
# }
#wireplumber.muted { color: rgb(${f tertiary.bright}); }
#wireplumber { padding-left: 10px; }
# #wireplumber.muted { color: rgb(${f tertiary.bright}); }
# #wireplumber { padding-left: 10px; }
#battery.warning:not(.charging) { color: rgb(${f green.base});; }
#battery.charging { color: rgb(${f green.base}); }
#battery.critical {
background: rgb(${f negative.base});
color: rgb(${f foreground});
}
# #battery.warning:not(.charging) { color: rgb(${f green.base});; }
# #battery.charging { color: rgb(${f green.base}); }
# #battery.critical {
# background: rgb(${f negative.base});
# color: rgb(${f foreground});
# }
#custom-mode { color: rgb(${f red.base}); }
'';
};
# #custom-mode { color: rgb(${f red.base}); }
# '';
# };
hyprpanel = {
enable = true;
package = pkgs.unstable.hyprpanel;
@@ -368,6 +368,7 @@ if __name__ == "__main__":
"bar.customModules.submap.icon" = true;
"bar.customModules.submap.disabledIcon" = "";
"bar.workspaces.applicationIconEmptyWorkspace" = "";
"bar.workspaces.applicationIconOncePerWorkspace" = false;
"bar.workspaces.numbered_active_indicator" = "underline";
"bar.workspaces.scroll_speed" = 1;