eww add seperators & layouts

This commit is contained in:
2025-05-03 14:14:25 +02:00
parent 3704615cd4
commit bf3abbbeae
4 changed files with 110 additions and 48 deletions

View File

@@ -72,7 +72,7 @@
(defpoll date
:interval "1s"
:initial "-"
`date '+ %a %d.%m.%y %H:%M'`)
`date '+ %a %d.%m.%y %H:%M'`)
(defvar ws1 "ws-empty")
(defvar ws2 "ws-empty")
@@ -84,6 +84,8 @@
(defvar ws8 "ws-empty")
(defvar ws9 "ws-empty")
(defvar layouts "")
;; /-- Blocks -->
(defwidget widgetWorkspaces []
(box
@@ -149,53 +151,108 @@
:onclick "wmctrl -s 8"
:class "workspace-button ${ws9}"
(label
:text "9"))
(label
:text " ")))
:text "9"))))
(defwidget widgetWindows []
(label
:text "| ${windows}"))
:text "${windows}"))
(defwidget widgetMic []
(defwidget widgetLayouts []
(label
:class micClass
:text "${micIcon} "))
:text "${layouts}"))
(defwidget widgetLogSeperator []
(label
:class "text separator"
:text "⦁"))
(defwidget widgetSpeaker []
(label
:class speakerClass
:text "${speakerIcon} ${speakerVolume}% "))
(box
:space-evenly false
(label
:class speakerClass
:text "${speakerIcon} ")
(label
:class "text"
:text "${speakerVolume}% ")
(label
:class micClass
:text "${micIcon}")))
(defwidget widgetBacklight []
(label
:class "backlight"
:text " ${backlight}% "))
(box
:space-evenly false
(label
:class "backlight"
:text " ")
(label
:class "text"
:text "${backlight}%")))
(defwidget widgetCpu []
(label
:class "cpu"
:text " ${cpu}% "))
(box
:space-evenly false
(label
:class "cpu"
:text " ")
(label
:class "text"
:text "${cpu}%")))
(defwidget widgetMemory []
(label
:class "memory"
:text " ${memory}% "))
(box
:space-evenly false
(label
:class "memory"
:text " ")
(label
:class "text"
:text "${memory}%")))
(defwidget widgetBattery []
(label
:class batteryClass
:text "${batteryIcon} ${batteryVolume}% "))
(box
:space-evenly false
(label
:class batteryClass
:text "${batteryIcon} ")
(label
:class "text"
:text "${batteryVolume}%")))
(defwidget widgetNetworkDown []
(label
:class "networkDown"
:text " ${networkDown}KiB "))
(box
:space-evenly false
(label
:class "networkDown"
:text " ")
(label
:class "text"
:text "${networkDown}")))
(defwidget widgetNetworkUp []
(box
:space-evenly false
(label
:class "networkUp"
:text " ")
(label
:class "text"
:text "${networkUp}")))
(defwidget widgetTime []
(box
:space-evenly false
(label
:class "time"
:text " ")
(label
:class "text"
:text "${date}")))
(defwidget widgetSeperator []
(label
:class "networkUp"
:text " ${networkUp}KiB "))
:class "text separator"
:text "|"))
;; /-- Bar -->
(defwindow bar []
@@ -215,16 +272,25 @@
:space-evenly false
:class "bar"
(widgetWorkspaces)
(widgetLogSeperator)
(widgetLayouts)
(widgetLogSeperator)
(widgetWindows)
(box :hexpand true)
(widgetMic)
(widgetSpeaker)
(widgetSeperator)
(widgetBacklight)
(widgetSeperator)
(widgetCpu)
(widgetSeperator)
(widgetMemory)
(widgetSeperator)
(widgetBattery)
(widgetSeperator)
(widgetNetworkDown)
(widgetSeperator)
(widgetNetworkUp)
(label :text date)
(widgetSeperator)
(widgetTime)
)
)

View File

@@ -9,8 +9,11 @@
$violet: #cba6f7;
$blue: #89b4fa;
$gold: #fab387;
$orange: #fab387;
// <-- Prepare all -->
* { all: unset; }
* {all: unset;}
.text {color: $white-text;}
.separator {padding: 0px 4px;}
// <-- Bar -->
// <-- Widgets -->
// <-- Audio -->
@@ -32,21 +35,12 @@
// <-- Network -->
.networkUp {color: $blue;}
// <-- Workspaces -->
.workspace-button {
background: $grey-background;
}
.ws-current {
color: $green;
}
.ws-visible {
color: $red;
}
.ws-hidden {
color: $white-text;
}
.ws-empty {
color: $grey-text;
}
.workspace-button {background: $grey-background;}
.ws-current {color: $green;}
.ws-visible {color: $red;}
.ws-hidden {color: $white-text;}
.ws-empty {color: $grey-text;}
.time {color: $orange;}
// <-- Window -->
.bar {
padding: 0.2em 1em;

View File

@@ -1,5 +1,5 @@
line=$(cat /tmp/xmonad-eww-log)
IFS='|' read -r workspaces windows <<<"$line"
IFS='|' read -r workspaces layouts windows <<<"$line"
# Workspaces
workspaceArray=($workspaces)
i=0
@@ -15,5 +15,7 @@ for ws in "${workspaceArray[@]}"; do
eww update ws$i="ws-empty"
fi
done
# Layouts
eww update layouts="${layouts}"
# Windows
echo "${windows}"

View File

@@ -76,7 +76,7 @@ myXmobarPP =
, ppHiddenNoWindows = id
, ppUrgent = wrap "!" "!"
, ppSep = "|"
, ppOrder = \(ws : _ : _ : wins : _) -> [ws, wins]
, ppOrder = \(ws : layout : _ : wins : _) -> [ws, layout, wins]
, ppExtras = [logTitles formatFocused formatUnfocused]
}
where