Compare commits

...

10 commits

11 changed files with 162 additions and 139 deletions

View file

@ -78,7 +78,7 @@ in
noto-fonts noto-fonts
noto-fonts-cjk-sans noto-fonts-cjk-sans
noto-fonts-color-emoji noto-fonts-color-emoji
source-sans-pro overpass
# Display # Display
quicksand quicksand

View file

@ -25,7 +25,7 @@ in {
in [ in [
# Shell # Shell
socat socat
jaq jq
tldr tldr
ripgrep ripgrep
unzip unzip
@ -65,7 +65,7 @@ in {
services.emacs.enable = true; services.emacs.enable = true;
services.emacs.package = with pkgs; services.emacs.package = with pkgs;
(emacsPackagesFor (pkgs.emacs29.override { withPgtk = true; })) (emacsPackagesFor (pkgs.emacs30.override { withPgtk = true; }))
.emacsWithPackages (epkgs: [ epkgs.vterm ]); .emacsWithPackages (epkgs: [ epkgs.vterm ]);
programs.direnv.enable = true; programs.direnv.enable = true;

View file

@ -9,6 +9,7 @@ $accent: #f6a8cf;
* { * {
all: unset; all: unset;
font-family: "Quicksand Medium";
} }
@mixin segment { @mixin segment {
@ -19,18 +20,17 @@ $accent: #f6a8cf;
.bar { .bar {
background-color: $background; background-color: $background;
font-family: "Quicksand Medium";
color: $foreground; color: $foreground;
font-size: 13px; font-size: 13px;
padding: 3px 10px; padding: 3px 0px;
} }
tooltip { tooltip {
background-color: rgba(0,0,0,0.8); background-color: rgba(22, 16, 30, 0.9);
font-family: "JetBrains Mono"; border-radius: 5px;
font-size: 12px; font-size: 13px;
} }
.detail { .detail {
@ -45,7 +45,7 @@ tooltip {
} }
.bar-window { .bar-window {
margin-left: 4px; margin-left: 14px;
.detail { .detail {
margin-top: 1px; margin-top: 1px;
@ -71,12 +71,9 @@ tooltip {
.bar-music { .bar-music {
@include segment; @include segment;
padding-left: 3px; padding: 0px 2px;
padding-right: 10px;
.progress { .progress {
margin-right: 5px;
.back { .back {
color: $background-scale; color: $background-scale;
} }
@ -86,6 +83,12 @@ tooltip {
} }
} }
.symbol.stopped {
font-size: 15px;
color: $foreground-alt;
margin-left: -2px;
}
.symbol.paused { .symbol.paused {
font-size: 12px; font-size: 12px;
margin-left: 2px; margin-left: 2px;
@ -96,6 +99,11 @@ tooltip {
margin-top: 1px; margin-top: 1px;
} }
.bar-music-meta {
margin-left: 6px;
margin-right: 10px;
}
.bar-artist { .bar-artist {
margin-top: 1px; margin-top: 1px;
margin-bottom: -2px; margin-bottom: -2px;
@ -192,17 +200,12 @@ scale trough {
.bar-internet { .bar-internet {
margin-left: 5px; margin-left: 5px;
margin-right: 9px; margin-right: 9px;
font-family: "JetBrains Mono"; font-size: 15px;
color: #bb9af7; color: #bb9af7;
font-size: 12px;
&.disabled { &.disabled {
color: $disabled; color: $disabled;
} }
.symbol {
font-size: 15px;
}
} }
.bar-bluetooth { .bar-bluetooth {
@ -247,12 +250,19 @@ scale trough {
} }
} }
.bar-idleinhibit { .bar-power {
margin-left: 3px; font-size: 18px;
margin-right: 4px; margin-left: 4px;
color: $disabled; margin-right: 10px;
color: #f7768e;
}
&.active { .power {
color: #f7768e; font-size: 36px;
button > box {
background-color: $background;
border-radius: 8px;
margin: 5px;
} }
} }

View file

@ -2,7 +2,7 @@
;; Window Info ;; Window Info
(deflisten window :initial "{}" (deflisten window :initial "{}"
"~/.config/eww/scripts/active-window") "scripts/active-window")
(defwidget bar_window [class-limit title-limit] (defwidget bar_window [class-limit title-limit]
(box :class "bar-window" (box :class "bar-window"
@ -21,23 +21,23 @@
;; Workspaces ;; Workspaces
(deflisten workspaces :initial "[]" (deflisten workspaces :initial "[]"
"~/.config/eww/scripts/get-workspaces") "scripts/get-workspaces")
(deflisten current_workspace :initial "1" (deflisten current_workspace :initial "1"
"~/.config/eww/scripts/get-active-workspace") "scripts/get-active-workspace")
(defwidget bar_workspace_button [workspace] (defwidget bar_workspace_button [workspace]
(eventbox :onclick "hyprctl dispatch workspace ${workspace.id}" (eventbox :onclick "hyprctl dispatch workspace ${workspace.id}"
(overlay (overlay
(box :class "segment workspace-button ${workspace.id == current_workspace ? "current" : "" (box :class "workspace-button ${workspace.id == current_workspace ? "current" : ""
} ${workspace.windows > 0 ? "occupied" : "empty" } ${workspace.windows > 0 ? "occupied" : ""
} ${workspace.previous > 0 ? "previous-occupied" : "previous-empty" } ${workspace.previous > 0 ? "previous-occupied" : ""
} ${workspace.next > 0 ? "next-occupied" : "next-empty"}" } ${workspace.next > 0 ? "next-occupied" : ""}"
(label :text "${workspace.id}")) {workspace.id})
(box :visible {workspace.id == current_workspace} (box :visible {workspace.id == current_workspace}
(label :text "${workspace.id}"))))) {workspace.id}))))
(defwidget bar_workspaces [] (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" (box :class "bar-workspaces"
:orientation "h" :orientation "h"
:space-evenly true :space-evenly true
@ -64,22 +64,19 @@
;; Playerctl ;; Playerctl
(deflisten mpris :initial "{}" (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" (eventbox :onclick "playerctl play-pause"
(box :class "bar-music segment" (box :class "bar-music"
:orientation "h" :orientation "h"
:width width
:space-evenly false :space-evenly false
(box :class "progress" (box :class "progress"
(overlay (overlay
(circular-progress :class "back" (circular-progress :class "back"
:value 100 :value 100
:width 25 :width 25
:thickness 2 :thickness 2)
:start-at 75
:clockwise true)
(circular-progress :class "front" (circular-progress :class "front"
:value {(mpris.position ?: 0) == 0 || :value {(mpris.position ?: 0) == 0 ||
(mpris.duration ?: 0) == 0 ? 0 : (mpris.duration ?: 0) == 0 ? 0 :
@ -89,30 +86,36 @@
:thickness 2 :thickness 2
:start-at 75 :start-at 75
:clockwise true) :clockwise true)
(label :class "symbol ${mpris.status == "Playing" ? "playing" : "paused"}" (label :class "symbol ${(mpris.title ?: "") == "" || (mpris.status ?: "Stopped") == "Stopped" ? "stopped" :
:text {mpris.status == "Playing" ? "󰏤" : ""}))) mpris.status == "Playing" ? "playing" : "paused"}"
(box :orientation "v" :text {(mpris.title ?: "") == "" || (mpris.status ?: "Stopped") == "Stopped" ? "" :
:space-evenly false mpris.status == "Playing" ? "󰏤" : ""})))
:visible {(mpris.title ?: "") != "" && (mpris.status ?: "Stopped") != "Stopped"} (revealer :transition "slideright"
(label :class "bar-artist detail" :duration "800ms"
:halign "start" :reveal {(mpris.title ?: "") != "" && (mpris.status ?: "Stopped") != "Stopped"}
:limit-width artist-limit (box :orientation "v"
:text {mpris.artist ?: ""}) :class "bar-music-meta"
(label :halign "bar-title" :space-evenly false
:limit-width title-limit (label :class "bar-artist detail"
:text {mpris.title ?: ""}))))) :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) ;; Scales (Volume + Brightness)
(defwidget bar_scale [?class reveal-name reveal value symbol onchange ?onclick] (defwidget bar_scale [?class reveal-name reveal value symbol onchange ?onclick]
(eventbox :onhover "${EWW_CMD} update ${reveal-name}=true" (eventbox :onhover "${EWW_CMD} update ${reveal-name}=true"
:onhoverlost "${EWW_CMD} update ${reveal-name}=false" :onhoverlost "${EWW_CMD} update ${reveal-name}=false"
:onclick onclick
(box :class "bar-scale ${class}" (box :class "bar-scale ${class}"
:space-evenly false :space-evenly false
(label :class "symbol" (eventbox :onclick onclick
:text symbol) (label :class "symbol"
:text symbol))
(revealer :transition "slideright" (revealer :transition "slideright"
:reveal reveal :reveal reveal
:duration "400ms" :duration "400ms"
@ -122,15 +125,16 @@
:min 0 :min 0
:max 101 :max 101
:onchange onchange)) :onchange onchange))
(label :class "percent" (eventbox :onclick onclick
:width 29 (label :class "percent"
:xalign 0 :width 29
:text "${value}%")))) :xalign 0
:text "${value}%")))))
(defvar volume_reveal false) (defvar volume_reveal false)
(deflisten volume :initial "0" (deflisten volume :initial "0"
"~/.config/eww/scripts/volume") "scripts/volume")
(defwidget bar_volume [] (defwidget bar_volume []
(bar_scale :class "bar-volume ${volume.muted ? "muted" : ""}" (bar_scale :class "bar-volume ${volume.muted ? "muted" : ""}"
@ -147,7 +151,7 @@
(defvar brightness_reveal false) (defvar brightness_reveal false)
(deflisten brightness :initial "0" (deflisten brightness :initial "0"
"~/.config/eww/scripts/brightness") "scripts/brightness")
(defwidget bar_brightness [] (defwidget bar_brightness []
(bar_scale :class "bar-brightness" (bar_scale :class "bar-brightness"
@ -208,11 +212,11 @@
;; Network ;; Network
(defpoll wifi :interval "5s" :initial "{}" (defpoll wifi :interval "5s" :initial "{}"
"~/.config/eww/scripts/network 802-11-wireless") "scripts/network 802-11-wireless")
(defpoll ethernet :interval "5s" :initial "{}" (defpoll ethernet :interval "5s" :initial "{}"
"~/.config/eww/scripts/network 802-3-ethernet") "scripts/network 802-3-ethernet")
(defpoll bluetooth :interval "5s" :initial "{}" (defpoll bluetooth :interval "5s" :initial "{}"
"~/.config/eww/scripts/network bluetooth") "scripts/network bluetooth")
(defvar internet_reveal false) (defvar internet_reveal false)
@ -221,22 +225,66 @@
:space-evenly false :space-evenly false
:tooltip {ethernet != "{}" ? "${ethernet.name} (${ethernet.device})" : :tooltip {ethernet != "{}" ? "${ethernet.name} (${ethernet.device})" :
wifi != "{}" ? "${wifi.name} (${wifi.device})" : ""} wifi != "{}" ? "${wifi.name} (${wifi.device})" : ""}
(label :class "symbol" {wifi != "{}" ? "󰤨" : ethernet != "{}" ? "󰈀" : "󰤮"}))
:text {wifi != "{}" ? "󰤨" : ethernet != "{}" ? "󰈁" : "󰤮"})))
(defwidget bar_bluetooth [] (defwidget bar_bluetooth []
(box :class "bar-bluetooth ${bluetooth == "{}" ? "disabled" : ""}" (box :class "bar-bluetooth ${bluetooth == "{}" ? "disabled" : ""}"
(label :text {bluetooth != "{}" ? "󰂯" : "󰂲"}))) {bluetooth != "{}" ? "󰂯" : "󰂲"}))
;; Idle Inhibitor ;; Power Menu
(defpoll idleinhibit :interval "10s" :initial "0" (defpoll idleinhibit :interval "10s" :initial "0"
"pgrep -c -f wayland\"\"-idle-inhibitor || true") "pgrep -c -f wayland\"\"-idle-inhibitor || true")
(defwidget bar_idleinhibit [] (defwidget bar_power [screen]
(eventbox :onclick "scripts/toggle-idle-inhibit && ${EWW_CMD} poll idleinhibit" (eventbox :onclick "${EWW_CMD} active-windows | grep -q power_${screen} \
(box :class "bar-idleinhibit ${idleinhibit > 0 ? "active" : ""}" && ${EWW_CMD} close power_${screen} || ${EWW_CMD} open power --id power_${screen} --screen ${screen}"
(label :text {idleinhibit > 0 ? "󰈈" : "󰛑"})))) (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 ;; Separator
@ -244,7 +292,7 @@
(box :class "bar-sep" (box :class "bar-sep"
:hexpand false :hexpand false
:vexpand false :vexpand false
(label :text "|"))) "|"))
;; Bar Layout ;; Bar Layout
@ -275,7 +323,7 @@
:artist-limit 30 :artist-limit 30
:title-limit 25))) :title-limit 25)))
(defwidget fire_bar_right_edge [] (defwidget fire_bar_right_edge [screen]
(box :orientation "h" (box :orientation "h"
:space-evenly false :space-evenly false
:halign "end" :halign "end"
@ -290,9 +338,9 @@
(bar_ram) (bar_ram)
(bar_battery) (bar_battery)
(bar_sep) (bar_sep)
(bar_idleinhibit))) (bar_power :screen screen)))
(defwidget fire_bar_layout [] (defwidget fire_bar_layout [screen]
(centerbox :class "bar" (centerbox :class "bar"
:orientation "h" :orientation "h"
(box :orientation "h" (box :orientation "h"
@ -304,7 +352,7 @@
(box :orientation "h" (box :orientation "h"
:space-evenly false :space-evenly false
(fire_bar_right_wing) (fire_bar_right_wing)
(fire_bar_right_edge)))) (fire_bar_right_edge :screen screen))))
(defwidget earth_bar_left_edge [] (defwidget earth_bar_left_edge []
@ -348,7 +396,7 @@
(bar_sep) (bar_sep)
(bar_idleinhibit))) (bar_idleinhibit)))
(defwidget earth_bar_layout [] (defwidget earth_bar_layout [screen]
(centerbox :class "bar" (centerbox :class "bar"
:orientation "h" :orientation "h"
(box :orientation "h" (box :orientation "h"
@ -363,24 +411,22 @@
(earth_bar_right_edge)))) (earth_bar_right_edge))))
(defwindow fire_bar (defwindow fire_bar [screen]
:monitor 0
:geometry (geometry :width "100%" :geometry (geometry :width "100%"
:height "3%" :height "35px"
:anchor "top center") :anchor "top center")
:namespace "eww-bar" :namespace "eww-bar"
:stacking "fg" :stacking "fg"
:exclusive true :exclusive true
:focusable false :focusable false
(fire_bar_layout)) (fire_bar_layout :screen screen))
(defwindow earth_bar (defwindow earth_bar [screen]
:monitor 0
:geometry (geometry :width "100%" :geometry (geometry :width "100%"
:height "3%" :height "35px"
:anchor "top center") :anchor "top center")
:namespace "eww-bar" :namespace "eww-bar"
:stacking "fg" :stacking "fg"
:exclusive true :exclusive true
:focusable false :focusable false
(earth_bar_layout)) (earth_bar_layout :screen screen))

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/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 - | socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - |
stdbuf -o0 grep -ose '^activewindow>>' | while read -r line; do stdbuf -o0 grep -ose '^activewindow>>' | while read -r line; do
hyprctl activewindow -j | jaq -c . hyprctl activewindow -j | jq -c .
done done

View file

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/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 - | 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}' stdbuf -o0 awk -F '>>|,' -e '/^workspace>>/ {print $2}' -e '/^focusedmon>>/ {print $3}'

View file

@ -1,9 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
workspaces() { workspaces() {
hyprctl workspaces -j | jaq -c 'map({key: .id | tostring, value: .windows}) | from_entries hyprctl workspaces -j | jq -c 'map({key: .id | tostring, value: .windows}) | from_entries
| . as $windows | [range(1;11) | {id: tostring, windows: $windows[tostring] // 0, | . as $windows | [range(1;11) | {id: tostring, windows: ($windows[tostring] // 0),
previous: $windows[.-1|tostring] // 0, next: $windows[.+1|tostring] // 0}]' previous: ($windows[.-1|tostring] // 0), next: ($windows[.+1|tostring] // 0)}]'
} }
workspaces workspaces

View file

@ -93,7 +93,6 @@ in {
bind = [ bind = [
"$mod, Return, exec, $terminal" "$mod, Return, exec, $terminal"
"$mod, D, exec, $menu" "$mod, D, exec, $menu"
"$mod Shift, E, exec, ${scripts}/exit"
"$mod, M, exec, hyprlock --immediate" "$mod, M, exec, hyprlock --immediate"
# Emacs Everywhere # Emacs Everywhere
@ -129,33 +128,18 @@ in {
"$mod, E, hy3:changegroup, opposite" "$mod, E, hy3:changegroup, opposite"
"$mod, A, hy3:changefocus, raise" "$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 # Screenshot
"$mod, P, exec, ${scripts}/screenshot-save" "$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 = [ bindn = [
", mouse:272, hy3:focustab, mouse" ", mouse:272, hy3:focustab, mouse"

View file

@ -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"

View file

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
notify-send "$1" "$2" -c multimedia -a "$3" \ 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" -h "INT:value:$4"

View file

@ -9,19 +9,6 @@
imv 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 # Hyprlock
programs.hyprlock.enable = true; programs.hyprlock.enable = true;