mirror of
https://github.com/kristoferssolo/solorice.git
synced 2026-03-18 08:09:40 +00:00
Fix hyprland
This commit is contained in:
129
config/eww.bak/eww.scss
Normal file
129
config/eww.bak/eww.scss
Normal file
@@ -0,0 +1,129 @@
|
||||
$base: #191724;
|
||||
$surface: #1f1d2e;
|
||||
$overlay: #26233a;
|
||||
$muted: #6e6a86;
|
||||
$subtle: #908caa;
|
||||
$text: #e0def4;
|
||||
$love: #eb6f92;
|
||||
$gold: #f6c177;
|
||||
$rose: #ebbcba;
|
||||
$pine: #31748f;
|
||||
$foam: #9ccfd8;
|
||||
$iris: #c4a7e7;
|
||||
$highlight_low: #21202e;
|
||||
$highlight_med: #403d52;
|
||||
$highlight_high: #524f67;
|
||||
$bg: rgba(25, 23, 37, 0.7);
|
||||
|
||||
* {
|
||||
all: unset; //Unsets everything so you can style everything from scratch
|
||||
font-family: "JetBrainsMono NF";
|
||||
}
|
||||
|
||||
//Global Styles
|
||||
.bar,
|
||||
.bar-1 {
|
||||
background-color: $bg;
|
||||
color: $text;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
// Styles on classes (see eww.yuck for more information)
|
||||
|
||||
.sidestuff slider {
|
||||
all: unset;
|
||||
}
|
||||
|
||||
.metric scale trough highlight {
|
||||
all: unset;
|
||||
background-color: $love;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.metric scale trough {
|
||||
all: unset;
|
||||
background-color: $highlight_med;
|
||||
border-radius: 50px;
|
||||
min-height: 3px;
|
||||
min-width: 50px;
|
||||
margin-left: 1px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
.metric scale trough highlight {
|
||||
all: unset;
|
||||
// background-color: $subtle;
|
||||
background-color: $foam;
|
||||
color: $base;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.metric scale trough {
|
||||
all: unset;
|
||||
background-color: $highlight_med;
|
||||
border-radius: 50px;
|
||||
min-height: 3px;
|
||||
min-width: 50px;
|
||||
margin-left: 1px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
.label-ram {
|
||||
font-size: large;
|
||||
}
|
||||
|
||||
.music {
|
||||
&.playing {
|
||||
color: $pine;
|
||||
}
|
||||
|
||||
&.paused {
|
||||
color: $muted;
|
||||
}
|
||||
}
|
||||
|
||||
.workspaces {
|
||||
.current {
|
||||
color: $pine;
|
||||
}
|
||||
}
|
||||
|
||||
.icon-module {
|
||||
& > &__icon {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.cpu {
|
||||
&.warning {
|
||||
color: $gold;
|
||||
}
|
||||
|
||||
&.danger {
|
||||
color: $love;
|
||||
}
|
||||
}
|
||||
|
||||
.battery {
|
||||
&.warning {
|
||||
color: $gold;
|
||||
}
|
||||
|
||||
&.critical {
|
||||
color: $love;
|
||||
}
|
||||
|
||||
&.Charging {
|
||||
color: $pine;
|
||||
}
|
||||
}
|
||||
|
||||
.network {
|
||||
&.disconnected {
|
||||
color: $love;
|
||||
}
|
||||
}
|
||||
|
||||
.workspaces button:hover {
|
||||
background: $highlight_med;
|
||||
}
|
||||
244
config/eww.bak/eww.yuck
Normal file
244
config/eww.bak/eww.yuck
Normal file
@@ -0,0 +1,244 @@
|
||||
;; Variables
|
||||
(defpoll clock_time :interval "5m" "date +\%I")
|
||||
(defpoll clock_minute :interval "5s" "date +\%M")
|
||||
(defpoll clock_date :interval "10h" "date '+%d/%m'")
|
||||
(defpoll volume_percent :interval "3s" "amixer -D pulse sget Master | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%'")
|
||||
(defpoll mic_percent :interval "3s" "amixer -D pulse sget Capture | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%'")
|
||||
(defpoll brightness_percent :interval "5s" "brightnessctl -m | awk -F, '{print substr($4, 0, length($4)-1)}' | tr -d '%'")
|
||||
;; (defpoll battery :interval "15s" "./scripts/battery --bat")
|
||||
;; (defpoll battery_status :interval "1m" "./scripts/battery --bat-st")
|
||||
;; (defpoll memory :interval "15s" "scripts/memory")
|
||||
;; (defpoll memory_used_mb :interval "2m" "scripts/mem-ad used")
|
||||
;; (defpoll memory_total_mb :interval "2m" "scripts/mem-ad total")
|
||||
;; (defpoll memory_free_mb :interval "2m" "scripts/mem-ad free")
|
||||
(defvar vol_reveal false)
|
||||
(defvar br_reveal false)
|
||||
(defvar music_reveal false)
|
||||
(defvar wifi_rev false)
|
||||
(defvar time_rev false)
|
||||
(deflisten workspace "scripts/workspace")
|
||||
|
||||
(defvar eww "$HOME/.local/bin/eww/eww -c $HOME/.config/eww/bar")
|
||||
|
||||
(defwidget bar []
|
||||
(centerbox :orientation "h"
|
||||
(workspaces)
|
||||
(window)
|
||||
(sidestuff)))
|
||||
|
||||
(defwidget sidestuff []
|
||||
(box
|
||||
:class "sidestuff"
|
||||
:orientation "h"
|
||||
:space-evenly false
|
||||
:halign "end"
|
||||
:spacing 10
|
||||
(music)
|
||||
(metric
|
||||
:label ""
|
||||
:value volume
|
||||
:onchange "pulsemixer --set-volume {}" )
|
||||
;; (metric_extended
|
||||
;; :label ""
|
||||
;; :value brightness
|
||||
;; :onchange "doas brightnessctl set {}" )
|
||||
(cpu)
|
||||
(github)
|
||||
;; (network)
|
||||
(battery)
|
||||
(bright)
|
||||
time
|
||||
date
|
||||
))
|
||||
|
||||
|
||||
(deflisten workspaces :initial "[]" "bash ~/.config/eww/scripts/get-workspaces")
|
||||
(deflisten current_workspace :initial "1" "bash ~/.config/eww/scripts/get-active-workspace")
|
||||
|
||||
(defwidget workspaces []
|
||||
(eventbox :onscroll "bash ~/.config/eww/scripts/change-active-workspace {} ${current_workspace}" :class "workspaces"
|
||||
(box :space-evenly true
|
||||
:halign "start"
|
||||
:space-evenly true
|
||||
:spacing 5
|
||||
(label :text "${workspaces}${current_workspace}" :visible false)
|
||||
(for workspace in workspaces
|
||||
(eventbox :onclick "hyprctl dispatch workspace ${workspace.id}"
|
||||
(box :class "workspace-entry ${workspace.windows > 0 ? "occupied" : "empty"}"
|
||||
(label :text "${workspace.id}" :class "workspace-entry ${workspace.id == current_workspace ? "current" : ""}" )
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deflisten window :initial "..." "bash ~/.config/eww/scripts/get-window-title")
|
||||
(defwidget window []
|
||||
(box :class "window"
|
||||
(label :text "${window}")))
|
||||
|
||||
(defwidget music []
|
||||
(box :class "music ${music_status == "Playing" ? "playing" : "paused"}"
|
||||
:orientation "h"
|
||||
:space-evenly false
|
||||
:halign "center"
|
||||
(button :onclick "sp play" {music != "" ? "${music}" : ""})))
|
||||
|
||||
(defwidget icon-module [icon ?class ?visible]
|
||||
(box :class "${class} icon-module"
|
||||
:orientation "h"
|
||||
:halign "end"
|
||||
:space-evenly false
|
||||
:visible {visible ?: true} ; because the argument is optional
|
||||
(label :class "icon-module__icon" :text "${icon}")
|
||||
(children)))
|
||||
|
||||
(defwidget metric [label value onchange]
|
||||
(box :orientation "h"
|
||||
:class "metric"
|
||||
:space-evenly false
|
||||
(box :class "label" label)
|
||||
(scale :min 0
|
||||
:max 101
|
||||
:active {onchange != ""}
|
||||
:value value
|
||||
:onchange onchange)))
|
||||
|
||||
(defpoll music
|
||||
:interval "1s"
|
||||
"scripts/get-music")
|
||||
|
||||
(defpoll music_status
|
||||
:interval "1s"
|
||||
"sp status")
|
||||
|
||||
(defpoll volume
|
||||
:interval "1s"
|
||||
"scripts/getvol")
|
||||
|
||||
(defwidget metric_extended [label value onchange]
|
||||
(box
|
||||
:orientation "h"
|
||||
:class "metric"
|
||||
:space-evenly false
|
||||
(box
|
||||
:class "label" label)
|
||||
(scale
|
||||
:min 0
|
||||
:max 256
|
||||
:active {onchange != ""}
|
||||
:value value
|
||||
:onchang
|
||||
:onchange onchange)))
|
||||
|
||||
(defpoll brightness
|
||||
:interval "1s"
|
||||
:class "brightness"
|
||||
"brightnessctl get")
|
||||
|
||||
;; "format-icons": ["", "", "", "", "", "", "", "", ""],
|
||||
|
||||
(defwidget battery []
|
||||
(icon-module
|
||||
:icon "${EWW_BATTERY.BAT0.status == "Charging" ? "" :
|
||||
EWW_BATTERY.BAT0.capacity > 90 ? "" :
|
||||
EWW_BATTERY.BAT0.capacity > 70 ? "" :
|
||||
EWW_BATTERY.BAT0.capacity > 40 ? "" :
|
||||
EWW_BATTERY.BAT0.capacity > 20 ? "" :
|
||||
""}"
|
||||
:class "battery ${EWW_BATTERY.BAT0.capacity > 30 ? "good" : EWW_BATTERY.BAT0.capacity > 10 ? "warning" : "critical"} ${EWW_BATTERY.BAT0.status}"
|
||||
(label
|
||||
:text "${EWW_BATTERY.BAT0.capacity}%")))
|
||||
|
||||
|
||||
(defpoll time :interval "1s"
|
||||
"date '+%H:%M:%S'")
|
||||
|
||||
(defpoll date :interval "10s"
|
||||
"date '+%d.%m.%Y'")
|
||||
|
||||
|
||||
(defpoll github_poll
|
||||
:initial ""
|
||||
:interval "1m" "sh ~/.config/eww/scripts/github")
|
||||
(defwidget github []
|
||||
(button
|
||||
:onclick "xdg-open https://github.com/notifications"
|
||||
(box
|
||||
(icon-module
|
||||
:class "github"
|
||||
:icon ""
|
||||
:visible {github_poll != ""})
|
||||
github_poll)))
|
||||
|
||||
|
||||
(defwidget cpu []
|
||||
(icon-module
|
||||
:icon ""
|
||||
:class "cpu ${EWW_CPU.avg > 90 ? "danger" : EWW_CPU.avg > 60 ? "warning" : ""}"
|
||||
(label
|
||||
:text "${round(EWW_CPU.avg, 0)}%")))
|
||||
|
||||
;; (defpoll net_poll
|
||||
;; :initial "..."
|
||||
;; :interval "10s" "sh ~/.config/eww/scripts/get-network")
|
||||
(defwidget network []
|
||||
(icon-module
|
||||
:icon ""
|
||||
:class "network ${EWW_NET.wlan0.NET_DOWN == 0 && EWW_NET.wlan0.NET_UP == 0 ? "disconnected" : ""}"
|
||||
(label
|
||||
:text "${EWW_NET.wlan0.NET_DOWN == 0 && EWW_NET.wlan0.NET_UP == 0 ? "Disconnected ⚠" : ""}")))
|
||||
|
||||
;; "network": {
|
||||
;; "format-wifi": "{essid} ({signalStrength}%) ",
|
||||
;; "format-ethernet": "{ipaddr}/{cidr} ",
|
||||
;; "tooltip-format": "{ifname} via {gwaddr} ",
|
||||
;; "format-linked": "{ifname} (No IP) ",
|
||||
;; "format-disconnected": "",
|
||||
;; "format-alt": "{ifname}: {ipaddr}/{cidr}"
|
||||
;; },
|
||||
|
||||
|
||||
(defwindow bar
|
||||
:monitor 0
|
||||
:exclusive true
|
||||
:geometry (geometry
|
||||
:x "0%"
|
||||
:y "0%"
|
||||
:width "100%"
|
||||
:height "10px"
|
||||
:anchor "top center")
|
||||
:reserve (struts :side "top" :distance "4%")
|
||||
(bar))
|
||||
|
||||
|
||||
(defwindow bar-1
|
||||
:monitor 1
|
||||
:exclusive true
|
||||
:geometry (geometry
|
||||
:x "0%"
|
||||
:y "0%"
|
||||
:width "100%"
|
||||
:height "10px"
|
||||
:anchor "top center")
|
||||
:reserve (struts :side "top" :distance "4%")
|
||||
(bar))
|
||||
|
||||
(defwidget bright []
|
||||
(eventbox :onhover "eww update br_reveal=true" :onhoverlost "eww update br_reveal=false"
|
||||
(box :class "module-2" :space-evenly "false" :orientation "h" :spacing "3"
|
||||
(label
|
||||
:text "${brightness_percent < 30 ? "☼": "☀"}"
|
||||
:class "bright_icon" :tooltip "brightness")
|
||||
(revealer :transition "slideleft"
|
||||
:reveal br_reveal
|
||||
:duration "350ms"
|
||||
(scale :class "brightbar"
|
||||
:value brightness_percent
|
||||
:orientation "h"
|
||||
:tooltip "${brightness_percent}%"
|
||||
:max 100
|
||||
:min 0
|
||||
:onchange "brightnessctl set {}%" )))))
|
||||
21
config/eww.bak/scripts/change-active-workspace
Executable file
21
config/eww.bak/scripts/change-active-workspace
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
function clamp {
|
||||
min=$1
|
||||
max=$2
|
||||
val=$3
|
||||
python -c "print(max($min, min($val, $max)))"
|
||||
}
|
||||
|
||||
direction=$1
|
||||
current=$2
|
||||
if test "$direction" = "down"
|
||||
then
|
||||
target=$(clamp 1 10 $(($current+1)))
|
||||
echo "jumping to $target"
|
||||
hyprctl dispatch workspace $target
|
||||
elif test "$direction" = "up"
|
||||
then
|
||||
target=$(clamp 1 10 $(($current-1)))
|
||||
echo "jumping to $target"
|
||||
hyprctl dispatch workspace $target
|
||||
fi
|
||||
6
config/eww.bak/scripts/get-active-workspace
Executable file
6
config/eww.bak/scripts/get-active-workspace
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
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}'
|
||||
5
config/eww.bak/scripts/get-music
Executable file
5
config/eww.bak/scripts/get-music
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
title="$(sp metadata | rg title| cut -d'|' -f2)"
|
||||
artist="$(sp metadata | rg artist | cut -d'|' -f2)"
|
||||
echo "$artist" - "$title"
|
||||
5
config/eww.bak/scripts/get-network
Executable file
5
config/eww.bak/scripts/get-network
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
line=$(nmcli connection show | rg wlan0)
|
||||
echo $line
|
||||
|
||||
3
config/eww.bak/scripts/get-window-title
Executable file
3
config/eww.bak/scripts/get-window-title
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
hyprctl activewindow -j | jq --raw-output .title
|
||||
socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | stdbuf -o0 awk -F '>>|,' '/^activewindow>>/{print $3}'
|
||||
11
config/eww.bak/scripts/get-workspaces
Executable file
11
config/eww.bak/scripts/get-workspaces
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env 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:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
|
||||
spaces
|
||||
done
|
||||
12
config/eww.bak/scripts/getvol
Executable file
12
config/eww.bak/scripts/getvol
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
if command -v pamixer &>/dev/null; then
|
||||
if [ true == $(pamixer --get-mute) ]; then
|
||||
echo 0
|
||||
exit
|
||||
else
|
||||
pamixer --get-volume
|
||||
fi
|
||||
else
|
||||
amixer -D pulse sget Master | awk -F '[^0-9]+' '/Left:/{print $3}'
|
||||
fi
|
||||
4
config/eww.bak/scripts/github
Executable file
4
config/eww.bak/scripts/github
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
notifications="$(gh api notifications 2> /dev/null | jq '. | length')"
|
||||
[ -z notifications ] && echo "" || echo "$notifications"
|
||||
Reference in New Issue
Block a user