diff --git a/config/config.nix b/config/config.nix index 3a00b5c..47e73c7 100644 --- a/config/config.nix +++ b/config/config.nix @@ -78,7 +78,7 @@ in noto-fonts noto-fonts-cjk-sans noto-fonts-color-emoji - source-sans-pro + overpass # Display quicksand diff --git a/config/packages.nix b/config/packages.nix index 3f752ad..be9a838 100644 --- a/config/packages.nix +++ b/config/packages.nix @@ -25,7 +25,7 @@ in { in [ # Shell socat - jaq + jq tldr ripgrep unzip @@ -65,7 +65,7 @@ in { services.emacs.enable = true; services.emacs.package = with pkgs; - (emacsPackagesFor (pkgs.emacs29.override { withPgtk = true; })) + (emacsPackagesFor (pkgs.emacs30.override { withPgtk = true; })) .emacsWithPackages (epkgs: [ epkgs.vterm ]); programs.direnv.enable = true; diff --git a/home-manager/wayland/eww/eww.scss b/home-manager/wayland/eww/eww.scss index 22339bc..0e63d34 100644 --- a/home-manager/wayland/eww/eww.scss +++ b/home-manager/wayland/eww/eww.scss @@ -9,6 +9,7 @@ $accent: #f6a8cf; * { all: unset; + font-family: "Quicksand Medium"; } @mixin segment { @@ -19,18 +20,17 @@ $accent: #f6a8cf; .bar { background-color: $background; - font-family: "Quicksand Medium"; color: $foreground; font-size: 13px; - padding: 3px 10px; + padding: 3px 0px; } tooltip { - background-color: rgba(0,0,0,0.8); - font-family: "JetBrains Mono"; - font-size: 12px; + background-color: rgba(22, 16, 30, 0.9); + border-radius: 5px; + font-size: 13px; } .detail { @@ -45,7 +45,7 @@ tooltip { } .bar-window { - margin-left: 4px; + margin-left: 14px; .detail { margin-top: 1px; @@ -71,12 +71,9 @@ tooltip { .bar-music { @include segment; - padding-left: 3px; - padding-right: 10px; + padding: 0px 2px; .progress { - margin-right: 5px; - .back { color: $background-scale; } @@ -86,6 +83,12 @@ tooltip { } } + .symbol.stopped { + font-size: 15px; + color: $foreground-alt; + margin-left: -2px; + } + .symbol.paused { font-size: 12px; margin-left: 2px; @@ -96,6 +99,11 @@ tooltip { margin-top: 1px; } + .bar-music-meta { + margin-left: 6px; + margin-right: 10px; + } + .bar-artist { margin-top: 1px; margin-bottom: -2px; @@ -192,17 +200,12 @@ scale trough { .bar-internet { margin-left: 5px; margin-right: 9px; - font-family: "JetBrains Mono"; + font-size: 15px; color: #bb9af7; - font-size: 12px; &.disabled { color: $disabled; } - - .symbol { - font-size: 15px; - } } .bar-bluetooth { @@ -247,12 +250,19 @@ scale trough { } } -.bar-idleinhibit { - margin-left: 3px; - margin-right: 4px; - color: $disabled; +.bar-power { + font-size: 18px; + margin-left: 4px; + margin-right: 10px; + color: #f7768e; +} - &.active { - color: #f7768e; +.power { + font-size: 36px; + + button > box { + background-color: $background; + border-radius: 8px; + margin: 5px; } } diff --git a/home-manager/wayland/eww/eww.yuck b/home-manager/wayland/eww/eww.yuck index ab90e4c..b0aee77 100644 --- a/home-manager/wayland/eww/eww.yuck +++ b/home-manager/wayland/eww/eww.yuck @@ -2,7 +2,7 @@ ;; Window Info (deflisten window :initial "{}" - "~/.config/eww/scripts/active-window") + "scripts/active-window") (defwidget bar_window [class-limit title-limit] (box :class "bar-window" @@ -21,23 +21,23 @@ ;; Workspaces (deflisten workspaces :initial "[]" - "~/.config/eww/scripts/get-workspaces") + "scripts/get-workspaces") (deflisten current_workspace :initial "1" - "~/.config/eww/scripts/get-active-workspace") + "scripts/get-active-workspace") (defwidget bar_workspace_button [workspace] (eventbox :onclick "hyprctl dispatch workspace ${workspace.id}" (overlay - (box :class "segment workspace-button ${workspace.id == current_workspace ? "current" : "" -} ${workspace.windows > 0 ? "occupied" : "empty" -} ${workspace.previous > 0 ? "previous-occupied" : "previous-empty" -} ${workspace.next > 0 ? "next-occupied" : "next-empty"}" - (label :text "${workspace.id}")) + (box :class "workspace-button ${workspace.id == current_workspace ? "current" : "" +} ${workspace.windows > 0 ? "occupied" : "" +} ${workspace.previous > 0 ? "previous-occupied" : "" +} ${workspace.next > 0 ? "next-occupied" : ""}" + {workspace.id}) (box :visible {workspace.id == current_workspace} - (label :text "${workspace.id}"))))) + {workspace.id})))) (defwidget bar_workspaces [] - (eventbox :onscroll "~/.config/eww/scripts/change-active-workspace {} ${current_workspace}" + (eventbox :onscroll "scripts/change-active-workspace {} ${current_workspace}" (box :class "bar-workspaces" :orientation "h" :space-evenly true @@ -64,22 +64,19 @@ ;; Playerctl (deflisten mpris :initial "{}" - "~/.config/eww/scripts/mpris-metadata") + "scripts/mpris-metadata") -(defwidget bar_music [width artist-limit title-limit] +(defwidget bar_music [artist-limit title-limit] (eventbox :onclick "playerctl play-pause" - (box :class "bar-music segment" + (box :class "bar-music" :orientation "h" - :width width :space-evenly false (box :class "progress" (overlay (circular-progress :class "back" :value 100 :width 25 - :thickness 2 - :start-at 75 - :clockwise true) + :thickness 2) (circular-progress :class "front" :value {(mpris.position ?: 0) == 0 || (mpris.duration ?: 0) == 0 ? 0 : @@ -89,30 +86,36 @@ :thickness 2 :start-at 75 :clockwise true) - (label :class "symbol ${mpris.status == "Playing" ? "playing" : "paused"}" - :text {mpris.status == "Playing" ? "󰏤" : ""}))) - (box :orientation "v" - :space-evenly false - :visible {(mpris.title ?: "") != "" && (mpris.status ?: "Stopped") != "Stopped"} - (label :class "bar-artist detail" - :halign "start" - :limit-width artist-limit - :text {mpris.artist ?: ""}) - (label :halign "bar-title" - :limit-width title-limit - :text {mpris.title ?: ""}))))) + (label :class "symbol ${(mpris.title ?: "") == "" || (mpris.status ?: "Stopped") == "Stopped" ? "stopped" : + mpris.status == "Playing" ? "playing" : "paused"}" + :text {(mpris.title ?: "") == "" || (mpris.status ?: "Stopped") == "Stopped" ? "" : + mpris.status == "Playing" ? "󰏤" : ""}))) + (revealer :transition "slideright" + :duration "800ms" + :reveal {(mpris.title ?: "") != "" && (mpris.status ?: "Stopped") != "Stopped"} + (box :orientation "v" + :class "bar-music-meta" + :space-evenly false + (label :class "bar-artist detail" + :halign "start" + :limit-width artist-limit + :text {mpris.artist ?: ""}) + (label :class "bar-title" + :halign "start" + :limit-width title-limit + :text {mpris.title ?: ""})))))) + ;; Scales (Volume + Brightness) - (defwidget bar_scale [?class reveal-name reveal value symbol onchange ?onclick] (eventbox :onhover "${EWW_CMD} update ${reveal-name}=true" :onhoverlost "${EWW_CMD} update ${reveal-name}=false" - :onclick onclick (box :class "bar-scale ${class}" :space-evenly false - (label :class "symbol" - :text symbol) + (eventbox :onclick onclick + (label :class "symbol" + :text symbol)) (revealer :transition "slideright" :reveal reveal :duration "400ms" @@ -122,15 +125,16 @@ :min 0 :max 101 :onchange onchange)) - (label :class "percent" - :width 29 - :xalign 0 - :text "${value}%")))) + (eventbox :onclick onclick + (label :class "percent" + :width 29 + :xalign 0 + :text "${value}%"))))) (defvar volume_reveal false) (deflisten volume :initial "0" - "~/.config/eww/scripts/volume") + "scripts/volume") (defwidget bar_volume [] (bar_scale :class "bar-volume ${volume.muted ? "muted" : ""}" @@ -147,7 +151,7 @@ (defvar brightness_reveal false) (deflisten brightness :initial "0" - "~/.config/eww/scripts/brightness") + "scripts/brightness") (defwidget bar_brightness [] (bar_scale :class "bar-brightness" @@ -208,11 +212,11 @@ ;; Network (defpoll wifi :interval "5s" :initial "{}" - "~/.config/eww/scripts/network 802-11-wireless") + "scripts/network 802-11-wireless") (defpoll ethernet :interval "5s" :initial "{}" - "~/.config/eww/scripts/network 802-3-ethernet") + "scripts/network 802-3-ethernet") (defpoll bluetooth :interval "5s" :initial "{}" - "~/.config/eww/scripts/network bluetooth") + "scripts/network bluetooth") (defvar internet_reveal false) @@ -221,22 +225,66 @@ :space-evenly false :tooltip {ethernet != "{}" ? "${ethernet.name} (${ethernet.device})" : wifi != "{}" ? "${wifi.name} (${wifi.device})" : ""} - (label :class "symbol" - :text {wifi != "{}" ? "󰤨" : ethernet != "{}" ? "󰈁" : "󰤮"}))) + {wifi != "{}" ? "󰤨" : ethernet != "{}" ? "󰈀" : "󰤮"})) (defwidget bar_bluetooth [] (box :class "bar-bluetooth ${bluetooth == "{}" ? "disabled" : ""}" - (label :text {bluetooth != "{}" ? "󰂯" : "󰂲"}))) + {bluetooth != "{}" ? "󰂯" : "󰂲"})) -;; Idle Inhibitor +;; Power Menu (defpoll idleinhibit :interval "10s" :initial "0" "pgrep -c -f wayland\"\"-idle-inhibitor || true") -(defwidget bar_idleinhibit [] - (eventbox :onclick "scripts/toggle-idle-inhibit && ${EWW_CMD} poll idleinhibit" - (box :class "bar-idleinhibit ${idleinhibit > 0 ? "active" : ""}" - (label :text {idleinhibit > 0 ? "󰈈" : "󰛑"})))) +(defwidget bar_power [screen] + (eventbox :onclick "${EWW_CMD} active-windows | grep -q power_${screen} \ +&& ${EWW_CMD} close power_${screen} || ${EWW_CMD} open power --id power_${screen} --screen ${screen}" + (box :class "bar-power" + "⏻"))) + +(defwindow power [screen] + :geometry (geometry + :width "375px" + :height "150px" + :anchor "top right") + :namespace "eww-bar" + :stacking "fg" + :exclusive false + :focusable false + (eventbox :onhoverlost "${EWW_CMD} close power_${screen}" + (box :class "power" + :orientation "v" + (box :orientation "h" + (button :onclick "${EWW_CMD} close power_${screen}; systemctl suspend" + :tooltip "Sleep" + (box :style "color: #9aa5ce;" + "󰤄")) + (button :onclick "${EWW_CMD} close power_${screen}; hyprlock --immediate &" + :tooltip "Lock" + (box :style "color: #cfc9c2;" + "")) + (button :onclick "${EWW_CMD} close power_${screen}; hyprctl dispatch exit" + :tooltip "Log Out" + (box :style "color: #7dcfff; padding-left: 0.3ex;" + "")) + (button :onclick "${EWW_CMD} close power_${screen}; reboot" + :tooltip "Reboot" + (box :style "color: #e0af68;" + "")) + (button :onclick "${EWW_CMD} close power_${screen}; poweroff" + :tooltip "Shutdown" + (box :style "color: #f7768e; font-size: 1.35em; padding-bottom: 0.15ex;" + "⏼"))) + (box + :orientation "h" + (box) (box) (box) (box) + (button :onclick "scripts/toggle-idle-inhibit && ${EWW_CMD} poll idleinhibit" + :tooltip "Idle Inhibitor: ${idleinhibit > 0 ? "On" : "Off"}" + (box :style "padding-right: 0.5ex; ${idleinhibit > 0 ? + "color: #ff9e64" : + "color: #565f89; padding-top: 0.3ex;"}" + {idleinhibit > 0 ? "󰈈" : "󰛑"})))))) + ;; Separator @@ -244,7 +292,7 @@ (box :class "bar-sep" :hexpand false :vexpand false - (label :text "|"))) + "|")) ;; Bar Layout @@ -275,7 +323,7 @@ :artist-limit 30 :title-limit 25))) -(defwidget fire_bar_right_edge [] +(defwidget fire_bar_right_edge [screen] (box :orientation "h" :space-evenly false :halign "end" @@ -290,9 +338,9 @@ (bar_ram) (bar_battery) (bar_sep) - (bar_idleinhibit))) + (bar_power :screen screen))) -(defwidget fire_bar_layout [] +(defwidget fire_bar_layout [screen] (centerbox :class "bar" :orientation "h" (box :orientation "h" @@ -304,7 +352,7 @@ (box :orientation "h" :space-evenly false (fire_bar_right_wing) - (fire_bar_right_edge)))) + (fire_bar_right_edge :screen screen)))) (defwidget earth_bar_left_edge [] @@ -348,7 +396,7 @@ (bar_sep) (bar_idleinhibit))) -(defwidget earth_bar_layout [] +(defwidget earth_bar_layout [screen] (centerbox :class "bar" :orientation "h" (box :orientation "h" @@ -363,24 +411,22 @@ (earth_bar_right_edge)))) -(defwindow fire_bar - :monitor 0 +(defwindow fire_bar [screen] :geometry (geometry :width "100%" - :height "3%" + :height "35px" :anchor "top center") :namespace "eww-bar" :stacking "fg" :exclusive true :focusable false - (fire_bar_layout)) + (fire_bar_layout :screen screen)) -(defwindow earth_bar - :monitor 0 +(defwindow earth_bar [screen] :geometry (geometry :width "100%" - :height "3%" + :height "35px" :anchor "top center") :namespace "eww-bar" :stacking "fg" :exclusive true :focusable false - (earth_bar_layout)) + (earth_bar_layout :screen screen)) diff --git a/home-manager/wayland/eww/scripts/active-window b/home-manager/wayland/eww/scripts/active-window index 2124d68..8678080 100755 --- a/home-manager/wayland/eww/scripts/active-window +++ b/home-manager/wayland/eww/scripts/active-window @@ -1,6 +1,6 @@ #!/usr/bin/env bash -hyprctl activewindow -j | jaq -c . +hyprctl activewindow -j | jq -c . socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | stdbuf -o0 grep -ose '^activewindow>>' | while read -r line; do - hyprctl activewindow -j | jaq -c . + hyprctl activewindow -j | jq -c . done diff --git a/home-manager/wayland/eww/scripts/get-active-workspace b/home-manager/wayland/eww/scripts/get-active-workspace index b5d8dd3..65245a4 100755 --- a/home-manager/wayland/eww/scripts/get-active-workspace +++ b/home-manager/wayland/eww/scripts/get-active-workspace @@ -1,4 +1,4 @@ #!/usr/bin/env bash -hyprctl monitors -j | jaq '.[] | select(.focused) | .activeWorkspace.id' +hyprctl monitors -j | jq '.[] | select(.focused) | .activeWorkspace.id' socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | stdbuf -o0 awk -F '>>|,' -e '/^workspace>>/ {print $2}' -e '/^focusedmon>>/ {print $3}' diff --git a/home-manager/wayland/eww/scripts/get-workspaces b/home-manager/wayland/eww/scripts/get-workspaces index 5957cb2..3d43617 100755 --- a/home-manager/wayland/eww/scripts/get-workspaces +++ b/home-manager/wayland/eww/scripts/get-workspaces @@ -1,9 +1,9 @@ #!/usr/bin/env bash workspaces() { - hyprctl workspaces -j | jaq -c 'map({key: .id | tostring, value: .windows}) | from_entries - | . as $windows | [range(1;11) | {id: tostring, windows: $windows[tostring] // 0, - previous: $windows[.-1|tostring] // 0, next: $windows[.+1|tostring] // 0}]' + hyprctl workspaces -j | jq -c 'map({key: .id | tostring, value: .windows}) | from_entries + | . as $windows | [range(1;11) | {id: tostring, windows: ($windows[tostring] // 0), + previous: ($windows[.-1|tostring] // 0), next: ($windows[.+1|tostring] // 0)}]' } workspaces diff --git a/home-manager/wayland/hyprland.nix b/home-manager/wayland/hyprland.nix index 80c91d9..85db0af 100644 --- a/home-manager/wayland/hyprland.nix +++ b/home-manager/wayland/hyprland.nix @@ -93,7 +93,6 @@ in { bind = [ "$mod, Return, exec, $terminal" "$mod, D, exec, $menu" - "$mod Shift, E, exec, ${scripts}/exit" "$mod, M, exec, hyprlock --immediate" # Emacs Everywhere @@ -129,33 +128,18 @@ in { "$mod, E, hy3:changegroup, opposite" "$mod, A, hy3:changefocus, raise" - # Workspaces - "$mod, 1, workspace, 1" - "$mod, 2, workspace, 2" - "$mod, 3, workspace, 3" - "$mod, 4, workspace, 4" - "$mod, 5, workspace, 5" - "$mod, 6, workspace, 6" - "$mod, 7, workspace, 7" - "$mod, 8, workspace, 8" - "$mod, 9, workspace, 9" - "$mod, 0, workspace, 10" - - # Workspace Movement - "$mod Shift, 1, hy3:movetoworkspace, 1" - "$mod Shift, 2, hy3:movetoworkspace, 2" - "$mod Shift, 3, hy3:movetoworkspace, 3" - "$mod Shift, 4, hy3:movetoworkspace, 4" - "$mod Shift, 5, hy3:movetoworkspace, 5" - "$mod Shift, 6, hy3:movetoworkspace, 6" - "$mod Shift, 7, hy3:movetoworkspace, 7" - "$mod Shift, 8, hy3:movetoworkspace, 8" - "$mod Shift, 9, hy3:movetoworkspace, 9" - "$mod Shift, 0, hy3:movetoworkspace, 10" - # Screenshot "$mod, P, exec, ${scripts}/screenshot-save" - ]; + ] ++ + # Workspace manipulation + builtins.concatMap (n: + let + wsp = builtins.toString n; + key = if n == 10 then "0" else wsp; + in [ + "$mod, ${key}, workspace, ${wsp}" + "$mod Shift, ${key}, hy3:movetoworkspace, ${wsp}" + ]) (lib.range 1 10); bindn = [ ", mouse:272, hy3:focustab, mouse" diff --git a/home-manager/wayland/scripts/exit b/home-manager/wayland/scripts/exit deleted file mode 100755 index 10477b9..0000000 --- a/home-manager/wayland/scripts/exit +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -pkill -0 swaynag || \ - swaynag -t exit -m "Do you really want to exit?" \ - -B "Reboot" "reboot" -B "Shutdown" "poweroff" -b "Exit" "hyprctl dispatch exit" diff --git a/home-manager/wayland/scripts/multimedia b/home-manager/wayland/scripts/multimedia index d55c3e4..e5ac5fa 100755 --- a/home-manager/wayland/scripts/multimedia +++ b/home-manager/wayland/scripts/multimedia @@ -1,4 +1,4 @@ #!/usr/bin/env bash notify-send "$1" "$2" -c multimedia -a "$3" \ - $(makoctl list | jaq -r 'first(.data[][]|select(.category.data=="multimedia")|.id.data|["-r",.])[]') \ + $(makoctl list | jq -r 'first(.data[][]|select(.category.data=="multimedia")|.id.data|["-r",.])[]') \ -h "INT:value:$4" diff --git a/home-manager/wayland/wltools.nix b/home-manager/wayland/wltools.nix index d5c9540..dcfbfd0 100644 --- a/home-manager/wayland/wltools.nix +++ b/home-manager/wayland/wltools.nix @@ -9,19 +9,6 @@ imv ]; - xdg.configFile."swaynag/config".text = '' - font=JetBrainsMono 10 - layer=top - - [exit] - background=111320D0 - text=a9b1d6 - border-bottom=7BC5E4 - border-bottom-size=1 - button-background=282E49F0 - button-border-size=2 - ''; - # Hyprlock programs.hyprlock.enable = true;