Eww
This commit is contained in:
parent
0dc4c8151c
commit
74635d6ef2
4 changed files with 40 additions and 24 deletions
|
@ -39,7 +39,7 @@ $rosewater: #f5e0dc;
|
|||
}
|
||||
|
||||
.sidestuff slider {
|
||||
color: #ffd5cd;
|
||||
color: $sapphire;
|
||||
}
|
||||
|
||||
.metric {}
|
||||
|
@ -75,10 +75,26 @@ $rosewater: #f5e0dc;
|
|||
|
||||
.vol .muted,
|
||||
.mic .live {
|
||||
color: #f38ba8;
|
||||
color: $red;
|
||||
}
|
||||
|
||||
.vol .live,
|
||||
.mic .muted {
|
||||
color: #74c7ec;
|
||||
color: $sapphire;
|
||||
}
|
||||
|
||||
.workspace {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.workspace.occupied {
|
||||
color: $text;
|
||||
}
|
||||
|
||||
.workspace.occupied.focused,
|
||||
.workspace.focused {
|
||||
color: $base;
|
||||
background-color: $sapphire;
|
||||
}
|
|
@ -31,7 +31,7 @@
|
|||
(bar))
|
||||
|
||||
(defwidget sidestuff []
|
||||
(box :class "sidestuff" :orientation "h" :space-evenly false :halign "start" :valign "center" :spacing 20
|
||||
(box :class "sidestuff" :orientation "h" :space-evenly false :halign "start" :valign "center" :spacing 10
|
||||
time
|
||||
; TODO: indicator/tray/taskbar/toolbar icons and management? (probably should use something standalone?)
|
||||
; https://github.com/elkowar/eww/issues/111
|
||||
|
@ -49,8 +49,8 @@
|
|||
)
|
||||
{" ${round(EWW_CPU["avg"], 0)}%"}
|
||||
{" ${round(EWW_RAM["used_mem_perc"], 0)}%"}
|
||||
{showBrightness == "false" ? "" : (" ${brightness}%")}
|
||||
{showBattery == "false" ? "" : (" ${EWW_BATTERY["BAT1"]["capacity"]}% (${batteryTime})")}
|
||||
{(showBrightness == "true") ? (" ${brightness}%") : ""}
|
||||
{(showBattery == "true") ? (" ${EWW_BATTERY["BAT1"]["capacity"]}% (${batteryTime})") : ""}
|
||||
(box :orientation "h" :space-evenly false :halign "start" :valign "center" (workspaces))
|
||||
))
|
||||
|
||||
|
@ -77,7 +77,7 @@
|
|||
"pamixer --default-source --get-mute; pactl subscribe | grep source --line-buffered | while read i; do pamixer --default-source --get-mute; done")
|
||||
|
||||
(deflisten batteryTime :initial "unknown"
|
||||
"upower -d | rg '\\s*time to empty:\\s*(\\d.*)\$' -r '\$1'")
|
||||
"command -v upower && upower -d | rg '\\s*time to empty:\\s*(\\d.*)\$' -r '\$1'")
|
||||
|
||||
; (deflisten batteryTime :initial "unknown"
|
||||
; "upower -d | rg '\s*time to empty:\s*(\d.*)\$' -r '\$1'; upower --monitor-detail | rg '\s*time to empty:\s*(\d.*)\$' -r '\$1'")
|
||||
|
|
|
@ -5,12 +5,12 @@ ic=(1 2 3 4 5 6 7 8 9)
|
|||
|
||||
#initial check for occupied workspaces
|
||||
for num in $(hyprctl workspaces | grep ID | sed 's/()/(1)/g' | awk 'NR>1{print $1}' RS='(' FS=')'); do
|
||||
export o"$num"="$num"
|
||||
export o"$num"=" occupied"
|
||||
done
|
||||
|
||||
#initial check for focused workspace
|
||||
for num in $(hyprctl monitors | grep active | sed 's/()/(1)/g' | awk 'NR>1{print $1}' RS='(' FS=')'); do
|
||||
export f"$num"="$num"
|
||||
export f"$num"=" focused"
|
||||
export fnum=f"$num"
|
||||
done
|
||||
|
||||
|
@ -19,13 +19,13 @@ workspaces() {
|
|||
# set focused workspace
|
||||
unset -v "$fnum"
|
||||
num=${1:11}
|
||||
export f"$num"="$num"
|
||||
export f"$num"=" focused"
|
||||
export fnum=f"$num"
|
||||
elif [[ ${1:0:15} == "createworkspace" ]]; then
|
||||
# set occupied workspace
|
||||
num=${1:17}
|
||||
export o"$num"="$num"
|
||||
export f"$num"="$num"
|
||||
export o"$num"=" occupied"
|
||||
export f"$num"=" focused"
|
||||
elif [[ ${1:0:16} == "destroyworkspace" ]]; then
|
||||
# unset occupied workspace
|
||||
num=${1:18}
|
||||
|
@ -34,16 +34,16 @@ workspaces() {
|
|||
|
||||
# render eww widget
|
||||
echo "(eventbox :onscroll \"echo {} | sed -e 's/up/-1/g' -e 's/down/+1/g' | xargs hyprctl dispatch workspace\" \
|
||||
(box :class \"works\" :orientation \"h\" :spacing 5 :space-evenly \"true\" \
|
||||
(button :onclick \"hyprctl dispatch workspace 1\" :onrightclick \"hyprctl dispatch workspace 1\" :class \"ws_$o1$f1\" \"${ic[0]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 2\" :onrightclick \"hyprctl dispatch workspace 2\" :class \"ws_$o2$f2\" \"${ic[1]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 3\" :onrightclick \"hyprctl dispatch workspace 3\" :class \"ws_$o3$f3\" \"${ic[2]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 4\" :onrightclick \"hyprctl dispatch workspace 4\" :class \"ws_$o4$f4\" \"${ic[3]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 5\" :onrightclick \"hyprctl dispatch workspace 5\" :class \"ws_$o5$f5\" \"${ic[4]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 6\" :onrightclick \"hyprctl dispatch workspace 6\" :class \"ws_$o6$f6\" \"${ic[5]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 7\" :onrightclick \"hyprctl dispatch workspace 7\" :class \"ws_$o7$f7\" \"${ic[6]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 8\" :onrightclick \"hyprctl dispatch workspace 8\" :class \"ws_$o8$f8\" \"${ic[7]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 9\" :onrightclick \"hyprctl dispatch workspace 9\" :class \"ws_$o9$f9\" \"${ic[8]}\") \
|
||||
(box :class \"workspaces\" :orientation \"h\" :spacing 0 :space-evenly \"true\" \
|
||||
(button :onclick \"hyprctl dispatch workspace 1\" :onrightclick \"hyprctl dispatch workspace 1\" :class \"workspace$o1$f1\" \"${ic[0]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 2\" :onrightclick \"hyprctl dispatch workspace 2\" :class \"workspace$o2$f2\" \"${ic[1]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 3\" :onrightclick \"hyprctl dispatch workspace 3\" :class \"workspace$o3$f3\" \"${ic[2]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 4\" :onrightclick \"hyprctl dispatch workspace 4\" :class \"workspace$o4$f4\" \"${ic[3]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 5\" :onrightclick \"hyprctl dispatch workspace 5\" :class \"workspace$o5$f5\" \"${ic[4]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 6\" :onrightclick \"hyprctl dispatch workspace 6\" :class \"workspace$o6$f6\" \"${ic[5]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 7\" :onrightclick \"hyprctl dispatch workspace 7\" :class \"workspace$o7$f7\" \"${ic[6]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 8\" :onrightclick \"hyprctl dispatch workspace 8\" :class \"workspace$o8$f8\" \"${ic[7]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 9\" :onrightclick \"hyprctl dispatch workspace 9\" :class \"workspace$o9$f9\" \"${ic[8]}\") \
|
||||
) \
|
||||
)"
|
||||
}
|
||||
|
@ -52,6 +52,6 @@ workspaces() {
|
|||
workspaces
|
||||
|
||||
# listen to events and re-render
|
||||
nc -u -l -U /tmp/hypr/"$HYPRLAND_INSTANCE_SIGNATURE"/.socket2.sock - | while read -r event; do
|
||||
socat - UNIX-CONNECT:/tmp/hypr/"${HYPRLAND_INSTANCE_SIGNATURE}"/.socket2.sock | while read -r event; do
|
||||
workspaces "$event"
|
||||
done
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
enable = true;
|
||||
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
|
||||
};
|
||||
environment.systemPackages = with pkgs; [hyprpaper xwaylandvideobridge];
|
||||
environment.systemPackages = with pkgs; [hyprpaper xwaylandvideobridge socat];
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue