From 77b41ce0f055957085d995d09353c28db11419b3 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Fri, 30 Jun 2023 07:49:28 -0400 Subject: [PATCH] waybar: Add wallpaper button This makes it possible to change the wallpaper with a button press. Unfortunately, waybar does not support hover indicators for custom modules, so there's no way to tell that this button is clickable. --- home/waybar.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/home/waybar.nix b/home/waybar.nix index d6538499..2b548e85 100644 --- a/home/waybar.nix +++ b/home/waybar.nix @@ -82,6 +82,12 @@ let on-click-middle = "hyprctl dispatch workspace empty"; tooltip = false; }; + + "custom/wallpaper" = { + format = "壁\n紙"; + on-click = "bash -c ~/.config/waybar/wallpaper.sh"; + tooltip = false; + }; }; in { @@ -101,6 +107,7 @@ in autohide-starthidden = true; modules-left = if icons then [ "wlr/taskbar" ] else [ "wlr/workspaces" "custom/new-workspace" ]; + modules-center = [ "custom/wallpaper" ]; modules-right = [ "wireplumber" "backlight" "battery" "clock" ]; }; };