1
0
Fork 0

chore(eww): delete unused eww config

Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
This commit is contained in:
Lucas Sta Maria 2024-11-04 12:00:40 -05:00
parent 03e63e60e9
commit 7e4ccb7c61
No known key found for this signature in database
GPG key ID: F07FB16A826E3B47
24 changed files with 0 additions and 641 deletions

View file

@ -1,161 +0,0 @@
// General styling
* {
all: unset;
}
scale trough {
all: unset;
background-color: #22242b;
box-shadow: 0 2px 3px 2px #06060b;
border-radius: 16px;
min-height: 10px;
min-width: 70px;
margin: 0px 10px 0px 0px;
}
// Main bar styling
.main {
background-color: #0e1419;
color: #e5e1cf;
font-family: "Noto Sans";
font-size: 12px;
}
.leftwidgets {
margin-left: 5px;
margin-right: 50px;
button {
margin: 0px 5px;
border-color: #0e1419;
border-width: 0px;
padding-left: 0em;
padding-right: 0em;
}
.occupied {
color: #919191;
}
.focused {
color: #ff6054;
}
.empty {
color: #444444;
}
}
.rightwidgets {
margin: 0px 10px 0px 5px;
}
.icon-module__icon {
margin: 0px 5px 0px 0px;
font-size: 15px;
}
.button__container {
padding-left: 7px;
padding-right: 7px;
border-radius: 5px;
}
.button__container:hover {
background-color: hsla(210, 25%, 25%, 0.3);
}
.player {
color: #e5e1cf;
}
.player__container {
padding-left: 7px;
padding-right: 7px;
border-radius: 10px;
}
.player__container:hover {
background-color: hsla(210, 25%, 25%, 0.3);
}
.power__text {
margin-top: 3px;
}
.power__text_low {
margin-top: 3px;
color: #ff3333;
}
.brightness__label {
margin-top: 1px;
}
.brightness__bar {
margin-left: 10px;
}
.brightness__bar trough highlight {
background-image: linear-gradient(to right, #e4c9af 30%, #f2cdcd 50%, #e0b089 100% *50);
border-radius: 10px;
min-width: 20px;
}
.volume__bar {
margin-left: 10px;
}
.volume__bar trough highlight {
background-image: linear-gradient(to right, #f2525d 30%, #cc5a61 50%, #c93640 100% *50);
border-radius: 10px;
min-width: 20px;
}
.volume__label {
margin-top: 3px;
}
.timedate__button {
padding: 3px 6px;
border-radius: 5px;
}
.timedate__button:hover {
background-color: hsla(210, 25%, 25%, 0.3);
}
// Song card styling
.songcard {
background-color: #0e1419;
color: #e5e1cf;
font-family: "Noto Sans";
font-size: 12px;
}
.songcard__title {
font-weight: 700;
font-size: 20px;
margin-top: 10px;
margin-bottom: 0px;
}
.songcard__artist {
font-weight: 500;
font-size: 14px;
margin-top: 0px;
margin-bottom: 0px;
color: #919191;
}
.songcard__controls {
margin-top: 0px;
margin-bottom: 10px;
}
.songcard__button {
margin: 0px 3px;
}

View file

@ -1,243 +0,0 @@
;; Global variables
(deflisten w1 "scripts/workspaces 1")
(deflisten w2 "scripts/workspaces 2")
(deflisten w3 "scripts/workspaces 3")
(deflisten w4 "scripts/workspaces 4")
(deflisten w5 "scripts/workspaces 5")
(deflisten w6 "scripts/workspaces 6")
(deflisten w7 "scripts/workspaces 7")
(deflisten w8 "scripts/workspaces 8")
(deflisten w9 "scripts/workspaces 9")
(deflisten w10 "scripts/workspaces 10")
(deflisten w11 "scripts/workspaces 11")
(deflisten w12 "scripts/workspaces 12")
(deflisten w13 "scripts/workspaces 13")
(deflisten w14 "scripts/workspaces 14")
(deflisten w15 "scripts/workspaces 15")
(deflisten w16 "scripts/workspaces 16")
(deflisten w17 "scripts/workspaces 17")
(deflisten w18 "scripts/workspaces 18")
(deflisten w19 "scripts/workspaces 19")
(deflisten w20 "scripts/workspaces 20")
(deflisten player_listen :initial '{"show": "no", "content": ""}' "scripts/player")
(deflisten player :initial '{"content": "TEST"}' "scripts/player")
(deflisten songcardtitle :initial '(label :class "songcard__title" :text "None Playing")'
"scripts/songcardtitle")
(deflisten songcardartist :initial '(label :class "songcard__artist" :text ".")'
"scripts/songcardartist")
(defpoll songcard_button :interval "1s" "scripts/songcardplayrender")
(defpoll weather_text :interval "60s" "curl 'wttr.in/Boston?m&format=%c%20%t%20(%f)'")
(defpoll wifi_label :interval "1s" "scripts/wifi")
(defpoll bluetooth_label :interval "1s" "scripts/bluetooth")
(defpoll volume_level :interval "1s" "scripts/volume")
(defpoll volume_label :initial '{"icon": "", content: "0"}'
:interval "1s"
"scripts/volumelabel")
(defpoll brightness_level :interval "1s" "scripts/brightness")
(defpoll brightness_label :interval "1s" "scripts/brightnesslabel")
(defpoll battery_level :interval "15s" "scripts/battery")
(defpoll currtime :interval "1s" "scripts/currtime")
(defpoll autosus :interval "5s" "scripts/autosus")
(defvar songcard_reveal false)
(defvar brightness_reveal false)
(defvar volume_reveal false)
(defvar timedate_reveal false)
;; Main widget
(defwindow main
:monitor 0
:geometry (geometry :x "-2px"
:y "15px"
:width "98%"
:height "30px"
:anchor "top center")
:stacking "bg"
:reserve (struts :distance "50px" :side "top")
:windowtype "dialog"
:wm-ignore false
(container))
;; The main container for all the widgets
(defwidget container []
(centerbox :orientation "horizontal"
:space-evenly true
(leftwidgets)
(middlewidgets)
(rightwidgets)))
;; Left widgets
(defwidget leftwidgets []
(box :spacing 4
:orientation "horizontal"
:halign "start"
:valign "center"
:class "leftwidgets"
(literal :content w1)
(literal :content w2)
(literal :content w3)
(literal :content w4)
(literal :content w5)
(literal :content w6)
(literal :content w7)
(literal :content w8)
(literal :content w9)
(literal :content w10)
(literal :content w11)
(literal :content w12)
(literal :content w13)
(literal :content w14)
(literal :content w15)
(literal :content w16)
(literal :content w17)
(literal :content w18)
(literal :content w19)
(literal :content w20)))
;; Middle widgets
(defwidget middlewidgets []
(player))
;; Spotify widget
(defwidget player []
(button :onclick "scripts/songcardshow"
:class "player__container"
(icon-module :class "player"
:icon ""
:visible {player_listen.show == "yes"}
(literal :content {player_listen.content}))))
;; Right widgets
(defwidget rightwidgets []
(box :class "rightwidgets"
:orientation "horizontal"
:halign "end"
:valign "center"
:space-evenly "false"
:spacing 5
(literal :content {autosus})
(weather)
(wifi)
(bluetooth)
(brightness)
(volume)
(power)
(timedate)))
;; Displays the current weather
(defwidget weather []
(label :text {weather_text}))
;; A widget that displays the current wifi SSID
(defwidget wifi []
(icon-module :icon "↑"
(literal :content {wifi_label})))
(defwidget bluetooth []
(button :onclick "scripts/bluetoothpanel"
:class "button__container"
(icon-module :class "bluetooth"
:icon "ᛒ"
:visible true
(literal :content {bluetooth_label}))))
;; A widget for tracking brightness
(defwidget brightness []
(eventbox :onhover "eww update brightness_reveal=true"
:onhoverlost "eww update brightness_reveal=false"
(icon-module :icon "☼"
(literal :content {brightness_label})
(revealer :transition "slideleft"
:reveal brightness_reveal
:duration "350ms"
(scale :class "brightness__bar"
:orientation "horizontal"
:value brightness_level
:min 0
:max 100
:onchange "brightnessctl set {}%")))))
;; A widget for tracking volume
(defwidget volume []
(eventbox :onhover "eww update volume_reveal=true"
:onhoverlost "eww update volume_reveal=false"
(icon-module :icon {volume_label.icon}
(literal :content {volume_label.content})
(revealer :transition "slideleft"
:reveal volume_reveal
:duration "350ms"
(scale :class "volume__bar"
:orientation "horizontal"
:value volume_level
:min 0
:max 100
:onchange "pamixer --set-volume $(printf \"%.0f\" \"{}\")")))))
;; A widget for tracking battery
(defwidget power []
(button :onclick "scripts/powernotify"
:class "button__container"
(icon-module :class "power"
:icon "⏻"
:visible true
(literal :content {battery_level}))))
;; A widget for tracking time and date
(defwidget timedate []
(box :class "timedate"
:orientation "horizontal"
:space-evenly false
:valign "center"
:halign "end"
(button :class "timedate__button"
:onclick "scripts/boolflip timedate_reveal"
(literal :content {currtime}))))
;; A module with an icon attached
(defwidget icon-module [icon ?class ?visible]
(box :class "${class} icon-module"
:orientation "horizontal"
:halign "end"
:valign "center"
:space-evenly false
:visible {visible ?: true}
(label :class "icon-module__icon" :text "${icon}")
(children)))
; The song card widget
(defwindow songcard
:monitor 0
:geometry (geometry :x "0px"
:y "70px"
:width "350px"
:height "50px"
:anchor "top center")
:stacking "fg"
:reserve (struts :distance "50px" :side "top")
:windowtype "dialog"
:wm-ignore false
(box :orientation "vertical"
;; song metadata
(box :orientation "vertical"
:halign "center"
:valign "top"
(literal :content {songcardtitle})
(literal :content {songcardartist})
;; song controls
(centerbox :class "songcard__controls"
:orientation "horizontal"
:valign "center"
:halign "center"
(button :onclick "scripts/songback"
:class "songcard__button"
(image :path "img/musicback.png" :image-width 20 :image-height 20))
(button :onclick "scripts/songplay"
:class "songcard__button"
(literal :content {songcard_button}))
(button :onclick "scripts/songnext"
:class "songcard__button"
(image :path "img/musicnext.png" :image-width 20 :image-height 20))))))

View file

@ -1,2 +0,0 @@
susauto: autosus.c
clang -lX11 -lXrandr autosus.c -o autosus

View file

@ -1,34 +0,0 @@
#include <X11/Xlibint.h>
#include <X11/extensions/Xrandr.h>
#include <stdio.h>
int main(int argc, char **args) {
const char *display_name = ":0";
Display *dpy = XOpenDisplay(display_name);
Window window = XDefaultRootWindow(dpy);
XRRMonitorInfo *monitor = XRRGetMonitors(dpy, window, 1, &dpy->nscreens);
int is_laptop_screen = monitor->height == 1200 ? 1 : 0;
FILE *fp = popen(
"cat /proc/acpi/button/lid/LID0/state | grep -i closed | wc -l", "r");
if (fp == NULL) {
exit(1);
}
char buf[2];
int is_closed = 0;
if (fgets(buf, sizeof(buf), fp) != NULL) {
is_closed = atoi(buf);
pclose(fp);
} else {
exit(1);
}
if (is_closed && is_laptop_screen) {
system("systemctl suspend");
}
printf("");
return 0;
}

View file

@ -1,12 +0,0 @@
#!/usr/bin/env bash
val=$(cat /sys/class/power_supply/BAT0/capacity)
discharging=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -i "state" | grep -i "discharging" | wc -l)
if [ $val -gt 19 ]; then
echo "(label :class \"power__text\" :text \"$val%\")"
elif [ $discharging -eq 0 ]; then
echo "(label :class \"power__text\" :text \"$val%\")"
else
echo "(label :class \"power__text_low\" :text \"$val%\")"
fi

View file

@ -1,10 +0,0 @@
#!/usr/bin/env bash
powered=$(bluetoothctl show | grep -i "powered" | grep -i "yes" | wc -l)
if [[ "$powered" -eq 1 ]]; then
val=$(bluetoothctl devices Connected | wc -l)
echo "(label :class \"bluetooth__label\" :text \"$val\")"
else
echo "(label :class \"bluetooth__label\" :text \"-\")"
fi

View file

@ -1,3 +0,0 @@
#!/usr/bin/env bash
rofi-bluetooth

View file

@ -1,10 +0,0 @@
#!/usr/bin/env bash
var="$1"
val=`eww get ${var}`
if [ "$val" == "true" ]; then
eww update "$var"=false
else
eww update "$var"=true
fi

View file

@ -1,9 +0,0 @@
#!/usr/bin/env bash
level=$(brightnessctl get)
max=$(brightnessctl max)
raw_percent=$(echo "scale=2 ; $level / $max" | bc)
percent=$(echo "$raw_percent*100" | bc)
final_percent=${percent%.*}
echo "$final_percent"

View file

@ -1,9 +0,0 @@
#!/usr/bin/env bash
level=$(brightnessctl get)
max=$(brightnessctl max)
raw_percent=$(echo "scale=2 ; $level / $max" | bc)
percent=$(echo "$raw_percent*100" | bc)
final_percent=${percent%.*}
echo "(label :class \"brightness__label\" :text \"$final_percent%\")"

View file

@ -1,12 +0,0 @@
#!/usr/bin/env bash
var="timedate_reveal"
val=`eww get ${var}`
if [ "$val" == true ]; then
time=`date +"%F %T"`
echo "(label :text \"$time\")"
else
time=`date +"%R"`
echo "(label :text \"$time\")"
fi

View file

@ -1,17 +0,0 @@
#!/usr/bin/env bash
echo "{\"show\": \"no\", \"content\": \"\"}"
while true
do
line=$(spt playback --status -f "%s:%a - %t" 2> /dev/null)
IFS=':' read -ra ELS <<< "$line"
button=${ELS[0]}
content=${ELS[1]}
if [ "$button" == "▶" ]; then
echo "{\"show\": \"yes\", \"content\": \"(label :text \\\"$content\\\")\"}"
else
echo "{\"show\": \"no\", \"content\": \"\"}"
fi
sleep 1
done

View file

@ -1,7 +0,0 @@
#!/usr/bin/env bash
msg=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | \
grep -E "state|time to|percentage" | \
awk '{$1=$1};1')
notify-send -t 3000 "Battery Status" "$msg"

View file

@ -1,3 +0,0 @@
#!/usr/bin/env bash
spt playback --previous

View file

@ -1,9 +0,0 @@
#!/usr/bin/env bash
echo "(label :class \"songcard__artist\" :text \".\")"
while true
do
content=$(spt playback --status -f "%a" 2> /dev/null)
echo "(label :class \"songcard__artist\" :text \"${content}\")"
sleep 1
done

View file

@ -1,8 +0,0 @@
#!/usr/bin/env bash
button=$(spt playback --status -f "%s" 2>/dev/null)
if [ "$button" == "▶" ]; then
echo "(image :path \"img/musicpause.png\" :image-width 40 :image-height 40)"
else
echo "(image :path \"img/musicplay.png\" :image-width 40 :image-height 40)"
fi

View file

@ -1,11 +0,0 @@
#!/usr/bin/env bash
show=$(eww get songcard_reveal)
if [ "$show" == "false" ]; then
eww open songcard && eww update songcard_reveal=true
else
eww close songcard && eww update songcard_reveal=false
fi
./boolflip songcard_reveal

View file

@ -1,9 +0,0 @@
#!/usr/bin/env bash
echo "(label :class \"songcard__title\" :text \"None Playing\")"
while true
do
content=$(spt playback --status -f "%t" 2> /dev/null)
echo "(label :class \"songcard__title\" :text \"${content}\")"
sleep 1
done

View file

@ -1,3 +0,0 @@
#!/usr/bin/env bash
spt playback --next

View file

@ -1,3 +0,0 @@
#!/usr/bin/env bash
spt playback --toggle

View file

@ -1,9 +0,0 @@
#!/usr/bin/env bash
raw_percent=$(pamixer --get-volume-human)
if [ "$raw_percent" == "muted" ]; then
echo "0"
else
percent=$(echo "$raw_percent" | sed 's/[^0-9]*//g')
echo "$percent"
fi

View file

@ -1,20 +0,0 @@
#!/usr/bin/env bash
raw_percent=$(pamixer --get-volume-human)
if [ "$raw_percent" == "muted" ]; then
echo "{\"icon\": \"\", \"content\": \"(label :class \\\"volume__label\\\" :text \\\"muted\\\")\"}"
else
percent=$(echo "$raw_percent" | sed 's/[^0-9]*//g')
#if [ "$percent" -gt 66 ]; then
# icon=""
#elif [ "$percent" -gt 33 ]; then
# icon=""
#elif [ "$percent" -gt 0 ]; then
# icon=""
#else
# icon=""
#fi
icon=""
volume="$percent%"
echo "{\"icon\": \"${icon}\", \"content\": \"(label :class \\\"volume__label\\\" :text \\\"${volume}\\\")\"}"
fi

View file

@ -1,8 +0,0 @@
#!/usr/bin/env bash
wifi=`nmcli c show --active | tail -n 1 | sed 's/ .*//g'`
if [ ${#wifi} -gt 0 ]; then
echo "(label :text \"${wifi}\")"
else
echo ""
fi

View file

@ -1,29 +0,0 @@
#!/usr/bin/env bash
# Checks if a list ($1) contains an element ($2)
contains() {
for e in $1; do
[ "$e" == "$2" ] && echo 1 && return
done
echo 0
}
workspaces() {
icon=""
isfocused=$(bspc query -D -d focused --names | grep -w "$1")
isoccupied=$(bspc query -D -d .occupied --names | grep -w "$1")
if [ ${#isfocused} -ge 1 ]; then
class="focused"
elif [ ${#isoccupied} -ge 1 ]; then
class="occupied"
else
class="empty"
fi
echo "(button :onclick \"bspc desktop -f '^$1'\" :class \"$class\" \"$icon\")"
}
workspaces $1
bspc subscribe desktop node_transfer | while read -r _ ; do
workspaces $1
done