switching to yadm

This commit is contained in:
2025-03-08 08:03:49 +01:00
commit 2b7f7ed8be
56 changed files with 5000 additions and 0 deletions

1
.config/eww/eww.scss Normal file
View File

@@ -0,0 +1 @@
@import 'topbar_dp2.scss';

1
.config/eww/eww.yuck Normal file
View File

@@ -0,0 +1 @@
(include "./topbar_dp2.yuck")

12
.config/eww/scripts/getvol Executable file
View 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

View File

@@ -0,0 +1,47 @@
@import 'widgets';
* {
all: unset;
}
tooltip {
background: #2E3440;
color: #E5E6E7;
border-radius: 1.5rem 1rem;
border: 1px solid #6F7175;
}
.popup {
background: #2E3440;
color: #E5E6E7;
border: 1px solid #6F7175;
}
.popup menuitem:hover {
background: grey;
}
window {
background: transparent;
color: transparent;
* {
font-family: 'Inconsolata Go Nerd Font';
font-size: 0.85rem;
border-radius: 1.5rem 1rem;
padding: 2px 6px;
}
/* Modules */
.left {
//background: orange;
}
.center {
//background: blue;
}
.right {
//background: yellow;
}
}

View File

@@ -0,0 +1,51 @@
(include "./widgets.yuck")
(defwindow topbar_DP-2
:monitor "DP-2"
:geometry (geometry :x "0%"
:y "0%"
:width "90%"
:height "10px"
:anchor "top center")
:stacking "bg"
:exclusive true
:reserve (struts :side "top" :distance "4%")
:windowtype "dock"
(bar0))
(defwidget bar0 []
(centerbox :orientation "h"
(left)
(center)
(right)))
(defwidget left []
(box :orientation 'h'
:class: 'left'
:space-evenly false
:spacing 5
:halign 'start'
(hypr_workspaces)
(hypr_active_window)))
(defwidget center []
(box :orientation 'h'
:class 'center'
:space-evenly false
:spacing 5
(media)
(sysmon)))
(defwidget right []
(box
:orientation 'h'
:class 'right'
:space-evenly false
:spacing 5
:halign 'end'
(hyprsunset)
(datetime)
(stray)
(volume)
(swaync)))

10
.config/eww/widgets.scss Normal file
View File

@@ -0,0 +1,10 @@
@import 'widgets/media';
@import 'widgets/datetime.scss';
@import 'widgets/systray';
@import 'widgets/hyprsunset';
@import 'widgets/lorem-text';
@import 'widgets/hypr_activewindow.scss';
@import 'widgets/hypr_workspaces.scss';
@import 'widgets/sysmon.scss';
@import 'widgets/swaync.scss';
@import 'widgets/volume.scss';

10
.config/eww/widgets.yuck Normal file
View File

@@ -0,0 +1,10 @@
(include "widgets/media.yuck")
(include "widgets/datetime.yuck")
(include "widgets/systray.yuck")
(include "widgets/hyprsunset.yuck")
(include "widgets/lorem-text.yuck")
(include "widgets/hypr_workspaces.yuck")
(include "widgets/hypr_activewindow.yuck")
(include "widgets/sysmon.yuck")
(include "widgets/swaync.yuck")
(include "widgets/volume.yuck")

View File

@@ -0,0 +1,4 @@
.datetime {
background: #2E3440;
color: #E5E6E7;
}

View File

@@ -0,0 +1,19 @@
(defwidget datetime []
(box
:class "datetime"
:halign "center"
:valign "center"
{ time == ''
? ''
: time
}
)
)
(defvar time-visible false)
(defpoll time
:interval "1s"
:initial "initial-value" ; optional, defaults to poll at startup
:run-while time-visible ; optional, defaults to 'true'
`date +"%H:%M - %a, %d %b"` ; https://www.man7.org/linux/man-pages/man1/date.1.html
)

View File

@@ -0,0 +1,14 @@
.activewindow{
background: lightgreen;
color: black;
&--xwayland{
background: red;
color: black;
}
&--tooltip{
background: darkgrey;
color: white;
}
}

View File

@@ -0,0 +1,34 @@
(deflisten activewindow :initial "..." "RUST_BACKTRACE=1 hyprman -a 2>>/tmp/eww_hyprman_activewindow.log")
(defvar windowIcons
`{
"generic": "",
"spotify": "",
"mpv": "",
"firefox": "",
"chromium": "",
"zen": "",
"Alacritty": "",
"steam": "󰓓",
"discord": "󰙯"
}`)
(defwidget windowIcon []
(image
:limit-width 10
:icon-size: 12
:icon {activewindow.class}))
(defwidget hypr_active_window []
(tooltip
(label :class "activewindow--tooltip" :text {activewindow.title})
(box
:class "activewindow${activewindow.xwayland == true ? '--xwayland' : ''}"
:halign "left"
:valign "center"
:spacing 1
(label
:limit-width 25
:unindent true
:text "${activewindow.class}"))))

View File

@@ -0,0 +1,19 @@
.workspacecontainer{
background: orange;
}
.workspace{
border-radius: 1rem 1rem;
font-family: 'Symbols Nerd Font Mono';
font-size: 16px;
border: 1px solid blue;
color: black;
}
.wsactive{
background: red;
}
.wsinactive{
background: yellow;
}

View File

@@ -0,0 +1,25 @@
(deflisten workspaces :initial "" "hyprman -w 2>>/tmp/eww_hyprman_workspaces.log")
(defvar workspaceIcons '{
"empty": "",
"full": "",
"focused": "󱓻"
}')
(defwidget hypr_workspaces []
(box
:class "workspacecontainer"
:space-evenly false
:spacing 3
(for workspace in workspaces
(eventbox
:width 20
:height 20
:onclick "hyprctl dispatch workspace ${workspace.id}"
:tooltip "${workspace.name}"
:class "workspace ${workspace.active == true ? 'wsactive' : 'wsinactive'}"
(label
:xalign 0
:yalign 0.5
:limit-width 1
:text "${workspace.windows > 0 ? workspaceIcons.full : workspaceIcons.empty}")))))

View File

@@ -0,0 +1,4 @@
.hypr-sunset {
background: #003366;
color: #e5e6e7;
}

View File

@@ -0,0 +1,16 @@
(defvar temperature "3000K")
(defvar display-fix "off")
(defwidget hyprsunset []
(box
:class "hypr-sunset"
:halign "center"
:valign "center"
(eventbox
:cursor "pointer"
:onclick `${display-fix == "off"
? "eww update display-fix=on && nohup hyprsunset -t ${temperature} > /dev/null 2>&1 &"
: "eww update display-fix=off && pkill hyprsunset"}`
`${display-fix == "off" ? "󰛨 Off" : "󱩌 On"}`)))

View File

@@ -0,0 +1,4 @@
.lorem-text {
background: darkgrey;
color: black;
}

View File

@@ -0,0 +1,6 @@
(defwidget loremText [text]
(label
:text text
:class 'lorem-text'
)
)

View File

@@ -0,0 +1,5 @@
(defwidget loremText [text]
(label :text text
:class 'lorem-text')
)

View File

@@ -0,0 +1,34 @@
.music {
background: transparent;
color: transparent;
&--off {
background: transparent;
color: transparent;
}
&--on {
background: #8ce513;
color: #010101;
}
&--spotify {
background: #17d860;
color: #282828;
}
&--firefox {
background: #fd8728;
color: #010101;
}
&--mpv {
background: #420042;
color: white;
}
&--chromium {
background: #1a73e8;
color: white;
}
}

View File

@@ -0,0 +1,35 @@
; icons used can be found on https://www.nerdfonts.com/cheat-sheet
(defvar playerIcons `{
"spotify": "",
"mpv": "",
"firefox": "",
"chromium": ""
}`)
(defvar playerRegex "spotify|firefox|mpv|chromium") ; don't forget to update this with your icons
(defvar separator " | ") ; separator between artist and title
(defvar ellipsisIcon "…") ; your icon to display in case of ellipsis
(defvar ellipsisArtist 20) ; set length for ellipsis on artist
(defvar ellipsisTitle 25) ; set length for ellipsis on title
(defwidget media []
(box
:class "media"
:halign "center"
:valign "center"
:class { playerctl == '' || objectlength(playerctl) == 0
? 'music--off'
: matches(playerctl.player, playerRegex)
? 'music--' + playerctl.player
: 'music--on' }
{ playerctl == '' || objectlength(playerctl) == 0
? ''
: matches(playerctl.player, playerRegex)
? "${playerIcons[playerctl.player]} ${substring(playerctl.artist, 0, ellipsisArtist)}${strlength(playerctl.artist) >= ellipsisArtist ? ellipsisIcon : ''} | ${substring(playerctl.title, 0, ellipsisTitle)}${strlength(playerctl.title) >= ellipsisTitle ? ellipsisIcon : ''}"
: "${playerctl.player} - ${substring(playerctl.artist, 0, ellipsisArtist)}${strlength(playerctl.artist) >= ellipsisArtist ? ellipsisIcon : ''} | ${ substring(playerctl.title, 0, ellipsisTitle)}${strlength(playerctl.title) >= ellipsisTitle ? ellipsisIcon : ''}"
}
)
)
(deflisten playerctl
:initial ""
`playerctl --follow metadata --format '{"player": "{{ playerName }}", "trackid": "{{ mpris:trackid }}", "length": "{{ duration(mpris:length) }}", "artUrl": "{{ mrpis:artUrl }}", "album": "{{ album }}", "albumArtist": "{{ xesam:albumArtist }}", "artist": "{{ artist }}", "autoRating": "{{ xesam:autoRating }}", "discNumber": "{{ xesam:discNumber }}", "title": "{{ title }}", "trackNumber": "{{ xesam:trackNumber }}", "url": "{{ xesam:url }}", "position": "{{ position }}"}'`
)

View File

@@ -0,0 +1,13 @@
.swaync{
background: aqua;
color: black;
&--dnd{
background: rosybrown;
color: black;
}
&--inhib{
background: indianred;
color: black;
}
}

View File

@@ -0,0 +1,19 @@
(deflisten notification :initial '{ "count": 0, "dnd": false, "visible": false, "inhibited": false }' "swaync-client -s")
(defvar swaync_icon_act "󰀠")
(defvar swaync_icon_inh "󰚎")
(defvar swaync_icon_dnd "󰀣")
(defwidget swaync []
(eventbox
:class "swaync${notification.dnd == true ? " swaync--dnd" : ""}${notification.inhibited == true ? " swaync--inhib" : ""}"
:cursor "pointer"
:onclick "swaync-client -t"
:onmiddleclick "swaync-client -d"
:onrightclick "swaync-client -C"
(box
:orientation "horizontal"
:spacing 3
:space-evenly false
(label :text "${notification.dnd == true ? swaync_icon_dnd : notification.inhibited == true ? swaync_icon_inh : swaync_icon_act}")
(label :text "${notification.count}"))))

View File

@@ -0,0 +1,19 @@
.sysmon{
background: darkred;
color: black;
}
.danger{
color: red
}
.ram{
background: tan;
}
.disk{
background: mediumturquoise;
}
.cpu{
background: lightgreen;
}
.net{
background: plum;
}

View File

@@ -0,0 +1,51 @@
(defvar netiface "enp34s0")
(defwidget sysmon []
(box
:class 'sysmon'
:space-evenly false
:spacing 1
(cpu)
(ram)
(disk)
(net)))
(defwidget ram []
(tooltip
:class 'ram ${EWW_RAM.used_mem_perc > 90 ? 'danger' : ''}'
(label :text " ${round(EWW_RAM.free_swap/1000000000, 2)} GB/${round(EWW_RAM.total_swap/1000000000, 2)} GB")
(label :text " ${round(EWW_RAM.used_mem/1000000000, 2)} GB/${round(EWW_RAM.total_mem/1000000000, 2)} GB")))
(defwidget disk []
(tooltip
:class 'disk ${EWW_DISK["/"].used_perc > 90 ? 'danger' : ''}'
(label :text " ${round(EWW_DISK["/"].free/1000000000, 2)} GB /${round(EWW_DISK["/"].total/1000000000, 2)} GB")
(label :text " ${round(EWW_DISK["/"].used_perc,2)}%")))
(defwidget cpu []
(tooltip
:class 'cpu'
(box :orientation "vertical"
(for cpu in {EWW_CPU.cores}
(box
:orientation "horizontal"
:space-evenly false
:spacing 10
(circular-progress
:thickness 5
:start-at 75
:value {cpu.usage})
(label
:limit-width 6
:show-truncated false
:text "${cpu.core}: ")
(label :text "${cpu.freq} Hz ${cpu.usage}%"))))
(label :text " ${round(EWW_CPU.avg, 2)}%")))
(defwidget net []
(box
:class 'net'
:space-evenly false
(label :text "")
(label :text " ${round(EWW_NET.enp34s0.NET_UP * 8 / 1000000, 2)} Mbit")
(label :text " ${round(EWW_NET.enp34s0.NET_DOWN * 8 / 1000000, 2)} Mbit")))

View File

@@ -0,0 +1,5 @@
.systray {
background: #2E3440;
color: #E5E6E7;
}

View File

@@ -0,0 +1,10 @@
(defwidget stray []
(systray
:class "systray"
:halign "center"
:valign "center"
:active true
:icon-size 16
:spacing -5
)
)

View File

@@ -0,0 +1,11 @@
.sourcevol{
background: steelblue;
color: black;
}
.sinkvol{
background: slateblue;
color: black;
}
.muted{
background: tomato;
}

View File

@@ -0,0 +1,17 @@
(defpoll sourcevol :interval "1s" `wpctl get-volume @DEFAULT_SOURCE@ | awk -F ' ' '{print $2}'`)
(defpoll sourcemute :interval "1s" `wpctl get-volume @DEFAULT_SOURCE@ | awk -F ' ' '{print $3}'`)
(defpoll sinkvol :interval "1s" `wpctl get-volume @DEFAULT_SINK@ | awk -F ' ' '{print $2}'`)
(defpoll sinkmute :interval "1s" `wpctl get-volume @DEFAULT_SINK@ | awk -F ' ' '{print $3}'`)
(defwidget volume []
(box
:space-evenly false
:spacing 3
(eventbox
:class "sourcevol${sourcemute == "[MUTED]" ? " muted" : ""}"
:onclick "wpctl set-mute @DEFAULT_SOURCE@ toggle"
(label :text "${sourcemute == "[MUTED]" ? "󰍭" : "󰍬"} ${sourcevol}"))
(eventbox
:class "sinkvol${sinkmute == "[MUTED]" ? " muted" : ""}"
:onclick "wpctl set-mute @DEFAULT_SINK@ toggle"
(label :text "${sinkmute == "[MUTED]" ? "󰟎" : "󰋋"} ${sinkvol}"))))