Laptop fixes

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

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

@ -1,13 +1,13 @@
#!/bin/sh #!/bin/sh
symbol() { status() {
[ $(cat /sys/class/net/w*/operstate) = down ] && echo && exit [ $(cat /sys/class/net/w*/operstate) = down ] && echo false && exit
echo echo true
} }
name() { 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 [ "$1" = "name" ] && name && exit

Loading…
Cancel
Save