This commit is contained in:
Stephan Raabe
2024-04-20 17:57:31 +02:00
parent be8b15c1a0
commit 1ee73645e1
72 changed files with 347 additions and 772 deletions
+87
View File
@@ -0,0 +1,87 @@
*{
all: unset;
font-family: "Fira Sans";
color: #FFFFFF;
}
.winbox {
background-color: #242424;
opacity: 0.85;
border: 1px solid #FFFFFF;
border-radius: 12px;
}
.res_box {
background-color: #242424;
border-radius: 12px;
padding: 14px 18px 14px 18px;
}
.res_circle {
background-color: #FFFFFF;
border: 0px solid #161616;
color:#FFFFFF;
border-radius: 100%;
padding: 0px;
}
.ml4w_icon {
background-repeat: no-repeat;
background-size: 48px;
min-height: 48px;
min-width: 48px;
}
.res_circle_small {
background-color: #242424;
border: 0px solid #161616;
border-radius: 100%;
padding: 40px;
color:#FFFFFF;
}
.res_text {
border-radius: 16px;
color: #FFFFFF;
font-size : 16px;
padding: 0px 8px 0px 8px;
margin: 0px 0px 0px 0px;
font-weight : bold;
}
.res_cpu {
color: #19cddb;
}
.res_mem {
color: #a5deb7;
}
.res_disk {
color: #cfb3ff;
}
.powericons_logout {
font-size: 32px;
padding-left: 4px;
}
.powericons_shutdown {
font-size: 32px;
padding-right: 9px;
}
.powericons_reboot {
font-size: 32px;
padding-right: 7px;
}
.powericons_lock {
font-size: 32px;
padding-right: 5px;
}
.powericons_suspend {
font-size: 32px;
padding-left: 2px;
}
+168
View File
@@ -0,0 +1,168 @@
;; Variables
;; System vars
(defpoll HOST :interval "5s" `hostname`)
(defpoll CPU_USAGE :interval "1s" `../scripts/sys_info.sh --cpu`)
(defpoll MEM_USAGE :interval "1s" `../scripts/sys_info.sh --mem`)
(defpoll DISK_USAGE :interval "1s" `../scripts/sys_info.sh --disk`)
;; Widgets
;; resources
(defwidget ml4wlauncher []
(box :class "winbox"
(centerbox :orientation "h"
(box :class "ml4w-welcome" :orientation "v" :valign "center" :halign "center" :spacing 15 :space-evenly "false"
(button :style "background-image: url('../../apps/ml4w-welcome.png');" :class "ml4w_icon" :orientation "v" :valign "center" :halign "center" :onclick "../scripts/launch_app.sh --welcome")
(label :class "res_text" :valign "end" :halign "center" :text "Welcome App")
)
(box :class "ml4w-dotfiles" :orientation "v" :valign "center" :halign "center" :spacing 15 :space-evenly "false"
(button :style "background-image: url('../../apps/ml4w-dotfiles-settings.png');" :class "ml4w_icon" :orientation "v" :valign "center" :halign "center" :onclick "../scripts/launch_app.sh --dotfiles")
(label :class "res_text" :valign "end" :halign "center" :text "Dotfiles App")
)
(box :class "ml4w-hyprland" :orientation "v" :valign "center" :halign "center" :spacing 15 :space-evenly "false"
(button :style "background-image: url('../../apps/ml4w-hyprland-settings.png');" :class "ml4w_icon" :orientation "v" :valign "center" :halign "center" :onclick "../scripts/launch_app.sh --hyprland")
(label :class "res_text" :valign "end" :halign "center" :text "Hyprland App")
)
)
)
)
(defwidget resources []
(box :class "winbox"
(centerbox :orientation "h"
(box :class "res_box" :orientation "v" :valign "center" :halign "center" :spacing 15 :space-evenly "false"
(box :class "res_circle" :orientation "v" :valign "center" :halign "center"
(circular-progress :class "res_cpu" :value CPU_USAGE :thickness 15
(label :class "res_circle_small" :text "CPU")
)
)
(label :class "res_text" :valign "end" :halign "center" :text "${CPU_USAGE}%")
)
(box :class "res_box" :orientation "v" :valign "center" :halign "center" :spacing 15 :space-evenly "false"
(box :class "res_circle" :orientation "v" :valign "center" :halign "center"
(circular-progress :class "res_mem" :value MEM_USAGE :thickness 15
(label :class "res_circle_small" :text "MEMORY")
)
)
(label :class "res_text" :valign "end" :halign "center" :text "${MEM_USAGE}%")
)
(box :class "res_box" :orientation "v" :valign "center" :halign "center" :spacing 15 :space-evenly "false"
(box :class "res_circle" :orientation "v" :valign "center" :halign "center"
(circular-progress :class "res_disk" :value DISK_USAGE :thickness 15
(label :class "res_circle_small" :text "DISK")
)
)
(label :class "res_text" :valign "end" :halign "center" :text "${DISK_USAGE}%")
)
)
)
)
;; powermenus
(defwidget logout []
(box :class "winbox"
(button :class "powericons_logout" :valign "center" :halign "center" :onclick "../scripts/system.sh logout &" "")
)
)
(defwidget suspend []
(box :class "winbox"
(button :class "powericons_suspend" :valign "center" :halign "center" :onclick "../scripts/system.sh suspend &" "")
)
)
(defwidget lock []
(box :class "winbox"
(button :class "powericons_lock" :valign "center" :halign "center" :onclick "../scripts/system.sh lock &" "")
)
)
(defwidget reboot []
(box :class "winbox"
(button :class "powericons_reboot" :valign "center" :halign "center" :onclick "../scripts/system.sh reboot &" "")
)
)
(defwidget shutdown []
(box :class "winbox"
(button :class "powericons_shutdown" :valign "center" :halign "center" :onclick "../scripts/system.sh shutdown &" "")
)
)
;; ** Windows *************************************************************************
(defwindow ml4wlauncher
:monitor 0
:geometry (geometry :x "15px"
:y "15px"
:width "480px"
:height "140px"
:anchor "top right")
:stacking "fg"
:wm-ignore false
(ml4wlauncher))
;; resources
(defwindow resources
:monitor 0
:geometry (geometry :x "15px"
:y "170px"
:width "480px"
:height "180px"
:anchor "top right")
:stacking "fg"
:wm-ignore false
(resources))
;; powermenu
(defwindow logout
:monitor 0
:geometry (geometry :x "15px"
:y "365px"
:width "80px"
:height "80px"
:anchor "top right")
:stacking "fg"
:wm-ignore false
(logout))
(defwindow suspend
:monitor 0
:geometry (geometry :x "114px"
:y "365px"
:width "80px"
:height "80px"
:anchor "top right")
:stacking "fg"
:wm-ignore false
(suspend))
(defwindow lock
:monitor 0
:geometry (geometry :x "214px"
:y "365px"
:width "80px"
:height "80px"
:anchor "top right")
:stacking "fg"
:wm-ignore false
(lock))
(defwindow reboot
:monitor 0
:geometry (geometry :x "315px"
:y "365px"
:width "80px"
:height "80px"
:anchor "top right")
:stacking "fg"
:wm-ignore false
(reboot))
(defwindow shutdown
:monitor 0
:geometry (geometry :x "415px"
:y "365px"
:width "80px"
:height "80px"
:anchor "top right")
:stacking "fg"
:wm-ignore false
(shutdown))
+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash
FILE="$HOME/.cache/ml4w_sidebar"
CFG="$HOME/dotfiles/eww/ml4w-sidebar"
EWW=`which eww`
if [[ ! `pidof eww` ]]; then
${EWW} daemon
sleep 0.5
fi
if [[ ! -f "$FILE" ]]; then
touch "$FILE"
${EWW} --config "$CFG" open-many ml4wlauncher resources logout suspend lock reboot shutdown
else
${EWW} --config "$CFG" close resources ml4wlauncher logout suspend lock reboot shutdown
rm "$FILE"
fi