diff --git a/config/config.nix b/config/config.nix index 47e73c7..3a00b5c 100644 --- a/config/config.nix +++ b/config/config.nix @@ -78,7 +78,7 @@ in noto-fonts noto-fonts-cjk-sans noto-fonts-color-emoji - overpass + source-sans-pro # Display quicksand diff --git a/config/packages.nix b/config/packages.nix index be9a838..3f752ad 100644 --- a/config/packages.nix +++ b/config/packages.nix @@ -25,7 +25,7 @@ in { in [ # Shell socat - jq + jaq tldr ripgrep unzip @@ -65,7 +65,7 @@ in { services.emacs.enable = true; services.emacs.package = with pkgs; - (emacsPackagesFor (pkgs.emacs30.override { withPgtk = true; })) + (emacsPackagesFor (pkgs.emacs29.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 0e63d34..22339bc 100644 --- a/home-manager/wayland/eww/eww.scss +++ b/home-manager/wayland/eww/eww.scss @@ -9,7 +9,6 @@ $accent: #f6a8cf; * { all: unset; - font-family: "Quicksand Medium"; } @mixin segment { @@ -20,17 +19,18 @@ $accent: #f6a8cf; .bar { background-color: $background; + font-family: "Quicksand Medium"; color: $foreground; font-size: 13px; - padding: 3px 0px; + padding: 3px 10px; } tooltip { - background-color: rgba(22, 16, 30, 0.9); - border-radius: 5px; - font-size: 13px; + background-color: rgba(0,0,0,0.8); + font-family: "JetBrains Mono"; + font-size: 12px; } .detail { @@ -45,7 +45,7 @@ tooltip { } .bar-window { - margin-left: 14px; + margin-left: 4px; .detail { margin-top: 1px; @@ -71,9 +71,12 @@ tooltip { .bar-music { @include segment; - padding: 0px 2px; + padding-left: 3px; + padding-right: 10px; .progress { + margin-right: 5px; + .back { color: $background-scale; } @@ -83,12 +86,6 @@ tooltip { } } - .symbol.stopped { - font-size: 15px; - color: $foreground-alt; - margin-left: -2px; - } - .symbol.paused { font-size: 12px; margin-left: 2px; @@ -99,11 +96,6 @@ tooltip { margin-top: 1px; } - .bar-music-meta { - margin-left: 6px; - margin-right: 10px; - } - .bar-artist { margin-top: 1px; margin-bottom: -2px; @@ -200,12 +192,17 @@ scale trough { .bar-internet { margin-left: 5px; margin-right: 9px; - font-size: 15px; + font-family: "JetBrains Mono"; color: #bb9af7; + font-size: 12px; &.disabled { color: $disabled; } + + .symbol { + font-size: 15px; + } } .bar-bluetooth { @@ -250,19 +247,12 @@ scale trough { } } -.bar-power { - font-size: 18px; - margin-left: 4px; - margin-right: 10px; - color: #f7768e; -} +.bar-idleinhibit { + margin-left: 3px; + margin-right: 4px; + color: $disabled; -.power { - font-size: 36px; - - button > box { - background-color: $background; - border-radius: 8px; - margin: 5px; + &.active { + color: #f7768e; } } diff --git a/home-manager/wayland/eww/eww.yuck b/home-manager/wayland/eww/eww.yuck index b0aee77..ab90e4c 100644 --- a/home-manager/wayland/eww/eww.yuck +++ b/home-manager/wayland/eww/eww.yuck @@ -2,7 +2,7 @@ ;; Window Info (deflisten window :initial "{}" - "scripts/active-window") + "~/.config/eww/scripts/active-window") (defwidget bar_window [class-limit title-limit] (box :class "bar-window" @@ -21,23 +21,23 @@ ;; Workspaces (deflisten workspaces :initial "[]" - "scripts/get-workspaces") + "~/.config/eww/scripts/get-workspaces") (deflisten current_workspace :initial "1" - "scripts/get-active-workspace") + "~/.config/eww/scripts/get-active-workspace") (defwidget bar_workspace_button [workspace] (eventbox :onclick "hyprctl dispatch workspace ${workspace.id}" (overlay - (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 :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 :visible {workspace.id == current_workspace} - {workspace.id})))) + (label :text "${workspace.id}"))))) (defwidget bar_workspaces [] - (eventbox :onscroll "scripts/change-active-workspace {} ${current_workspace}" + (eventbox :onscroll "~/.config/eww/scripts/change-active-workspace {} ${current_workspace}" (box :class "bar-workspaces" :orientation "h" :space-evenly true @@ -64,19 +64,22 @@ ;; Playerctl (deflisten mpris :initial "{}" - "scripts/mpris-metadata") + "~/.config/eww/scripts/mpris-metadata") -(defwidget bar_music [artist-limit title-limit] +(defwidget bar_music [width artist-limit title-limit] (eventbox :onclick "playerctl play-pause" - (box :class "bar-music" + (box :class "bar-music segment" :orientation "h" + :width width :space-evenly false (box :class "progress" (overlay (circular-progress :class "back" :value 100 :width 25 - :thickness 2) + :thickness 2 + :start-at 75 + :clockwise true) (circular-progress :class "front" :value {(mpris.position ?: 0) == 0 || (mpris.duration ?: 0) == 0 ? 0 : @@ -86,36 +89,30 @@ :thickness 2 :start-at 75 :clockwise true) - (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 ?: ""})))))) - + (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 ?: ""}))))) ;; 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 - (eventbox :onclick onclick - (label :class "symbol" - :text symbol)) + (label :class "symbol" + :text symbol) (revealer :transition "slideright" :reveal reveal :duration "400ms" @@ -125,16 +122,15 @@ :min 0 :max 101 :onchange onchange)) - (eventbox :onclick onclick - (label :class "percent" - :width 29 - :xalign 0 - :text "${value}%"))))) + (label :class "percent" + :width 29 + :xalign 0 + :text "${value}%")))) (defvar volume_reveal false) (deflisten volume :initial "0" - "scripts/volume") + "~/.config/eww/scripts/volume") (defwidget bar_volume [] (bar_scale :class "bar-volume ${volume.muted ? "muted" : ""}" @@ -151,7 +147,7 @@ (defvar brightness_reveal false) (deflisten brightness :initial "0" - "scripts/brightness") + "~/.config/eww/scripts/brightness") (defwidget bar_brightness [] (bar_scale :class "bar-brightness" @@ -212,11 +208,11 @@ ;; Network (defpoll wifi :interval "5s" :initial "{}" - "scripts/network 802-11-wireless") + "~/.config/eww/scripts/network 802-11-wireless") (defpoll ethernet :interval "5s" :initial "{}" - "scripts/network 802-3-ethernet") + "~/.config/eww/scripts/network 802-3-ethernet") (defpoll bluetooth :interval "5s" :initial "{}" - "scripts/network bluetooth") + "~/.config/eww/scripts/network bluetooth") (defvar internet_reveal false) @@ -225,66 +221,22 @@ :space-evenly false :tooltip {ethernet != "{}" ? "${ethernet.name} (${ethernet.device})" : wifi != "{}" ? "${wifi.name} (${wifi.device})" : ""} - {wifi != "{}" ? "󰤨" : ethernet != "{}" ? "󰈀" : "󰤮"})) + (label :class "symbol" + :text {wifi != "{}" ? "󰤨" : ethernet != "{}" ? "󰈁" : "󰤮"}))) (defwidget bar_bluetooth [] (box :class "bar-bluetooth ${bluetooth == "{}" ? "disabled" : ""}" - {bluetooth != "{}" ? "󰂯" : "󰂲"})) + (label :text {bluetooth != "{}" ? "󰂯" : "󰂲"}))) -;; Power Menu +;; Idle Inhibitor (defpoll idleinhibit :interval "10s" :initial "0" "pgrep -c -f wayland\"\"-idle-inhibitor || true") -(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 ? "󰈈" : "󰛑"})))))) - +(defwidget bar_idleinhibit [] + (eventbox :onclick "scripts/toggle-idle-inhibit && ${EWW_CMD} poll idleinhibit" + (box :class "bar-idleinhibit ${idleinhibit > 0 ? "active" : ""}" + (label :text {idleinhibit > 0 ? "󰈈" : "󰛑"})))) ;; Separator @@ -292,7 +244,7 @@ (box :class "bar-sep" :hexpand false :vexpand false - "|")) + (label :text "|"))) ;; Bar Layout @@ -323,7 +275,7 @@ :artist-limit 30 :title-limit 25))) -(defwidget fire_bar_right_edge [screen] +(defwidget fire_bar_right_edge [] (box :orientation "h" :space-evenly false :halign "end" @@ -338,9 +290,9 @@ (bar_ram) (bar_battery) (bar_sep) - (bar_power :screen screen))) + (bar_idleinhibit))) -(defwidget fire_bar_layout [screen] +(defwidget fire_bar_layout [] (centerbox :class "bar" :orientation "h" (box :orientation "h" @@ -352,7 +304,7 @@ (box :orientation "h" :space-evenly false (fire_bar_right_wing) - (fire_bar_right_edge :screen screen)))) + (fire_bar_right_edge)))) (defwidget earth_bar_left_edge [] @@ -396,7 +348,7 @@ (bar_sep) (bar_idleinhibit))) -(defwidget earth_bar_layout [screen] +(defwidget earth_bar_layout [] (centerbox :class "bar" :orientation "h" (box :orientation "h" @@ -411,22 +363,24 @@ (earth_bar_right_edge)))) -(defwindow fire_bar [screen] +(defwindow fire_bar + :monitor 0 :geometry (geometry :width "100%" - :height "35px" + :height "3%" :anchor "top center") :namespace "eww-bar" :stacking "fg" :exclusive true :focusable false - (fire_bar_layout :screen screen)) + (fire_bar_layout)) -(defwindow earth_bar [screen] +(defwindow earth_bar + :monitor 0 :geometry (geometry :width "100%" - :height "35px" + :height "3%" :anchor "top center") :namespace "eww-bar" :stacking "fg" :exclusive true :focusable false - (earth_bar_layout :screen screen)) + (earth_bar_layout)) diff --git a/home-manager/wayland/eww/scripts/active-window b/home-manager/wayland/eww/scripts/active-window index 8678080..2124d68 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 | jq -c . +hyprctl activewindow -j | jaq -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 | jq -c . + hyprctl activewindow -j | jaq -c . done diff --git a/home-manager/wayland/eww/scripts/get-active-workspace b/home-manager/wayland/eww/scripts/get-active-workspace index 65245a4..b5d8dd3 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 | jq '.[] | select(.focused) | .activeWorkspace.id' +hyprctl monitors -j | jaq '.[] | 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 3d43617..5957cb2 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 | 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)}]' + 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}]' } workspaces diff --git a/home-manager/wayland/hyprland.nix b/home-manager/wayland/hyprland.nix index 85db0af..80c91d9 100644 --- a/home-manager/wayland/hyprland.nix +++ b/home-manager/wayland/hyprland.nix @@ -93,6 +93,7 @@ in { bind = [ "$mod, Return, exec, $terminal" "$mod, D, exec, $menu" + "$mod Shift, E, exec, ${scripts}/exit" "$mod, M, exec, hyprlock --immediate" # Emacs Everywhere @@ -128,18 +129,33 @@ 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 new file mode 100755 index 0000000..10477b9 --- /dev/null +++ b/home-manager/wayland/scripts/exit @@ -0,0 +1,4 @@ +#!/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 e5ac5fa..d55c3e4 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 | jq -r 'first(.data[][]|select(.category.data=="multimedia")|.id.data|["-r",.])[]') \ + $(makoctl list | jaq -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 dcfbfd0..d5c9540 100644 --- a/home-manager/wayland/wltools.nix +++ b/home-manager/wayland/wltools.nix @@ -9,6 +9,19 @@ 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;