Laptop fixes

laptop
Elias Almqvist 2 years ago
parent 0ad3d6be6f
commit 1430ce8ea9
  1. 22
      eww/.config/eww/eww.yuck
  2. 4
      eww/.config/eww/scripts/battery
  3. 10
      eww/.config/eww/scripts/wifi

@ -104,10 +104,10 @@
;; Control widget (container)
(defwidget control []
(box :class "control" :spacing 12 :space-evenly false :orientation "v"
;; (wifi)
;; (bat)
(music)
(volume)
(wifi)
(bat)
(time)
)
)
@ -149,7 +149,7 @@
:reveal volume
:duration "450ms"
(scale :class "volbar"
:value current-volume
:value {current-volume != "" ? current-volume : "0"}
:orientation "v"
:flipped true
:tooltip "Volume: ${current-volume}%"
@ -181,12 +181,14 @@
;; Wifi Widgets ;;
(defwidget wifi []
(revealer :reveal {wifi-status == "true"}
(box :orientation "v"
:halign "middle"
:tooltip "SSID: ${wifi-name}"
(button :class "icon wifi-icon" wifi-icon
)))
(defpoll wifi-icon :interval "1s" "scripts/wifi icon")
(label :class "icon wifi"
""
))))
(defpoll wifi-status :interval "1s" "scripts/wifi status")
(defpoll wifi-name :interval "1s" "scripts/wifi name")
;; Workspaces container
@ -248,10 +250,10 @@
)))
(defpoll music-active :interval "200ms" "scripts/musicstatus")
(defpoll music-status :interval "200ms" "playerctl status")
(defpoll artUrl :interval "200ms" "playerctl metadata artUrl")
(defpoll title :interval "200ms" "playerctl metadata title")
(defpoll artist :interval "200ms" "playerctl metadata artist")
(defpoll music-status :interval "200ms" "playerctl status &>/dev/null")
(defpoll artUrl :interval "200ms" "playerctl metadata artUrl &>/dev/null")
(defpoll title :interval "200ms" "playerctl metadata title &>/dev/null")
(defpoll artist :interval "200ms" "playerctl metadata artist &>/dev/null")
(defpoll songtime :interval "500ms" "scripts/getSongDuration")
(defvar music false)

@ -25,10 +25,10 @@ elif [ "$per" -gt "20" ]; then
icon=""
elif [ "$per" -gt "10" ]; then
icon=""
notify-send -u critical "Battery Low" "Connect Charger"
# notify-send -u critical "Battery Low" "Connect Charger"
elif [ "$per" -gt "0" ]; then
icon=""
notify-send -u critical "Battery Low" "Connect Charger"
notify-send -u critical "Battery Low" "Connect Charger! Battery at $per%"
else
echo && exit
fi

@ -1,13 +1,13 @@
#!/bin/sh
symbol() {
[ $(cat /sys/class/net/w*/operstate) = down ] && echo && exit
echo
status() {
[ $(cat /sys/class/net/w*/operstate) = down ] && echo false && exit
echo true
}
name() {
nmcli | grep "^wlp" | sed 's/\ connected\ to\ /Connected to /g' | cut -d ':' -f2
nmcli | grep "^wlp" | sed 's/\ connected\ to\ /Connected to /g' | cut -d ':' -f2
}
[ "$1" = "icon" ] && symbol && exit
[ "$1" = "status" ] && status && exit
[ "$1" = "name" ] && name && exit

Loading…
Cancel
Save