From 782e61ea00fb81092cd05b949d6db885b30506dc Mon Sep 17 00:00:00 2001 From: Minijackson Date: Sun, 4 Aug 2024 17:49:07 +0200 Subject: usecases/sway: move from mako to swaync for notifications And adapt waybar for it --- usecases/desktop/graphical/sway.nix | 608 ++++++++++++++++++---------------- usecases/desktop/graphical/swaync.css | 257 ++++++++++++++ usecases/desktop/graphical/waybar.nix | 40 +-- 3 files changed, 596 insertions(+), 309 deletions(-) create mode 100644 usecases/desktop/graphical/swaync.css (limited to 'usecases/desktop/graphical') diff --git a/usecases/desktop/graphical/sway.nix b/usecases/desktop/graphical/sway.nix index 815f787..7e66796 100644 --- a/usecases/desktop/graphical/sway.nix +++ b/usecases/desktop/graphical/sway.nix @@ -1,319 +1,346 @@ -_inputs: { - lib, - pkgs, - ... -}: { +_inputs: +{ lib, pkgs, ... }: +{ services.greetd = { enable = true; vt = 6; settings.default_session.command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd sway"; }; - home-manager.users.minijackson = { - config, - osConfig, - ... - }: { - wayland.windowManager.sway = { - enable = true; - - extraSessionCommands = let - schema = pkgs.gsettings-desktop-schemas; - datadir = "${schema}/share/gsettings-schemas/${schema.name}"; - in '' - # https://github.com/emersion/xdg-desktop-portal-wlr/issues/20 - export XDG_CURRENT_DESKTOP=sway - # https://github.com/emersion/xdg-desktop-portal-wlr/pull/11 - export XDG_SESSION_TYPE=wayland - - # Makes gsettings work - export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS - - export SDL_VIDEODRIVER=wayland - - export QT_QPA_PLATFORM=wayland - export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 - ''; - - wrapperFeatures.gtk = true; - - config = { - workspaceLayout = "tabbed"; - - # Using waybar - bars = []; - - colors = with osConfig.theme.colors; { - focused = { - border = lightBackground; - background = lightBackground; - text = foreground; - indicator = dominant; - childBorder = dominant; + home-manager.users.minijackson = + { config, osConfig, ... }: + { + wayland.windowManager.sway = { + enable = true; + + extraSessionCommands = + let + schema = pkgs.gsettings-desktop-schemas; + datadir = "${schema}/share/gsettings-schemas/${schema.name}"; + in + '' + # https://github.com/emersion/xdg-desktop-portal-wlr/issues/20 + export XDG_CURRENT_DESKTOP=sway + # https://github.com/emersion/xdg-desktop-portal-wlr/pull/11 + export XDG_SESSION_TYPE=wayland + + # Makes gsettings work + export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS + + export SDL_VIDEODRIVER=wayland + + export QT_QPA_PLATFORM=wayland + export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 + ''; + + wrapperFeatures.gtk = true; + + config = { + workspaceLayout = "tabbed"; + + # Using waybar + bars = [ ]; + + colors = with osConfig.theme.colors; { + focused = { + border = lightBackground; + background = lightBackground; + text = foreground; + indicator = dominant; + childBorder = dominant; + }; + + focusedInactive = { + border = background; + background = background; + text = dimForeground; + indicator = dominant; + childBorder = background; + }; + + unfocused = { + border = background; + background = background; + text = dimForeground; + indicator = dominant; + childBorder = background; + }; + + urgent = { + border = brightRed; + background = brightRed; + text = foreground; + indicator = brightRed; + childBorder = brightRed; + }; + + placeholder = { + border = background0; + background = background0; + text = foreground; + indicator = background0; + childBorder = background0; + }; }; - focusedInactive = { - border = background; - background = background; - text = dimForeground; - indicator = dominant; - childBorder = background; + floating.criteria = [ { title = "Steam - News"; } ]; + + input = { + "*" = { + xkb_options = "compose:caps"; + }; + + "1:1:AT_Translated_Set_2_keyboard" = { + xkb_layout = "fr"; + xkb_variant = "oss"; + xkb_options = "compose:caps"; + xkb_numlock = "enabled"; + }; + + "1452:514:Alps_Electric_M2452" = { + xkb_layout = "fr"; + xkb_variant = "oss"; + xkb_options = "compose:caps,lv3:rwin_switch"; + xkb_numlock = "enabled"; + }; + + "7764:8240:TypeMatrix.com_USB_Keyboard" = { + xkb_layout = "us"; + xkb_variant = "dvorak"; + xkb_options = "eurosign:e,compose:caps"; + xkb_numlock = "enabled"; + }; + + "1133:49948:Logitech_USB_Keyboard" = { + xkb_layout = "fr"; + xkb_variant = "oss"; + xkb_options = "eurosign:e,compose:caps"; + xkb_numlock = "enabled"; + }; + + "1102:4639:DELL0817:00_044E:121F_Mouse" = { + scroll_method = "on_button_down"; + scroll_button = "button2"; + }; }; - unfocused = { - border = background; - background = background; - text = dimForeground; - indicator = dominant; - childBorder = background; - }; - - urgent = { - border = brightRed; - background = brightRed; - text = foreground; - indicator = brightRed; - childBorder = brightRed; - }; - - placeholder = { - border = background0; - background = background0; - text = foreground; - indicator = background0; - childBorder = background0; + keybindings = + let + modifier = config.wayland.windowManager.sway.config.modifier; + inherit (lib) getExe; + inherit (pkgs) + brightnessctl + grim + pamixer + slurp + ; + in + lib.mkOptionDefault { + "${modifier}+ampersand" = "workspace 1"; + "${modifier}+eacute" = "workspace 2"; + "${modifier}+quotedbl" = "workspace 3"; + "${modifier}+apostrophe" = "workspace 4"; + "${modifier}+parenleft" = "workspace 5"; + "${modifier}+minus" = "workspace 6"; + "${modifier}+egrave" = "workspace 7"; + "${modifier}+underscore" = "workspace 8"; + "${modifier}+ccedilla" = "workspace 9"; + "${modifier}+agrave" = "workspace 10"; + + "${modifier}+Shift+ampersand" = "move container to workspace 1"; + "${modifier}+Shift+eacute" = "move container to workspace 2"; + "${modifier}+Shift+quotedbl" = "move container to workspace 3"; + "${modifier}+Shift+apostrophe" = "move container to workspace 4"; + "${modifier}+Shift+parenleft" = "move container to workspace 5"; + "${modifier}+Shift+minus" = "move container to workspace 6"; + "${modifier}+Shift+egrave" = "move container to workspace 7"; + "${modifier}+Shift+underscore" = "move container to workspace 8"; + "${modifier}+Shift+ccedilla" = "move container to workspace 9"; + "${modifier}+Shift+agrave" = "move container to workspace 10"; + + "${modifier}+Ctrl+h" = "move workspace to output left"; + "${modifier}+Ctrl+j" = "move workspace to output down"; + "${modifier}+Ctrl+k" = "move workspace to output up"; + "${modifier}+Ctrl+l" = "move workspace to output right"; + + "${modifier}+Ctrl+Left" = "move workspace to output left"; + "${modifier}+Ctrl+Down" = "move workspace to output down"; + "${modifier}+Ctrl+Up" = "move workspace to output up"; + "${modifier}+Ctrl+Right" = "move workspace to output right"; + + "${modifier}+n" = "split none"; + + "${modifier}+comma" = "exec swaync-client --close-latest"; + "${modifier}+Shift+comma" = "exec swaync-client --close-all"; + "${modifier}+period" = "exec swaync-client --toggle-panel"; + + "${modifier}+m" = "exec ${pkgs.swaylock}/bin/swaylock"; + + "${modifier}+c" = "exec rofi -show calc -modi calc -no-sort -no-persist-history -calc-command 'echo -n {result} | wl-copy'"; + "${modifier}+p" = "exec rofi-pass"; + + "XF86AudioRaiseVolume" = "exec ${getExe pamixer} -i 5"; + "XF86AudioLowerVolume" = "exec ${getExe pamixer} -d 5"; + "XF86AudioMute" = "exec ${getExe pamixer} -t"; + + "XF86MonBrightnessUp" = "exec ${getExe brightnessctl} set -- +10%"; + "XF86MonBrightnessDown" = "exec ${getExe brightnessctl} set -- -10%"; + + "Print" = "exec ${getExe grim}"; + "Shift+Print" = "exec ${getExe slurp} | ${getExe grim} -g -"; + }; + + menu = '' + rofi -show drun -terminal alacritty -modi "drun,run,emoji,keys" + ''; + + modifier = "Mod4"; + + output."*".bg = "${../../../res/wallpapers/wallpaper-1920x1080-kernel-card-black.png} fill"; + + startup = [ { command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; } ]; + + terminal = "${pkgs.alacritty}/bin/alacritty"; + + window = { + border = 2; + hideEdgeBorders = "smart"; }; }; + }; - floating.criteria = [ - {title = "Steam - News";} - ]; - - input = { - "*" = { - xkb_options = "compose:caps"; - }; - - "1:1:AT_Translated_Set_2_keyboard" = { - xkb_layout = "fr"; - xkb_variant = "oss"; - xkb_options = "compose:caps"; - xkb_numlock = "enabled"; - }; - - "1452:514:Alps_Electric_M2452" = { - xkb_layout = "fr"; - xkb_variant = "oss"; - xkb_options = "compose:caps,lv3:rwin_switch"; - xkb_numlock = "enabled"; - }; - - "7764:8240:TypeMatrix.com_USB_Keyboard" = { - xkb_layout = "us"; - xkb_variant = "dvorak"; - xkb_options = "eurosign:e,compose:caps"; - xkb_numlock = "enabled"; + services.swaync = { + enable = true; + + settings = { + widgets = [ + "buttons-grid" + "mpris" + "volume" + "backlight" + "inhibitors" + "title" + "dnd" + "notifications" + ]; + widget-config = { + buttons-grid.actions = [ + { + label = "󰌾"; + command = "swaylock"; + } + { + label = "󰜉"; + command = "systemctl reboot"; + } + { + label = "󰐥"; + command = "systemctl poweroff"; + } + ]; + volume = { + label = "󰕾"; + show-per-app = true; + show-per-app-label = true; + }; }; + }; - "1133:49948:Logitech_USB_Keyboard" = { - xkb_layout = "fr"; - xkb_variant = "oss"; - xkb_options = "eurosign:e,compose:caps"; - xkb_numlock = "enabled"; - }; + style = pkgs.substituteAll { + src = ./swaync.css; + inherit (osConfig.theme.colors) + background1 + background2 + background5 + dimDominant + dominant + foreground + foreground3 + softBackground + ; + }; + }; - "1102:4639:DELL0817:00_044E:121F_Mouse" = { - scroll_method = "on_button_down"; - scroll_button = "button2"; - }; + services.wlsunset = { + enable = true; + latitude = "48.864716"; + longitude = "2.349014"; + # Reduce blue light anyways + temperature = { + day = 4000; + night = 2500; }; + }; - keybindings = let - modifier = config.wayland.windowManager.sway.config.modifier; - inherit (lib) getExe; - inherit (pkgs) brightnessctl grim pamixer slurp; - in - lib.mkOptionDefault { - "${modifier}+ampersand" = "workspace 1"; - "${modifier}+eacute" = "workspace 2"; - "${modifier}+quotedbl" = "workspace 3"; - "${modifier}+apostrophe" = "workspace 4"; - "${modifier}+parenleft" = "workspace 5"; - "${modifier}+minus" = "workspace 6"; - "${modifier}+egrave" = "workspace 7"; - "${modifier}+underscore" = "workspace 8"; - "${modifier}+ccedilla" = "workspace 9"; - "${modifier}+agrave" = "workspace 10"; - - "${modifier}+Shift+ampersand" = "move container to workspace 1"; - "${modifier}+Shift+eacute" = "move container to workspace 2"; - "${modifier}+Shift+quotedbl" = "move container to workspace 3"; - "${modifier}+Shift+apostrophe" = "move container to workspace 4"; - "${modifier}+Shift+parenleft" = "move container to workspace 5"; - "${modifier}+Shift+minus" = "move container to workspace 6"; - "${modifier}+Shift+egrave" = "move container to workspace 7"; - "${modifier}+Shift+underscore" = "move container to workspace 8"; - "${modifier}+Shift+ccedilla" = "move container to workspace 9"; - "${modifier}+Shift+agrave" = "move container to workspace 10"; - - "${modifier}+Ctrl+h" = "move workspace to output left"; - "${modifier}+Ctrl+j" = "move workspace to output down"; - "${modifier}+Ctrl+k" = "move workspace to output up"; - "${modifier}+Ctrl+l" = "move workspace to output right"; - - "${modifier}+Ctrl+Left" = "move workspace to output left"; - "${modifier}+Ctrl+Down" = "move workspace to output down"; - "${modifier}+Ctrl+Up" = "move workspace to output up"; - "${modifier}+Ctrl+Right" = "move workspace to output right"; - - "${modifier}+n" = "split none"; - - "${modifier}+comma" = "exec makoctl dismiss"; - "${modifier}+Shift+comma" = "exec makoctl dismiss --all"; - "${modifier}+period" = "exec makoctl menu rofi -dmenu -no-custom"; - - "${modifier}+m" = "exec ${pkgs.swaylock}/bin/swaylock"; - - "${modifier}+c" = "exec rofi -show calc -modi calc -no-sort -no-persist-history -calc-command 'echo -n {result} | wl-copy'"; - "${modifier}+p" = "exec rofi-pass"; - - "XF86AudioRaiseVolume" = "exec ${getExe pamixer} -i 5"; - "XF86AudioLowerVolume" = "exec ${getExe pamixer} -d 5"; - "XF86AudioMute" = "exec ${getExe pamixer} -t"; - - "XF86MonBrightnessUp" = "exec ${getExe brightnessctl} set -- +10%"; - "XF86MonBrightnessDown" = "exec ${getExe brightnessctl} set -- -10%"; - - "Print" = "exec ${getExe grim}"; - "Shift+Print" = "exec ${getExe slurp} | ${getExe grim} -g -"; - }; + programs.swaylock = { + enable = true; + settings = + let + inherit (osConfig.theme.colors) + background + brightGreen + brightOrange + brightRed + dominant + neutralOrange + neutralRed + ; + in + { + ignore-empty-password = true; + show-failed-attempts = true; - menu = '' - rofi -show drun -terminal alacritty -modi "drun,run,emoji,keys" - ''; + image = "${../../../res/wallpapers/wallpaper-1920x1080-install-gentoo.png}"; - modifier = "Mod4"; + font = "monospace"; - output."*".bg = "${../../../res/wallpapers/wallpaper-1920x1080-kernel-card-black.png} fill"; + inside-color = "${lib.removePrefix "#" dominant}dd"; + inside-clear-color = "${lib.removePrefix "#" neutralOrange}dd"; + inside-ver-color = "${lib.removePrefix "#" neutralOrange}dd"; + inside-wrong-color = "${lib.removePrefix "#" neutralRed}dd"; - startup = [ - # TODO: use systemd user service - { - command = "mako"; - always = true; - } - {command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";} - ]; + key-hl-color = "${lib.removePrefix "#" brightGreen}ee"; + bs-hl-color = "${lib.removePrefix "#" neutralRed}ee"; - terminal = "${pkgs.alacritty}/bin/alacritty"; + line-color = "${lib.removePrefix "#" background}ee"; + line-clear-color = "${lib.removePrefix "#" background}ee"; + line-ver-color = "${lib.removePrefix "#" background}ee"; + line-wrong-color = "${lib.removePrefix "#" background}ee"; - window = { - border = 2; - hideEdgeBorders = "smart"; - }; - }; - }; + ring-color = "${lib.removePrefix "#" dominant}ee"; + ring-clear-color = "${lib.removePrefix "#" brightOrange}ee"; + ring-ver-color = "${lib.removePrefix "#" brightOrange}ee"; + ring-wrong-color = "${lib.removePrefix "#" brightRed}ee"; - services.mako = let - inherit (osConfig.theme.colors) background0 dimDominant foreground neutralBlue; - in { - enable = true; - backgroundColor = background0; - borderColor = dimDominant; - borderSize = 2; - progressColor = neutralBlue; - textColor = foreground; - - margin = "15"; - padding = "7"; - - groupBy = "app-name"; - - extraConfig = '' - [mode=do-not-disturb] - invisible=1 - ''; - }; + separator-color = "${lib.removePrefix "#" background}ee"; - services.wlsunset = { - enable = true; - latitude = "48.864716"; - longitude = "2.349014"; - # Reduce blue light anyways - temperature = { - day = 4000; - night = 2500; - }; - }; + text-color = "${lib.removePrefix "#" background}ff"; + text-clear-color = "${lib.removePrefix "#" background}ff"; + text-ver-color = "${lib.removePrefix "#" background}ff"; + text-wrong-color = "${lib.removePrefix "#" background}ff"; - programs.swaylock = { - enable = true; - settings = let - inherit - (osConfig.theme.colors) - background - brightGreen - brightOrange - brightRed - dominant - neutralOrange - neutralRed - ; - in { - ignore-empty-password = true; - show-failed-attempts = true; - - image = "${../../../res/wallpapers/wallpaper-1920x1080-install-gentoo.png}"; - - font = "monospace"; - - inside-color = "${lib.removePrefix "#" dominant}dd"; - inside-clear-color = "${lib.removePrefix "#" neutralOrange}dd"; - inside-ver-color = "${lib.removePrefix "#" neutralOrange}dd"; - inside-wrong-color = "${lib.removePrefix "#" neutralRed}dd"; - - key-hl-color = "${lib.removePrefix "#" brightGreen}ee"; - bs-hl-color = "${lib.removePrefix "#" neutralRed}ee"; - - line-color = "${lib.removePrefix "#" background}ee"; - line-clear-color = "${lib.removePrefix "#" background}ee"; - line-ver-color = "${lib.removePrefix "#" background}ee"; - line-wrong-color = "${lib.removePrefix "#" background}ee"; - - ring-color = "${lib.removePrefix "#" dominant}ee"; - ring-clear-color = "${lib.removePrefix "#" brightOrange}ee"; - ring-ver-color = "${lib.removePrefix "#" brightOrange}ee"; - ring-wrong-color = "${lib.removePrefix "#" brightRed}ee"; - - separator-color = "${lib.removePrefix "#" background}ee"; - - text-color = "${lib.removePrefix "#" background}ff"; - text-clear-color = "${lib.removePrefix "#" background}ff"; - text-ver-color = "${lib.removePrefix "#" background}ff"; - text-wrong-color = "${lib.removePrefix "#" background}ff"; - - indicator-radius = 75; - indicator-thickness = 10; + indicator-radius = 75; + indicator-thickness = 10; + }; }; - }; - xsession.importedVariables = [ - "DBUS_SESSION_BUS_ADDRESS" - "DISPLAY" - "SSH_AUTH_SOCK" - "XAUTHORITY" - "XDG_DATA_DIRS" - "XDG_RUNTIME_DIR" - "XDG_SESSION_ID" - - "WAYLAND_DISPLAY" - "SWAYSOCK" - "I3SOCK" - - "XDG_CURRENT_DESKTOP" - "XDG_SESSION_TYPE" - ]; - }; + xsession.importedVariables = [ + "DBUS_SESSION_BUS_ADDRESS" + "DISPLAY" + "SSH_AUTH_SOCK" + "XAUTHORITY" + "XDG_DATA_DIRS" + "XDG_RUNTIME_DIR" + "XDG_SESSION_ID" + + "WAYLAND_DISPLAY" + "SWAYSOCK" + "I3SOCK" + + "XDG_CURRENT_DESKTOP" + "XDG_SESSION_TYPE" + ]; + }; # TODO: polkit gnome @@ -325,10 +352,13 @@ _inputs: { ]; programs.xwayland.enable = true; - security.pam.services.swaylock = {}; + security.pam.services.swaylock = { }; xdg.portal = { wlr.enable = true; - config.sway.default = ["wlr" "gtk"]; + config.sway.default = [ + "wlr" + "gtk" + ]; }; } diff --git a/usecases/desktop/graphical/swaync.css b/usecases/desktop/graphical/swaync.css new file mode 100644 index 0000000..d3e103a --- /dev/null +++ b/usecases/desktop/graphical/swaync.css @@ -0,0 +1,257 @@ +/* Adapted from: https://pastebin.com/xycT4nrk */ + +@define-color cc-bg @softBackground@; +@define-color noti-border-color @cc-bg; +@define-color noti-bg @background2@; +@define-color noti-bg-darker @background2@; +@define-color noti-bg-hover rgb(27, 27, 43); +@define-color noti-bg-focus rgba(27, 27, 27, 0.6); +@define-color text-color @foreground@; +@define-color text-color-disabled @foreground3@; +@define-color dominant @dominant@; +@define-color dimDominant @dimDominant@; +@define-color bg-selected @dominant; +@define-color border-color @background5@; +@define-color darker-bg @background1@; + +* { + font-family: mono; + font-weight: bold; + font-size: 14px; + outline: none; + transition: all .1s ease-in-out; +} + +/* Buttons */ + +.close-button, +.notification-action, +.widget-buttons-grid>flowbox>flowboxchild>button, +.widget-menubar button, +.widget-title>button { + color: @text-color; + background-color: @cc-bg; + border: 1px solid @darker-bg; + border-radius: 5px; + box-shadow: none; + text-shadow: none; +} + +.close-button:hover, +.notification-action:hover, +.widget-buttons-grid>flowbox>flowboxchild>button:hover, +.widget-menubar button:hover, +.widget-title>button:hover { + background-color: @dominant; + box-shadow: none; + text-shadow: none; +} + +.control-center .notification-row:focus, +.control-center .notification-row:hover { + opacity: 1; + background: @noti-bg-darker +} + +.notification-row { + outline: none; + margin: 5px; + padding: 0; +} + +.notification { + background: @noti-bg; + margin: 0px; + border-radius: 5px; + border: 2px solid @border-color; + box-shadow: none; +} + +.floating-notifications .notification { + border-color: @dominant; +} + +.close-button { + border: none; + background: @dimDominant; + color: @cc-bg; + padding: 0; + margin: 5px 3px; +} + +.close-button:hover { + box-shadow: none; + text-shadow: none; +} + +.notification-content { + background: @cc-bg; + border-radius: 5px 5px 0 0; + padding: 7px; + margin: 0; +} + +.notification-default-action:last-child .notification-content { + border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; +} + +.notification-content .summary { + padding: 3px 1em; + font-size: 13px; + /*color: @text-color;*/ +} + +.notification-content .body { + padding: 1em; + font-size: 12px; + font-weight: normal; +} + +.notification-content .time { + font-size: 11px; + color: @dominant; + margin: 3px 3em; +} + +.notification-action { + background-color: @noti-bg-darker; + border-radius: 0; + border: none; + border-top: 2px solid @border-color; + border-left: 1px solid @border-color; + border-right: 1px solid @border-color; +} + +.notification-action:first-child { + border-left: none; + border-bottom-left-radius: 5px; +} + +.notification-action:last-child { + border-right: none; + border-bottom-right-radius: 5px; +} + +.notification-default-action:hover, +.notification-action:hover { + background: @dominant; + text-shadow: none; +} + +.control-center { + background: @cc-bg; + border: 2px solid @dominant; + border-radius: 0px; +} + +.control-center-list { + background: transparent +} + +.control-center-list-placeholder { + opacity: .5 +} + +.floating-notifications { + background: transparent +} + +.blank-window { + background: alpha(black, 0.1) +} + +.widget-backlight, +.widget-buttons-grid, +.widget-dnd, +.widget-inhibitors, +.widget-label, +.widget-menubar, +.widget-mpris, +.widget-notifications, +.widget-title, +.widget-volume { + color: @text-color; + background: @noti-bg-darker; + border: 2px solid @border-color; + border-radius: 5px; + padding: 5px 10px; + margin: 10px; +} + +.widget-title { + font-size: 1.5rem; +} + +.widget-dnd { + font-size: large; + color: @text-color; +} + +.widget-dnd>switch { + /*border-radius: 4px;*/ + background: @darker-bg; +} + +.widget-dnd>switch:checked { + background: @dominant; +} + +.widget-dnd>switch slider { + /*margin: 3px;*/ + background: @border-color; + /*border: 1px solid black;*/ + /*border-radius: 5px*/ +} + +.widget-dnd>switch:checked slider { + /*border-radius: 5px;*/ +} + +.widget-label>label { + font-size: 1rem; + color: @text-color; +} + +.widget-mpris > box > button { + border-radius: 5px; +} + +.widget-mpris-player { + padding: 10px 20px; + margin: 22px; + box-shadow: none; +} + +.widget-mpris-title { + font-weight: 700; + font-size: 1.25rem +} + +.widget-mpris-subtitle { + font-size: 1.1rem +} + +.widget-buttons-grid button label { + font-size: 1.5em; +} + +.widget-buttons-grid>flowbox>flowboxchild>button { + margin: 3px; +} + +.widget-menubar>box>.menu-button-bar>button { + border: none; + background: transparent; + box-shadow: none; + text-shadow: none; +} + +.topbar-buttons>button { + border: none; + background: transparent +} + +scale trough highlight { + background-color: @dominant; +} diff --git a/usecases/desktop/graphical/waybar.nix b/usecases/desktop/graphical/waybar.nix index 15868fe..bad1e09 100644 --- a/usecases/desktop/graphical/waybar.nix +++ b/usecases/desktop/graphical/waybar.nix @@ -17,7 +17,7 @@ inputs: modules-left = [ "sway/workspaces" "sway/mode" ]; modules-center = lib.mkIf config.services.mpd.enable [ "mpd" ]; modules-right = [ - "idle_inhibitor" + "custom/notification" "pulseaudio" "network#eth" "network#wlan" @@ -59,26 +59,26 @@ inputs: }; }; - idle_inhibitor = { + "custom/notification" = let + swaync-client = "${lib.getBin config.home-manager.users.minijackson.services.swaync.package}/bin/swaync-client"; + in { format = "{icon}"; format-icons = { - activated = ""; - deactivated = ""; + notification = "󰂜"; + none = "󰂜"; + dnd-notification = "󰪑"; + dnd-none = "󰪑"; + inhibited-notification = "󰂜"; + inhibited-none = "󰂜"; + dnd-inhibited-notification = "󰪑"; + dnd-inhibited-none = "󰪑"; }; - on-click = let - script = pkgs.writeShellApplication { - name = "switch-idle-mode"; - runtimeInputs = [pkgs.mako pkgs.gnugrep]; - text = '' - if makoctl mode | grep -q do-not-disturb; then - makoctl mode -r do-not-disturb - else - makoctl mode -a do-not-disturb - fi - ''; - }; - in - lib.getExe script; + tooltip = false; + return-type = "json"; + exec = "${swaync-client} -swb"; + on-click = "${swaync-client} -t -sw"; + on-click-right = "${swaync-client} -d -sw"; + escape = true; }; clock = { @@ -176,7 +176,7 @@ inputs: border-bottom: 3px solid ${foreground}; } - #clock, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio, #custom-mpd, #mpd, #tray, #mode, #idle_inhibitor { + #clock, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio, #custom-mpd, #mpd, #tray, #mode, #custom-notification { padding: 0 10px; margin: 0 5px; } @@ -263,7 +263,7 @@ inputs: background-color: #2980b9; } - #idle_inhibitor { + #custom-notification { background-color: ${lightBackground}; } -- cgit v1.2.3