Update polybar config
This commit is contained in:
parent
eff071aa95
commit
5a3202130c
1 changed files with 38 additions and 37 deletions
|
|
@ -11,6 +11,15 @@ let
|
||||||
playerCtl = "${pkgs.playerctl}/bin/playerctl";
|
playerCtl = "${pkgs.playerctl}/bin/playerctl";
|
||||||
playerStatus =
|
playerStatus =
|
||||||
"${playerCtl} -f '{{emoji(status)}} {{title}} - {{artist}}' metadata | ${head} -c 60";
|
"${playerCtl} -f '{{emoji(status)}} {{title}} - {{artist}}' metadata | ${head} -c 60";
|
||||||
|
confirm_command = { cmd, title ? null, text ? null, image ? null }:
|
||||||
|
lib.concatStringsSep " "
|
||||||
|
[
|
||||||
|
"${pkgs.yad}/bin/yad --question --center --on-top --sticky --timeout=30 --timeout-indicator=bottom"
|
||||||
|
(if isNull title then "" else ''--title "${title}"'')
|
||||||
|
(if isNull image then "" else ''--image "${image}"'')
|
||||||
|
(if isNull text then "" else ''--text "${text}"'')
|
||||||
|
"&& ${cmd}"
|
||||||
|
];
|
||||||
systemctl = "${pkgs.systemd}/bin/systemctl";
|
systemctl = "${pkgs.systemd}/bin/systemctl";
|
||||||
loginctl = "${pkgs.systemd}/bin/loginctl";
|
loginctl = "${pkgs.systemd}/bin/loginctl";
|
||||||
shutdown = "${pkgs.systemd}/bin/shutdown";
|
shutdown = "${pkgs.systemd}/bin/shutdown";
|
||||||
|
|
@ -82,7 +91,7 @@ let
|
||||||
# "Font Awesome 6 Free:size=14;0"
|
# "Font Awesome 6 Free:size=14;0"
|
||||||
# "Noto Color Emoji:size=2;2"
|
# "Noto Color Emoji:size=2;2"
|
||||||
"Noto Sans Symbols2:size=${toString pkgs.rice.font.monospace.size};2"
|
"Noto Sans Symbols2:size=${toString pkgs.rice.font.monospace.size};2"
|
||||||
# "Material Design Icons:size=${toString pkgs.rice.font.monospace.size};2"
|
"Material Design Icons:size=${toString pkgs.rice.font.monospace.size};2"
|
||||||
# "EmojiOne Color:size=${toString pkgs.rice.font.monospace.size};0"
|
# "EmojiOne Color:size=${toString pkgs.rice.font.monospace.size};0"
|
||||||
"Noto Sans CJK JP:size=${toString pkgs.rice.font.monospace.size};0"
|
"Noto Sans CJK JP:size=${toString pkgs.rice.font.monospace.size};0"
|
||||||
"Noto Sans CJK KR:size=${toString pkgs.rice.font.monospace.size};0"
|
"Noto Sans CJK KR:size=${toString pkgs.rice.font.monospace.size};0"
|
||||||
|
|
@ -100,7 +109,7 @@ in
|
||||||
# emojione
|
# emojione
|
||||||
# noto-fonts-emoji
|
# noto-fonts-emoji
|
||||||
noto-fonts
|
noto-fonts
|
||||||
# material-design-icons
|
material-design-icons
|
||||||
# font-awesome
|
# font-awesome
|
||||||
noto-fonts-cjk-sans
|
noto-fonts-cjk-sans
|
||||||
];
|
];
|
||||||
|
|
@ -291,51 +300,43 @@ in
|
||||||
suffix = " ";
|
suffix = " ";
|
||||||
};
|
};
|
||||||
label = {
|
label = {
|
||||||
open = recursiveUpdate colors.normal { text = " ⏻ "; };
|
open = recursiveUpdate colors.normal { text = ""; };
|
||||||
close = recursiveUpdate colors.normal { text = "Cancel"; };
|
close = recursiveUpdate colors.normal { text = ""; };
|
||||||
separator = { text = "|"; };
|
# separator = { text = "|"; };
|
||||||
};
|
};
|
||||||
menu = [
|
menu = [
|
||||||
[
|
[
|
||||||
({
|
({
|
||||||
text = "Logout";
|
text = "";
|
||||||
exec = "#powermenu.open.1";
|
exec = confirm_command {
|
||||||
|
cmd = logout;
|
||||||
|
title = "Logout";
|
||||||
|
text = "Do you want to logout?";
|
||||||
|
};
|
||||||
})
|
})
|
||||||
({
|
({
|
||||||
text = "Reboot";
|
text = "";
|
||||||
exec = "#powermenu.open.2";
|
exec = confirm_command {
|
||||||
|
cmd = "${systemctl} reboot";
|
||||||
|
title = "Reboot";
|
||||||
|
text = "Do you want to reboot?";
|
||||||
|
};
|
||||||
})
|
})
|
||||||
({
|
({
|
||||||
text = "Hibernate";
|
text = "";
|
||||||
exec = "#powermenu.open.3";
|
exec = confirm_command {
|
||||||
|
cmd = "${systemctl} hibernate";
|
||||||
|
title = "Hibernate";
|
||||||
|
text = "Do you want to hibernate?";
|
||||||
|
};
|
||||||
})
|
})
|
||||||
({
|
({
|
||||||
text = "Power off";
|
text = "";
|
||||||
exec = "#powermenu.open.4";
|
exec = confirm_command {
|
||||||
})
|
cmd = "${shutdown} now";
|
||||||
]
|
title = "Shutdown";
|
||||||
[
|
text = "Do you want to shutdown?";
|
||||||
({
|
};
|
||||||
text = "Logout";
|
|
||||||
exec = logout;
|
|
||||||
})
|
|
||||||
]
|
|
||||||
[
|
|
||||||
({
|
|
||||||
text = "Reboot";
|
|
||||||
exec = "${systemctl} reboot";
|
|
||||||
})
|
|
||||||
]
|
|
||||||
[
|
|
||||||
({
|
|
||||||
text = "Hibernate";
|
|
||||||
exec = "${systemctl} hibernate";
|
|
||||||
})
|
|
||||||
]
|
|
||||||
[
|
|
||||||
({
|
|
||||||
text = "Power off";
|
|
||||||
exec = "${shutdown} now";
|
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue