Compare commits

..

5 commits

Author SHA1 Message Date
34172f0ecb some eww bar cleanup 2023-10-29 19:20:10 -07:00
083308eb37 fixed battery and volume widgets 2023-10-29 18:27:21 -07:00
09ef4812e5 fixed script shebang 2023-10-29 16:52:44 -07:00
a87fe8b7b8 set offset shadows 2023-10-29 16:23:51 -07:00
be61817345 fixed workspace->monitor binding 2023-10-29 16:23:51 -07:00
7 changed files with 59 additions and 53 deletions

View file

@ -7,6 +7,7 @@ in
home.packages = with pkgs; [ home.packages = with pkgs; [
playerctl playerctl
pw-volume
alsa-utils alsa-utils
socat socat
jq jq

View file

@ -4,11 +4,19 @@
//Global Styles //Global Styles
.bar-main { .bar-main {
color: #b0b4bc; background-color: rgba(30, 30, 30, 0.9);
margin: 15px; color: #FFFFFF;
padding: 10px; border-radius: 10;
margin-bottom: 0px; padding-left: 10px;
padding-bottom: 0px; padding-right: 10px;
// font: 12px;
// color: #b0b4bc;
// margin: 15px;
// padding: 10px;
// margin-bottom: 0px;
// padding-bottom: 0px;
} }
.bar-section { .bar-section {
@ -32,7 +40,7 @@
.regular { .regular {
color: #b0b4bc; color: #b0b4bc;
padding: 5px; padding: 8px;
} }
.active-workspace { .active-workspace {
@ -41,3 +49,11 @@
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
} }
.side-stuff {
background-color: rgba(20, 20, 20, 0.9);
color: #FFFFFF;
border-radius: 10;
padding-left: 10px;
padding-right: 10px;
}

View file

@ -1,45 +1,45 @@
(defwidget bar [] (defwidget bar []
(centerbox :orientation "h" (centerbox :orientation "h"
(workspaces :names active-workspaces :current-idx current-workspace) (workspaces :current-idx current-workspace)
(music) (music)
(info))) (info)))
(deflisten active-workspaces :initial "[]" "bash ./scripts/get-workspaces")
(deflisten current-workspace :initial "1" "bash ./scripts/get-active-workspace") (deflisten current-workspace :initial "1" "bash ./scripts/get-active-workspace")
(defwidget workspaces [names current-idx] (defwidget workspaces [current-idx]
(box (box
:halign "start" :halign "start"
:hexpand false :hexpand false
:class "bar-main"
:space-evenly true :space-evenly true
:spacing "12" :spacing "12"
:css "* {margin-left: 20px; margin-right: 20px;}" :css "* {margin-left: 20px; margin-right: 20px;}"
(box (box
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "1" ? "active-workspace" : "regular"} :class {current-idx == "1" ? "active-workspace" : "regular"}
(label :text {names =~ `"1"` ? "" : ""})) (label :text ""))
(box (box
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "2" ? "active-workspace" : "regular"} :class {current-idx == "2" ? "active-workspace" : "regular"}
(label :text {names =~ `"2"` ? "" : ""})) (label :text ""))
(box (box
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "3" ? "active-workspace" : "regular"} :class {current-idx == "3" ? "active-workspace" : "regular"}
(label :text {names =~ `"3"` ? "" : ""})) (label :text ""))
(box (box
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "4" ? "active-workspace" : "regular"} :class {current-idx == "4" ? "active-workspace" : "regular"}
(label :text {names =~ `"4"` ? "" : ""})) (label :text ""))
(box (box
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "5" ? "active-workspace" : "regular"} :class {current-idx == "5" ? "active-workspace" : "regular"}
(label :text {names =~ `"5"` ? "" : ""})) (label :text ""))
(box (box
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "6" ? "active-workspace" : "regular"} :class {current-idx == "6" ? "active-workspace" : "regular"}
(label :text {names =~ `"6"` ? "" : ""})) (label :text ""))
(box (box
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "7" ? "active-workspace" : "regular"} :class {current-idx == "7" ? "active-workspace" : "regular"}
(label :text {names =~ `"7"` ? "" : ""})) (label :text ""))
(box (box
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "8" ? "active-workspace" : "regular"} :class {current-idx == "8" ? "active-workspace" : "regular"}
(label :text {names =~ `"8"` ? "" : ""})) (label :text ""))
(box (box
:class {replace(captures(names, "\"[0-9]\"")[captures(current-idx, "[0-9]")[0][0]][0], "\"", "") == "9" ? "active-workspace" : "regular"} :class {current-idx == "9" ? "active-workspace" : "regular"}
(label :text {names =~ `"9"` ? "" : ""})))) (label :text ""))))
(defwidget info [] (defwidget info []
(box (box
@ -51,7 +51,7 @@
:space-evenly false :space-evenly false
:spacing "10" :spacing "10"
(_volume :volume volume) (_volume :volume volume)
(_battery :status {EWW_BATTERY.BAT0.status} :battery {EWW_BATTERY.BAT0.capacity})) (_battery :status {EWW_BATTERY == "" ? "" : EWW_BATTERY.BAT0.status} :battery {EWW_BATTERY == "" ? "" : EWW_BATTERY.BAT0.capacity}))
(_network :strength net-strength :name net-name) (_network :strength net-strength :name net-name)
(sep) (sep)
(buttons))) (buttons)))
@ -90,11 +90,11 @@
(defwidget _battery [status battery] (defwidget _battery [status battery]
(box (box
:hexpand false :hexpand false
:class {battery < 20 ? "alert" : "regular"} :class {status == "" ? "regular" : battery < 20 ? "alert" : "regular"}
(revealer-on-hover (revealer-on-hover
:toggle battery-visible :toggle battery-visible
:togglename "battery-visible" :togglename "battery-visible"
(label :text {status == 'Charging' ? "󰂄" : (label :text {status == 'Charging' || status == "" ? "󰚥" :
battery < 20 ? "󰁻" : battery < 20 ? "󰁻" :
battery < 40 ? "󰁽" : battery < 40 ? "󰁽" :
battery < 60 ? "󰁿" : battery < 60 ? "󰁿" :
@ -144,7 +144,7 @@
{music != "" ? "🎵${music}" : ""})) {music != "" ? "🎵${music}" : ""}))
(defpoll volume :interval "1s" (defpoll volume :interval "1s"
"scripts/getvol") "pw-volume status | jq '.percentage'")
(defpoll time :interval "10s" (defpoll time :interval "10s"
"date '+%H:%M %b %d, %Y'") "date '+%H:%M %b %d, %Y'")

View file

@ -1,4 +1,5 @@
#! /bin/bash #!/usr/bin/env bash
#
function clamp { function clamp {
min=$1 min=$1
max=$2 max=$2

View file

@ -1,11 +0,0 @@
#!/bin/bash
spaces (){
WORKSPACE_WINDOWS=$(hyprctl workspaces -j | jq 'map({key: .id | tostring, value: .windows}) | from_entries')
seq 1 10 | jq --argjson windows "${WORKSPACE_WINDOWS}" --slurp -Mc 'map(tostring) | map({id: ., windows: ($windows[.]//0)})'
}
spaces
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
spaces
done

View file

@ -56,8 +56,8 @@ in
general = { general = {
gaps_in = 5; gaps_in = 5;
gaps_out = 10; gaps_out = 8;
border_size = 1.7; border_size = 2.0;
"col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg"; "col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
}; };
@ -75,7 +75,7 @@ in
# https://wiki.hyprland.org/Configuring/Variables/#decoration # https://wiki.hyprland.org/Configuring/Variables/#decoration
decoration = { decoration = {
shadow_offset = "0 5"; shadow_offset = "5 5";
rounding = 5; rounding = 5;
"col.shadow" = "rgba(00000099)"; "col.shadow" = "rgba(00000099)";
}; };

View file

@ -8,17 +8,16 @@ in
{ {
wayland.windowManager.hyprland.settings = { wayland.windowManager.hyprland.settings = {
workspace = if (hostname == "NicksNixDesktop") then [ workspace = if (hostname == "NicksNixDesktop") then [
"1,monitor:DP-4" "1,monitor:DP-3,default:true"
"3,monitor:DP-4" "3,monitor:DP-3"
"5,monitor:DP-4" "5,monitor:DP-3"
"7,monitor:DP-4" "7,monitor:DP-3"
"9,monitor:DP-4" "9,monitor:DP-3"
"2,monitor:DP-2" "2,monitor:DP-2,default:true"
"4,monitor:DP-2" "4,monitor:DP-2"
"6,monitor:DP-2" "6,monitor:DP-2"
"8,monitor:DP-2" "8,monitor:DP-2"
"10,monitor:DP-2"
] else [ ] else [
]; ];