toggle polybar with keybinding

This commit is contained in:
Noah Masur 2022-05-14 23:31:04 -04:00
parent 7baec572e3
commit 1a31d4d3e5
2 changed files with 10 additions and 0 deletions

View File

@ -6,6 +6,13 @@ let
in {
options = {
toggleBarCmd = lib.mkOption {
type = lib.types.str;
description = "Command to hide and show the status bar.";
};
};
config = lib.mkIf config.services.xserver.enable {
services.xserver.windowManager = {
@ -125,6 +132,7 @@ in {
# Window options
"${modifier}+q" = "kill";
"${modifier}+b" = "exec ${config.toggleBarCmd}";
"${modifier}+f" = "fullscreen toggle";
"${modifier}+h" = "focus left";
"${modifier}+j" = "focus down";

View File

@ -2,6 +2,8 @@
config = lib.mkIf config.services.xserver.enable {
toggleBarCmd = "polybar-msg cmd toggle";
home-manager.users.${config.user} = {
services.polybar = {