mirror of
https://github.com/kristoferssolo/solorice.git
synced 2026-02-04 06:32:03 +00:00
Use dotter
This commit is contained in:
170
config/eww/eww.scss
Normal file
170
config/eww/eww.scss
Normal file
@@ -0,0 +1,170 @@
|
||||
$bg: #1a1b26;
|
||||
$bg_dark: #16161e;
|
||||
$bg_float: #16161e;
|
||||
$bg_highlight: #292e42;
|
||||
$bg_popup: #16161e;
|
||||
$bg_search: #3d59a1;
|
||||
$bg_sidebar: #16161e;
|
||||
$bg_statusline: #16161e;
|
||||
$bg_visual: #283457;
|
||||
$black: #15161e;
|
||||
$blue: #7aa2f7;
|
||||
$blue0: #3d59a1;
|
||||
$blue1: #2ac3de;
|
||||
$blue2: #0db9d7;
|
||||
$blue5: #89ddff;
|
||||
$blue6: #b4f9f8;
|
||||
$blue7: #394b70;
|
||||
$border: #15161e;
|
||||
$border_highlight: #27a1b9;
|
||||
$comment: #565f89;
|
||||
$cyan: #7dcfff;
|
||||
$dark3: #545c7e;
|
||||
$dark5: #737aa2;
|
||||
$delta_add: #2c5a66;
|
||||
$delta_delete: #713137;
|
||||
$diff_add: #20303b;
|
||||
$diff_change: #1f2231;
|
||||
$diff_delete: #37222c;
|
||||
$diff_text: #394b70;
|
||||
$error: #db4b4b;
|
||||
$fg: #c0caf5;
|
||||
$fg_dark: #a9b1d6;
|
||||
$fg_float: #c0caf5;
|
||||
$fg_gutter: #3b4261;
|
||||
$fg_sidebar: #a9b1d6;
|
||||
$git_add: #449dab;
|
||||
$git_change: #6183bb;
|
||||
$git_delete: #914c54;
|
||||
$git_ignore: #545c7e;
|
||||
$gitSigns_add: #266d6a;
|
||||
$gitSigns_change: #536c9e;
|
||||
$gitSigns_delete: #b2555b;
|
||||
$green: #9ece6a;
|
||||
$green1: #73daca;
|
||||
$green2: #41a6b5;
|
||||
$hint: #1abc9c;
|
||||
$info: #0db9d7;
|
||||
$magenta: #bb9af7;
|
||||
$magenta2: #ff007c;
|
||||
$orange: #ff9e64;
|
||||
$purple: #9d7cd8;
|
||||
$red: #f7768e;
|
||||
$red1: #db4b4b;
|
||||
$teal: #1abc9c;
|
||||
$terminal_black: #414868;
|
||||
$warning: #e0af68;
|
||||
$yellow: #e0af68;
|
||||
|
||||
* {
|
||||
all: unset; //Unsets everything so you can style everything from scratch
|
||||
}
|
||||
|
||||
//Global Styles
|
||||
.bar,
|
||||
.bar-1 {
|
||||
background-color: rgba(22, 22, 30, 0.7);
|
||||
color: $fg;
|
||||
font-family: "JetBrainsMono NF";
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
// Styles on classes (see eww.yuck for more information)
|
||||
|
||||
.sidestuff slider {
|
||||
all: unset;
|
||||
}
|
||||
|
||||
.metric scale trough highlight {
|
||||
all: unset;
|
||||
background-color: $error;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.metric scale trough {
|
||||
all: unset;
|
||||
background-color: $bg_visual;
|
||||
border-radius: 50px;
|
||||
min-height: 3px;
|
||||
min-width: 50px;
|
||||
margin-left: 1px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
.metric scale trough highlight {
|
||||
all: unset;
|
||||
// background-color: $fg_sidebar;
|
||||
background-color: $teal;
|
||||
color: $bg;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.metric scale trough {
|
||||
all: unset;
|
||||
background-color: $bg_visual;
|
||||
border-radius: 50px;
|
||||
min-height: 3px;
|
||||
min-width: 50px;
|
||||
margin-left: 1px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
.label-ram {
|
||||
font-size: large;
|
||||
}
|
||||
|
||||
.music {
|
||||
&.playing {
|
||||
color: $teal;
|
||||
}
|
||||
|
||||
&.paused {
|
||||
color: $terminal_black;
|
||||
}
|
||||
}
|
||||
|
||||
.workspaces {
|
||||
.current {
|
||||
color: $hint;
|
||||
}
|
||||
}
|
||||
|
||||
.icon-module {
|
||||
& > &__icon {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.cpu {
|
||||
&.warning {
|
||||
color: $warning;
|
||||
}
|
||||
|
||||
&.danger {
|
||||
color: $red;
|
||||
}
|
||||
}
|
||||
|
||||
.battery {
|
||||
&.warning {
|
||||
color: $warning;
|
||||
}
|
||||
|
||||
&.critical {
|
||||
color: $red;
|
||||
}
|
||||
|
||||
&.Charging {
|
||||
color: $teal;
|
||||
}
|
||||
}
|
||||
|
||||
.network {
|
||||
&.disconnected {
|
||||
color: $error;
|
||||
}
|
||||
}
|
||||
|
||||
.workspaces button:hover {
|
||||
background: $bg_highlight;
|
||||
}
|
||||
198
config/eww/eww.yuck
Normal file
198
config/eww/eww.yuck
Normal file
@@ -0,0 +1,198 @@
|
||||
(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)
|
||||
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" :spacing 10
|
||||
(label :text "${workspaces}${current_workspace}" :visible false)
|
||||
(for workspace in workspaces
|
||||
(button :onclick "hyprctl dispatch workspace ${workspace.id}"
|
||||
(box :class "workspaces ${workspace.id == current_workspace ? "current" : ""}"
|
||||
(label :text "${workspace.id}")))))))
|
||||
|
||||
|
||||
(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))
|
||||
21
config/eww/scripts/change-active-workspace
Executable file
21
config/eww/scripts/change-active-workspace
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/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
|
||||
8
config/eww/scripts/get-active-workspace
Executable file
8
config/eww/scripts/get-active-workspace
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/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}'
|
||||
|
||||
# socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | stdbuf -o0 awk -F '>>|,' -e '/^workspace>>/ {print $2}' -e '/^focusedmon>>/ {print $3}'
|
||||
5
config/eww/scripts/get-music
Executable file
5
config/eww/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/scripts/get-network
Executable file
5
config/eww/scripts/get-network
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
line=$(nmcli connection show | rg wlan0)
|
||||
echo $line
|
||||
|
||||
2
config/eww/scripts/get-window-title
Executable file
2
config/eww/scripts/get-window-title
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | stdbuf -o0 awk -F '>>|,' '/^activewindow>>/{print $3}'
|
||||
11
config/eww/scripts/get-workspaces
Executable file
11
config/eww/scripts/get-workspaces
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
spaces (){
|
||||
windows=$(hyprctl workspaces -j | jq 'map({id: .id}) | sort_by(.id)')
|
||||
echo $windows
|
||||
}
|
||||
|
||||
spaces
|
||||
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
|
||||
spaces
|
||||
done
|
||||
12
config/eww/scripts/getvol
Executable file
12
config/eww/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/scripts/github
Executable file
4
config/eww/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