update
This commit is contained in:
@@ -55,13 +55,18 @@ button {
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.volume-widget, .brightness-widget {
|
||||
padding: 0 5px;
|
||||
.battery-widget, .volume-widget, .brightness-widget, .caffeine {
|
||||
padding: 0 2px;
|
||||
}
|
||||
|
||||
.volume-widget button:hover, .brightness-widget button:hover {
|
||||
background-color: $surface;
|
||||
.tray-button {
|
||||
padding: 0 8px;
|
||||
border-radius: 6px;
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
|
||||
.tray-button:hover {
|
||||
background-color: $surface;
|
||||
}
|
||||
|
||||
.popup-box {
|
||||
@@ -117,3 +122,37 @@ button {
|
||||
calendar {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.popup-title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: $blue;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.popup-subtitle {
|
||||
font-size: 12px;
|
||||
color: $fg;
|
||||
opacity: 0.8;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.profile-active {
|
||||
background-color: $blue;
|
||||
color: $crust;
|
||||
padding: 8px 12px;
|
||||
border-radius: 6px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.profile-inactive {
|
||||
background-color: $surface;
|
||||
color: $fg;
|
||||
padding: 8px 12px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.profile-inactive:hover {
|
||||
background-color: lighten($surface, 5%);
|
||||
border: 1px solid $blue;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
(defpoll vol_icon :interval "1s" :initial "🔉" "bash ~/.config/eww/scripts/volume.sh icon")
|
||||
(defpoll br :interval "1s" :initial "50" "bash ~/.config/eww/scripts/brightness.sh get")
|
||||
(defpoll br_icon :interval "1s" :initial "☀️" "bash ~/.config/eww/scripts/brightness.sh icon")
|
||||
(defpoll battery :interval "10s" :initial "100" "cat /sys/class/power_supply/BAT*/capacity 2>/dev/null || echo 100")
|
||||
(defpoll battery_status :interval "10s" :initial "Unknown" "cat /sys/class/power_supply/BAT*/status 2>/dev/null || echo Unknown")
|
||||
(defpoll power_profile :interval "5s" :initial "balanced" "bash ~/.config/eww/scripts/power-profile.sh get")
|
||||
(defpoll power_profile_icon :interval "5s" :initial "⚖️" "bash ~/.config/eww/scripts/power-profile.sh icon")
|
||||
|
||||
(deflisten workspaces :initial "[]" "bash ~/.config/eww/scripts/get-workspaces.sh")
|
||||
|
||||
@@ -23,21 +27,35 @@
|
||||
(box :class "volume-widget"
|
||||
(button :onclick "bash ~/.config/eww/scripts/toggle-window.sh volume_popup"
|
||||
:onrightclick "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||
:class "tray-button"
|
||||
"${vol_icon} ${vol}%")))
|
||||
|
||||
(defwidget brightness_widget []
|
||||
(box :class "brightness-widget"
|
||||
(button :onclick "bash ~/.config/eww/scripts/toggle-window.sh brightness_popup"
|
||||
:class "tray-button"
|
||||
"${br_icon} ${br}%")))
|
||||
|
||||
(defwidget caffeine_widget []
|
||||
(box :class "caffeine"
|
||||
(button :onclick "bash ~/.config/eww/scripts/toggle-inhibit.sh"
|
||||
:class {inhibit_status == "on" ? "caffeine-on" : "caffeine-off"}
|
||||
:class "tray-button ${inhibit_status == 'on' ? 'caffeine-on' : 'caffeine-off'}"
|
||||
{inhibit_status == "on" ? "☕" : "🌙"})))
|
||||
|
||||
(defwidget battery_widget []
|
||||
(box :class "battery-widget"
|
||||
(button :onclick "bash ~/.config/eww/scripts/toggle-window.sh power_profile_popup"
|
||||
:tooltip "Battery: ${battery}% (${battery_status})\nPower Profile: ${power_profile}"
|
||||
:class "tray-button"
|
||||
"${battery_status == 'Charging' ? '🔌' :
|
||||
battery >= 80 ? '🔋' :
|
||||
battery >= 50 ? '🔋' :
|
||||
battery >= 20 ? '🪫' :
|
||||
'🪫'} ${battery}% ${power_profile_icon}")))
|
||||
|
||||
(defwidget tray_widget []
|
||||
(box :halign "end" :class "tray-container" :space-evenly false :spacing 10
|
||||
(battery_widget)
|
||||
(brightness_widget)
|
||||
(volume_widget)
|
||||
(caffeine_widget)
|
||||
@@ -85,3 +103,22 @@
|
||||
(label :text br_icon)
|
||||
(scale :class "br-bar" :min 0 :max 101 :value {br == "" ? 0 : br} :width 150 :onchange "brightnessctl s {}%")
|
||||
(label :text "${br}%")))
|
||||
|
||||
(defwindow power_profile_popup
|
||||
:monitor "eDP-1"
|
||||
:geometry (geometry :x "15px" :y "15px" :width "300px" :height "180px" :anchor "top right")
|
||||
:stacking "fg"
|
||||
:focusable false
|
||||
(box :class "popup-box" :orientation "v" :space-evenly false :spacing 10
|
||||
(label :class "popup-title" :text "Power Profile")
|
||||
(box :orientation "v" :spacing 8
|
||||
(button :class {power_profile == "power-saver" ? "profile-active" : "profile-inactive"}
|
||||
:onclick "bash ~/.config/eww/scripts/power-profile.sh set power-saver && bash ~/.config/eww/scripts/toggle-window.sh power_profile_popup"
|
||||
"🐢 Power Saver")
|
||||
(button :class {power_profile == "balanced" ? "profile-active" : "profile-inactive"}
|
||||
:onclick "bash ~/.config/eww/scripts/power-profile.sh set balanced && bash ~/.config/eww/scripts/toggle-window.sh power_profile_popup"
|
||||
"⚖️ Balanced")
|
||||
(button :class {power_profile == "performance" ? "profile-active" : "profile-inactive"}
|
||||
:onclick "bash ~/.config/eww/scripts/power-profile.sh set performance && bash ~/.config/eww/scripts/toggle-window.sh power_profile_popup"
|
||||
"🚀 Performance"))
|
||||
(label :class "popup-subtitle" :text "Current: ${power_profile}")))
|
||||
|
||||
Reference in New Issue
Block a user