add eww config (fix broken package structure)
This commit is contained in:
189
eww/.config/eww/eww.scss
Normal file
189
eww/.config/eww/eww.scss
Normal file
@@ -0,0 +1,189 @@
|
||||
|
||||
*{
|
||||
all: unset;
|
||||
}
|
||||
|
||||
window {
|
||||
font-family: "JetBrainsMono Nerd Font", monospace;
|
||||
background-color: #000000;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
/* Global normalization - no widget should add spacing */
|
||||
eventbox, box, label, scale {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
$font-family: "JetBrainsMono Nerd Font", monospace;
|
||||
|
||||
// Global colors (sync with ~/.config/colors)
|
||||
$bg-bar: #000000;
|
||||
$track: #3a3a3a;
|
||||
$accent: #E0AF68;
|
||||
$urgent: #F7768E;
|
||||
$fg: #ffffff;
|
||||
|
||||
// Legacy
|
||||
$background: $bg-bar;
|
||||
$foreground: $fg;
|
||||
|
||||
.workspace-entry {
|
||||
/* Styles for all workspace entries */
|
||||
padding: 0 0.5em;
|
||||
font-family: $font-family;
|
||||
color : $foreground;
|
||||
}
|
||||
|
||||
.workspace-entry.current {
|
||||
/* Styles for the current workspace */
|
||||
color: $accent;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.workspace-entry.urgent {
|
||||
/* Styles for urgent workspaces */
|
||||
color: $urgent;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.time-label {
|
||||
font-family: $font-family;
|
||||
color : $foreground;
|
||||
font-weight: bold;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.notification-eventbox {
|
||||
padding: 0;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.notification-icon {
|
||||
font-family: $font-family;
|
||||
color : $foreground;
|
||||
font-weight: bold;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.battery-percent {
|
||||
font-family: $font-family;
|
||||
color : $foreground;
|
||||
font-weight: bold;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.battery-icon {
|
||||
font-family: $font-family;
|
||||
color : $foreground;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.bar {
|
||||
background-color: $background;
|
||||
}
|
||||
|
||||
.wifi-eventbox {
|
||||
padding: 0;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.wifi-icon{
|
||||
color : $foreground;
|
||||
background-color: $background;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.brightness-icon {
|
||||
color: $foreground;
|
||||
font-weight: bold;
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
.volume-icon {
|
||||
color: $foreground;
|
||||
font-weight: bold;
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
.volume-bar {
|
||||
min-width: 10px;
|
||||
min-height: 6px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
margin-right: 10px;
|
||||
border: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.volume-bar trough {
|
||||
background-color: $track;
|
||||
border-radius: 3px;
|
||||
min-height: 6px;
|
||||
min-width: 10px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.volume-bar highlight {
|
||||
background-color: $fg;
|
||||
border-radius: 3px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.volume-bar slider {
|
||||
all: unset;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.brightness-bar {
|
||||
min-width: 10px;
|
||||
min-height: 6px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
margin-right: 10px;
|
||||
border: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.brightness-bar trough {
|
||||
background-color: $track;
|
||||
border-radius: 3px;
|
||||
min-height: 6px;
|
||||
min-width: 10px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.brightness-bar highlight {
|
||||
background-color: $fg;
|
||||
border-radius: 3px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.brightness-bar slider {
|
||||
all: unset;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
tooltip {
|
||||
background-color: $bg-bar;
|
||||
color: $fg;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: "JetBrainsMono Nerd Font", monospace;
|
||||
}
|
||||
122
eww/.config/eww/eww.yuck
Normal file
122
eww/.config/eww/eww.yuck
Normal file
@@ -0,0 +1,122 @@
|
||||
(deflisten workspaces :initial "[]" "bash ~/.config/eww/scripts/get-workspaces")
|
||||
|
||||
(deflisten current_workspace :initial "1" "bash ~/.config/eww/scripts/get-active-workspace")
|
||||
|
||||
(defwidget workspaces [monitor]
|
||||
(eventbox :onscroll "bash ~/.config/eww/scripts/change-active-workspace {} ${current_workspace}" :class "workspaces-widget"
|
||||
(box :spacing 10 :orientation "h" :halign "start" :space-evenly false
|
||||
(label :text "${workspaces}${current_workspace}" :visible false)
|
||||
(for workspace in workspaces
|
||||
(box
|
||||
:visible {workspace.output == monitor}
|
||||
(eventbox :onclick "swaymsg workspace number ${workspace.id}"
|
||||
(box :class "workspace-entry ${workspace.focused ? 'current' : ''} ${workspace.urgent ? 'urgent' : ''}"
|
||||
(label :text "${workspace.id}"))))))))
|
||||
|
||||
|
||||
(defpoll time :interval "1s"
|
||||
"date '+%H:%M'")
|
||||
|
||||
(defpoll time_tooltip :interval "1s"
|
||||
"date '+%A, %B %d, %Y'")
|
||||
|
||||
|
||||
(defwidget time-widget []
|
||||
(label
|
||||
:text {time}
|
||||
:tooltip time_tooltip
|
||||
:class "time-label"))
|
||||
|
||||
(defwidget notification-widget []
|
||||
(eventbox :class "notification-eventbox" :onclick "bash ~/.config/eww/scripts/notification-history-toggle"
|
||||
:tooltip "Toggle notification history"
|
||||
(label :text "" :class "notification-icon")))
|
||||
|
||||
(deflisten BATPERC :initial "" "bash ~/.config/eww/scripts/battery-perc-monitor")
|
||||
(deflisten BATICON :initial "" "bash ~/.config/eww/scripts/battery-icon-monitor")
|
||||
(deflisten BATTIME :initial "" "bash ~/.config/eww/scripts/battery-time-monitor")
|
||||
|
||||
(defwidget battery-widget []
|
||||
(box :orientation "horizontal" :spacing 0 :tooltip "Time remaining: ${BATTIME}"
|
||||
(label :text {BATICON} :class "battery-icon")
|
||||
(label :text {BATPERC} :class "battery-percent")))
|
||||
|
||||
(defwidget internet []
|
||||
(label :text wifi-icon
|
||||
:tooltip wifi-name
|
||||
:class "wifi-icon"))
|
||||
(deflisten wifi-icon :initial "" "bash ~/.config/eww/scripts/wifi-monitor")
|
||||
(deflisten wifi-name :initial "" "bash ~/.config/eww/scripts/wifi-name-monitor")
|
||||
|
||||
(deflisten brightness :initial "50" "bash ~/.config/eww/scripts/brightness")
|
||||
|
||||
(defwidget brightness-widget []
|
||||
(eventbox :onscroll "[ {} = up ] && brightnessctl set 10%+ || brightnessctl set 10%-"
|
||||
:tooltip "Brightness: ${brightness}%"
|
||||
(box :orientation "h" :spacing 0
|
||||
(label :text "" :class "brightness-icon")
|
||||
(scale :min 0
|
||||
:max 100
|
||||
:value brightness
|
||||
:class "brightness-bar"
|
||||
:onchange "brightnessctl set {}%"))))
|
||||
|
||||
(deflisten volume :initial "50" "bash ~/.config/eww/scripts/volume")
|
||||
(deflisten volume-icon :initial "" "bash ~/.config/eww/scripts/volume-icon-monitor")
|
||||
|
||||
(defwidget volume-widget []
|
||||
(eventbox :onscroll "[ {} = up ] && pactl set-sink-volume @DEFAULT_SINK@ +10% || pactl set-sink-volume @DEFAULT_SINK@ -10%"
|
||||
:tooltip "Volume: ${volume}%"
|
||||
(box :orientation "h" :spacing 0
|
||||
(label :text volume-icon :class "volume-icon")
|
||||
(scale :min 0
|
||||
:max 100
|
||||
:value volume
|
||||
:class "volume-bar"
|
||||
:onchange "pactl set-sink-volume @DEFAULT_SINK@ {}%"))))
|
||||
|
||||
(defwidget system []
|
||||
(box :orientation "h" :halign "end" :spacing 0
|
||||
(internet)
|
||||
(brightness-widget)
|
||||
(volume-widget)
|
||||
(battery-widget)
|
||||
(time-widget)
|
||||
(notification-widget)))
|
||||
|
||||
|
||||
(defwidget bar [monitor]
|
||||
(box :orientation "h" :space-evenly false
|
||||
(workspaces :monitor monitor)
|
||||
(box :hexpand true)
|
||||
(system)))
|
||||
|
||||
(defwindow bar0
|
||||
:monitor 0
|
||||
:geometry (geometry :x "0%"
|
||||
:y "0px"
|
||||
:width "100%"
|
||||
:height "30px"
|
||||
:anchor "top center")
|
||||
:stacking "fg"
|
||||
:exclusive true
|
||||
:reserve (struts :distance "40px" :side "top")
|
||||
:windowtype "dock"
|
||||
:wm-ignore false
|
||||
(bar :monitor "HDMI-A-1"))
|
||||
|
||||
(defwindow bar1
|
||||
:monitor 1
|
||||
:geometry (geometry :x "0%"
|
||||
:y "0px"
|
||||
:width "100%"
|
||||
:height "30px"
|
||||
:anchor "top center")
|
||||
:stacking "fg"
|
||||
:exclusive true
|
||||
:reserve (struts :distance "40px" :side "top")
|
||||
:windowtype "dock"
|
||||
:wm-ignore false
|
||||
(bar :monitor "eDP-1"))
|
||||
|
||||
|
||||
92
eww/.config/eww/eww.yuck.backup
Normal file
92
eww/.config/eww/eww.yuck.backup
Normal file
@@ -0,0 +1,92 @@
|
||||
(deflisten workspaces :initial "[]" "bash ~/.config/eww/scripts/get-workspaces")
|
||||
|
||||
(deflisten current_workspace :initial "1" "bash ~/.config/eww/scripts/get-active-workspace")
|
||||
|
||||
(defwidget workspaces [monitor]
|
||||
(eventbox :onscroll "bash ~/.config/eww/scripts/change-active-workspace {} ${current_workspace}" :class "workspaces-widget"
|
||||
(box :spacing 10 :orientation "h" :halign "start" :space-evenly false
|
||||
(label :text "${workspaces}${current_workspace}" :visible false)
|
||||
(for workspace in workspaces
|
||||
(box
|
||||
:visible {workspace.output == monitor}
|
||||
(eventbox :onclick "swaymsg workspace number ${workspace.id}"
|
||||
(box :class "workspace-entry ${workspace.focused ? 'current' : ''} ${workspace.urgent ? 'urgent' : ''}"
|
||||
(label :text "${workspace.id}"))))))))
|
||||
|
||||
|
||||
(defpoll time :interval "1s"
|
||||
"date '+%H:%M'")
|
||||
|
||||
|
||||
(defwidget time-widget []
|
||||
(label
|
||||
:text {time}
|
||||
:class "time-label"))
|
||||
|
||||
(deflisten BATPERC :initial "" "bash ~/.config/eww/scripts/battery-perc-monitor")
|
||||
(deflisten BATICON :initial "" "bash ~/.config/eww/scripts/battery-icon-monitor")
|
||||
|
||||
(defwidget battery-widget []
|
||||
(box :orientation "horizontal" :spacing 0
|
||||
(label :text {BATICON} :class "battery-icon")
|
||||
(label :text {BATPERC} :class "battery-percent")))
|
||||
|
||||
(defwidget wifi []
|
||||
(label :text wifi-icon
|
||||
:class "wifi-icon"))
|
||||
(deflisten wifi-icon :initial "" "bash ~/.config/eww/scripts/wifi-monitor")
|
||||
(deflisten wifi-name :initial "" "bash ~/.config/eww/scripts/wifi-name-monitor")
|
||||
|
||||
(deflisten brightness :initial "50" "bash ~/.config/eww/scripts/brightness")
|
||||
|
||||
(defwidget brightness-widget []
|
||||
(eventbox :onscroll "[ {} = up ] && brightnessctl set 5%+ || brightnessctl set 5%-"
|
||||
(box :orientation "h" :spacing 0
|
||||
(label :text "" :class "brightness-icon")
|
||||
(scale :min 0
|
||||
:max 100
|
||||
:value brightness
|
||||
:class "brightness-bar"
|
||||
:onchange "brightnessctl set {}%"))))
|
||||
|
||||
(deflisten volume :initial "50" "bash ~/.config/eww/scripts/volume")
|
||||
|
||||
(defwidget volume-widget []
|
||||
(box :orientation "h" :spacing 0
|
||||
(label :text "" :class "volume-icon")
|
||||
(scale :min 0
|
||||
:max 100
|
||||
:value volume
|
||||
:class "volume-bar"
|
||||
:onchange "pactl set-sink-volume @DEFAULT_SINK@ {}%")))
|
||||
|
||||
(defwidget system []
|
||||
(box :orientation "h" :halign "end" :spacing 0
|
||||
(brightness-widget)
|
||||
(volume-widget)
|
||||
(wifi)
|
||||
(battery-widget)
|
||||
(time-widget)))
|
||||
|
||||
|
||||
(defwidget bar [monitor]
|
||||
(box :orientation "h" :space-evenly false
|
||||
(workspaces :monitor monitor)
|
||||
(box :hexpand true)
|
||||
(system)))
|
||||
|
||||
(defwindow bar0
|
||||
:monitor 0
|
||||
:geometry (geometry :x "0%"
|
||||
:y "0px"
|
||||
:width "100%"
|
||||
:height "30px"
|
||||
:anchor "top center")
|
||||
:stacking "fg"
|
||||
:exclusive true
|
||||
:reserve (struts :distance "40px" :side "top")
|
||||
:windowtype "dock"
|
||||
:wm-ignore false
|
||||
(bar :monitor "eDP-1"))
|
||||
|
||||
|
||||
29
eww/.config/eww/scripts/battery
Normal file
29
eww/.config/eww/scripts/battery
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
## Get battery info
|
||||
BATTERY="$(acpi | awk -F ' ' 'NR==1 {print $4; exit}' | tr -d \%,)"
|
||||
CHARGE="$(acpi | awk -F ' ' 'END {print $3}' | tr -d \,)"
|
||||
|
||||
main() {
|
||||
if [[ ($CHARGE = *"Charging"*) && ($BATTERY -lt "100") ]]; then
|
||||
echo ""
|
||||
elif [[ $CHARGE = *"Full"* ]]; then
|
||||
echo ""
|
||||
else
|
||||
if [[ ($BATTERY -lt 100) && (($BATTERY -gt 65) || ($BATTERY -eq 65)) ]]; then
|
||||
echo ""
|
||||
elif [[ ($BATTERY -lt 65) && (($BATTERY -gt 35) || ($BATTERY -eq 35)) ]]; then
|
||||
echo ""
|
||||
elif [[ ($BATTERY -lt 35) && (($BATTERY -gt 10) || ($BATTERY -eq 10)) ]]; then
|
||||
echo ""
|
||||
elif [[ ($BATTERY -lt 10) && (($BATTERY -gt 0) || ($BATTERY -eq 0)) ]]; then
|
||||
echo ""
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ $1 == '--icon' ]]; then
|
||||
main
|
||||
elif [[ $1 == '--perc' ]]; then
|
||||
echo "${BATTERY}%"
|
||||
fi
|
||||
13
eww/.config/eww/scripts/battery-icon-monitor
Normal file
13
eww/.config/eww/scripts/battery-icon-monitor
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
get_icon() {
|
||||
bash ~/.config/eww/scripts/battery --icon
|
||||
}
|
||||
|
||||
# Output initial state
|
||||
get_icon
|
||||
|
||||
# Monitor battery events using upower
|
||||
upower --monitor | while read -r line; do
|
||||
get_icon
|
||||
done
|
||||
13
eww/.config/eww/scripts/battery-perc-monitor
Normal file
13
eww/.config/eww/scripts/battery-perc-monitor
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
get_perc() {
|
||||
bash ~/.config/eww/scripts/battery --perc
|
||||
}
|
||||
|
||||
# Output initial state
|
||||
get_perc
|
||||
|
||||
# Monitor battery events using upower
|
||||
upower --monitor | while read -r line; do
|
||||
get_perc
|
||||
done
|
||||
13
eww/.config/eww/scripts/battery-time-monitor
Normal file
13
eww/.config/eww/scripts/battery-time-monitor
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
get_time() {
|
||||
acpi -b | grep -oP '\d{2}:\d{2}:\d{2}' || echo "Calculating..."
|
||||
}
|
||||
|
||||
# Output initial state
|
||||
get_time
|
||||
|
||||
# Monitor battery events using upower
|
||||
upower --monitor | while read -r line; do
|
||||
get_time
|
||||
done
|
||||
16
eww/.config/eww/scripts/brightness
Normal file
16
eww/.config/eww/scripts/brightness
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get current brightness percentage
|
||||
get_brightness() {
|
||||
local current=$(brightnessctl get)
|
||||
local max=$(brightnessctl max)
|
||||
echo $((current * 100 / max))
|
||||
}
|
||||
|
||||
# Output initial brightness
|
||||
get_brightness
|
||||
|
||||
# Monitor brightness changes
|
||||
inotifywait -m -e modify /sys/class/backlight/*/brightness 2>/dev/null | while read -r; do
|
||||
get_brightness
|
||||
done
|
||||
8
eww/.config/eww/scripts/change-active-workspace
Normal file
8
eww/.config/eww/scripts/change-active-workspace
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
current=$1
|
||||
direction=$2
|
||||
if [ "$direction" = "up" ]; then
|
||||
swaymsg workspace number $((current + 1))
|
||||
elif [ "$direction" = "down" ]; then
|
||||
swaymsg workspace number $((current - 1))
|
||||
fi
|
||||
14
eww/.config/eww/scripts/get-active-workspace
Normal file
14
eww/.config/eww/scripts/get-active-workspace
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Function to get focused workspace
|
||||
get_focused() {
|
||||
swaymsg -t get_workspaces | jq -r '.[] | select(.focused==true) | .num'
|
||||
}
|
||||
|
||||
# Output initial state
|
||||
get_focused
|
||||
|
||||
# Subscribe to workspace events and output updates
|
||||
swaymsg -t subscribe -m '["workspace"]' | while read -r event; do
|
||||
get_focused
|
||||
done
|
||||
14
eww/.config/eww/scripts/get-workspaces
Normal file
14
eww/.config/eww/scripts/get-workspaces
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Function to get and format workspaces
|
||||
get_workspaces() {
|
||||
swaymsg -t get_workspaces | jq -c '[.[] | {id: .num, output: .output, focused: .focused, visible: .visible, urgent: .urgent}]'
|
||||
}
|
||||
|
||||
# Output initial state
|
||||
get_workspaces
|
||||
|
||||
# Subscribe to workspace events and output updates
|
||||
swaymsg -t subscribe -m '["workspace"]' | while read -r event; do
|
||||
get_workspaces
|
||||
done
|
||||
16
eww/.config/eww/scripts/notification-history-toggle
Normal file
16
eww/.config/eww/scripts/notification-history-toggle
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
# Toggle notification history display (mako version)
|
||||
# Shows up to 10 previous notifications, or closes all if any are displayed
|
||||
|
||||
# Check if there are any notifications currently displayed
|
||||
displayed=$(makoctl list 2>/dev/null | grep -c "^Notification" 2>/dev/null)
|
||||
|
||||
if [ "$displayed" -gt 0 ]; then
|
||||
# If notifications are showing, dismiss them all
|
||||
makoctl dismiss -a
|
||||
else
|
||||
# If no notifications are showing, restore up to 10 from history
|
||||
for i in {1..10}; do
|
||||
makoctl restore 2>/dev/null || break
|
||||
done
|
||||
fi
|
||||
6
eww/.config/eww/scripts/popup
Normal file
6
eww/.config/eww/scripts/popup
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
if [ "$1" = "wifi" ]; then
|
||||
alacritty -e nmtui
|
||||
fi
|
||||
14
eww/.config/eww/scripts/volume
Normal file
14
eww/.config/eww/scripts/volume
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get current volume percentage
|
||||
get_volume() {
|
||||
pactl get-sink-volume @DEFAULT_SINK@ | grep -oP '\d+%' | head -1 | tr -d '%'
|
||||
}
|
||||
|
||||
# Output initial volume
|
||||
get_volume
|
||||
|
||||
# Subscribe to volume changes
|
||||
pactl subscribe | grep --line-buffered "sink" | while read -r line; do
|
||||
get_volume
|
||||
done
|
||||
19
eww/.config/eww/scripts/volume-icon-monitor
Executable file
19
eww/.config/eww/scripts/volume-icon-monitor
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get current mute state and return appropriate icon
|
||||
get_volume_icon() {
|
||||
muted=$(pactl get-sink-mute @DEFAULT_SINK@ | grep -o 'yes\|no')
|
||||
if [ "$muted" = "yes" ]; then
|
||||
echo " "
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
# Output initial icon
|
||||
get_volume_icon
|
||||
|
||||
# Subscribe to volume changes (including mute/unmute)
|
||||
pactl subscribe | grep --line-buffered "sink" | while read -r line; do
|
||||
get_volume_icon
|
||||
done
|
||||
13
eww/.config/eww/scripts/wifi
Normal file
13
eww/.config/eww/scripts/wifi
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
symbol() {
|
||||
[ $(cat /sys/class/net/w*/operstate) = down ] && echo && exit
|
||||
echo
|
||||
}
|
||||
|
||||
name() {
|
||||
nmcli | grep "^wlp" | sed 's/\ connected\ to\ /Connected to /g' | cut -d ':' -f2
|
||||
}
|
||||
|
||||
[ "$1" = "icon" ] && symbol && exit
|
||||
[ "$1" = "name" ] && name && exit
|
||||
13
eww/.config/eww/scripts/wifi-monitor
Normal file
13
eww/.config/eww/scripts/wifi-monitor
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
get_icon() {
|
||||
[ $(cat /sys/class/net/w*/operstate 2>/dev/null) = down ] && echo "" || echo ""
|
||||
}
|
||||
|
||||
# Output initial state
|
||||
get_icon
|
||||
|
||||
# Monitor network changes
|
||||
nmcli monitor | while read -r line; do
|
||||
get_icon
|
||||
done
|
||||
13
eww/.config/eww/scripts/wifi-name-monitor
Normal file
13
eww/.config/eww/scripts/wifi-name-monitor
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
get_name() {
|
||||
nmcli | grep "^wlp" | sed 's/\ connected\ to\ /Connected to /g' | cut -d ':' -f2
|
||||
}
|
||||
|
||||
# Output initial state
|
||||
get_name
|
||||
|
||||
# Monitor network changes
|
||||
nmcli monitor | while read -r line; do
|
||||
get_name
|
||||
done
|
||||
BIN
eww/.config/eww/wallpaper
Normal file
BIN
eww/.config/eww/wallpaper
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 MiB |
Reference in New Issue
Block a user