first commit
This commit is contained in:
139
eww.scss
Normal file
139
eww.scss
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
$grey: #696969;
|
||||||
|
$scarlet: #ff0000;
|
||||||
|
|
||||||
|
//Globals
|
||||||
|
|
||||||
|
* {
|
||||||
|
all: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
window {
|
||||||
|
font-size: 10px;
|
||||||
|
border-radius: 10px;
|
||||||
|
text-shadow: 1px 1px 3px black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bar {
|
||||||
|
color: white; //font
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Widgets
|
||||||
|
|
||||||
|
button {
|
||||||
|
padding: 0px 7px; //top-bottom, left-right
|
||||||
|
margin: 3px;
|
||||||
|
border: 1px solid white;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: $grey;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:hover {
|
||||||
|
background-color: rgba(white, 0.5);
|
||||||
|
border-color: black;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
slider {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
scale trough {
|
||||||
|
background-color: rgba(black, 0.7);
|
||||||
|
border-radius: 10px;
|
||||||
|
min-height: 5px;
|
||||||
|
min-width: 50px;
|
||||||
|
margin-left: 5px;
|
||||||
|
margin-right: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
scale trough highlight {
|
||||||
|
background-color: white;
|
||||||
|
color: black;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
tooltip {
|
||||||
|
background-color: rgba($grey, 0.9);
|
||||||
|
font-size: 10px;
|
||||||
|
color: white;
|
||||||
|
padding: 3px;
|
||||||
|
margin: 10px 20px;
|
||||||
|
border-radius: 5px;
|
||||||
|
text-shadow: 1px 1px 3px black;
|
||||||
|
}
|
||||||
|
|
||||||
|
calendar {
|
||||||
|
background-color: rgba($grey, 0.95);
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
circular-progress {
|
||||||
|
color: white;
|
||||||
|
background-color: rgba(black, 0.9);
|
||||||
|
margin: 0px 3px;
|
||||||
|
border-radius: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Classes
|
||||||
|
.island {
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: rgba($grey, 0.9);
|
||||||
|
padding: 5px;
|
||||||
|
margin: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.monitor {
|
||||||
|
border-radius: 6px;
|
||||||
|
background-color: rgba($grey, 0.9);
|
||||||
|
padding: 5px;
|
||||||
|
margin: 2px;
|
||||||
|
box-shadow: 1px -1px 1px inset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspaces button{
|
||||||
|
padding: 0px 7px; //top-bottom, left-right
|
||||||
|
border: 1px solid white;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: $grey;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspaces button:hover {
|
||||||
|
background-color: rgba(white, 0.5);
|
||||||
|
border-color: black;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.active_workspace{
|
||||||
|
box-shadow: 0px -2px 1px inset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.center {
|
||||||
|
color: rgba(white, 0.9);
|
||||||
|
}
|
||||||
|
|
||||||
|
.center button{
|
||||||
|
padding: 0px 8px;
|
||||||
|
margin: 5px;
|
||||||
|
text-shadow: 0px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.center button:hover {
|
||||||
|
background-color: rgba(white, 0.3);
|
||||||
|
color: black;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timendate {
|
||||||
|
font-size: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clock {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.visualizer {
|
||||||
|
font-size: 8px;
|
||||||
|
text-shadow: 0px 0px;
|
||||||
|
}
|
||||||
274
eww.yuck
Normal file
274
eww.yuck
Normal file
@@ -0,0 +1,274 @@
|
|||||||
|
;;main status bar and whatnot
|
||||||
|
(defwindow bar
|
||||||
|
:monitor 0
|
||||||
|
:stacking "fg"
|
||||||
|
:windowtype "dock"
|
||||||
|
:vexpand false
|
||||||
|
:exclusive "true"
|
||||||
|
:geometry (geometry
|
||||||
|
:y "3px"
|
||||||
|
:width "99%"
|
||||||
|
:anchor "bottom center")
|
||||||
|
(bar)
|
||||||
|
)
|
||||||
|
|
||||||
|
(defpoll time :interval "1s" :initial `date +%H:%M:%S` `date +%H:%M:%S`)
|
||||||
|
(defpoll date :interval "1m" "date +%m/%d/%y")
|
||||||
|
(defpoll ip_addr :interval "1h" 'ip -j a show enp0s3')
|
||||||
|
(defpoll volume :interval "250ms" 'wpctl get-volume @DEFAULT_SINK@') ;;turn this into a script or smth
|
||||||
|
(defpoll active_workspaces :interval "250ms" "hyprctl workspaces -j")
|
||||||
|
(defpoll active_window :interval "500ms" 'hyprctl activewindow -j')
|
||||||
|
(defpoll current_workspace :interval "250ms" "hyprctl activeworkspace -j")
|
||||||
|
(deflisten splash :initial "yo" "hyprctl splash")
|
||||||
|
(defvar reveal_calendar false)
|
||||||
|
(defvar reveal_sound false)
|
||||||
|
(defvar reveal_sound_menu false)
|
||||||
|
(defvar network_interface "enp0s3") ;;the interface to listen to
|
||||||
|
(defvar reveal_apps 0)
|
||||||
|
(defvar browser "microsoft-edge")
|
||||||
|
(defvar filemanager "pcmanfm")
|
||||||
|
|
||||||
|
|
||||||
|
;; DONE workspaces
|
||||||
|
;; DONE date
|
||||||
|
;; KINDA DONE networking
|
||||||
|
;; DONE volume
|
||||||
|
;; make the sound icon do smth
|
||||||
|
;; power menu
|
||||||
|
;; DONE app tray
|
||||||
|
|
||||||
|
(defwidget workspaces []
|
||||||
|
(box
|
||||||
|
:class "workspaces island"
|
||||||
|
:orientation "h"
|
||||||
|
:space-evenly true
|
||||||
|
:halign "start"
|
||||||
|
:spacing 3
|
||||||
|
(for wsp in active_workspaces
|
||||||
|
(button
|
||||||
|
:class {current_workspace.id == wsp.id ? "active_workspace" : "workspaces"}
|
||||||
|
:onclick "hyprctl dispatch workspace ${wsp.id}" {wsp.id}))
|
||||||
|
(label :visible false :text "${current_workspace}") ;;this is a dummy widget since current_workspace won't poll otherwise
|
||||||
|
))
|
||||||
|
|
||||||
|
(defwidget sound []
|
||||||
|
(eventbox
|
||||||
|
:onhover "eww update reveal_sound=true"
|
||||||
|
:onhoverlost "eww update reveal_sound=false"
|
||||||
|
(box
|
||||||
|
:space-evenly false
|
||||||
|
:orientation "h"
|
||||||
|
:spacing "3"
|
||||||
|
(revealer
|
||||||
|
:reveal reveal_sound
|
||||||
|
:transition "slideleft"
|
||||||
|
:duration "500ms"
|
||||||
|
(scale
|
||||||
|
:draw-value true
|
||||||
|
:value-pos "right"
|
||||||
|
:min 0
|
||||||
|
:max 101
|
||||||
|
:orientation "h"
|
||||||
|
:value {substring(volume,8,4) * 100}
|
||||||
|
:onchange "wpctl set-volume @DEFAULT_SINK@ {}%")
|
||||||
|
)
|
||||||
|
""
|
||||||
|
)
|
||||||
|
))
|
||||||
|
|
||||||
|
(defwidget time-and-date []
|
||||||
|
(eventbox
|
||||||
|
:onclick "eww update ${selected_widget != 1 ? "selected_widget=1" : "selected_widget=0"}"
|
||||||
|
(box
|
||||||
|
:class "timendate"
|
||||||
|
:spacing 1
|
||||||
|
:space-evenly false
|
||||||
|
:halign "start"
|
||||||
|
:orientation "v"
|
||||||
|
:tooltip time
|
||||||
|
{substring(time,0,strlength(time)-3)}
|
||||||
|
date))
|
||||||
|
)
|
||||||
|
|
||||||
|
(defwidget network []
|
||||||
|
(box
|
||||||
|
:class "monitor"
|
||||||
|
:orientation "v"
|
||||||
|
"${network_interface}"
|
||||||
|
(label :limit_width 25 :wrap true :text "ip: ${ip_addr[0].addr_info[0].local}")
|
||||||
|
(label :text ":${round(EWW_NET.enp0s3.NET_UP / 1000000 * 8, 1)} / :${round(EWW_NET.enp0s3.NET_DOWN / 1000000 * 8, 1)} mbps")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
(defwidget center []
|
||||||
|
(eventbox
|
||||||
|
:class "center island"
|
||||||
|
:onhover "eww update reveal_apps=1"
|
||||||
|
:onhoverlost "eww update reveal_apps=0"
|
||||||
|
(stack
|
||||||
|
:selected reveal_apps
|
||||||
|
:transition "slidedown"
|
||||||
|
:samesize true
|
||||||
|
(label :class "center island" :text "${active_window.title ?: splash}")
|
||||||
|
(box
|
||||||
|
:orientation "h"
|
||||||
|
:space-evenly true
|
||||||
|
(button :onclick {browser} "")
|
||||||
|
(button :onclick {filemanager} ""))
|
||||||
|
)))
|
||||||
|
|
||||||
|
|
||||||
|
(defwidget right []
|
||||||
|
(box
|
||||||
|
:class "island"
|
||||||
|
:spacing 5
|
||||||
|
:orientation "h"
|
||||||
|
:space-evenly false
|
||||||
|
:halign "end"
|
||||||
|
(systray
|
||||||
|
:spacing 3
|
||||||
|
:orientation "h"
|
||||||
|
:space-evenly false
|
||||||
|
:icon-size 5
|
||||||
|
:prepend-new false)
|
||||||
|
(sound)
|
||||||
|
(time-and-date)
|
||||||
|
))
|
||||||
|
|
||||||
|
(defwidget bar []
|
||||||
|
(centerbox
|
||||||
|
:orientation "h"
|
||||||
|
:class "bar"
|
||||||
|
(workspaces)
|
||||||
|
;; (label :class "center island" :text "${active_window.title ?: splash}")
|
||||||
|
(center)
|
||||||
|
(right)
|
||||||
|
))
|
||||||
|
|
||||||
|
|
||||||
|
(defvar selected_widget 0)
|
||||||
|
|
||||||
|
;;sub window for widgets
|
||||||
|
(defwindow widget_window []
|
||||||
|
:monitor 0
|
||||||
|
:geometry (geometry
|
||||||
|
:y "2%"
|
||||||
|
:x "2%"
|
||||||
|
:anchor "right bottom")
|
||||||
|
|
||||||
|
:stacking "overlay"
|
||||||
|
:exclusive false
|
||||||
|
(sub_window)
|
||||||
|
)
|
||||||
|
|
||||||
|
(defwidget sub_window []
|
||||||
|
(stack
|
||||||
|
:selected selected_widget
|
||||||
|
:transition "slideup"
|
||||||
|
:same-size false
|
||||||
|
""
|
||||||
|
(calendar)
|
||||||
|
(power_menu)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
(defwidget power_menu []
|
||||||
|
(box
|
||||||
|
:class "island"
|
||||||
|
:orientation "v"
|
||||||
|
:space-evenly false
|
||||||
|
(button
|
||||||
|
:onclick "shutdown now"
|
||||||
|
"shutdown")
|
||||||
|
(button
|
||||||
|
:onclick "hyprctl dispatch exit"
|
||||||
|
"logout")
|
||||||
|
(button
|
||||||
|
:onclick "reboot"
|
||||||
|
"restart")
|
||||||
|
(button
|
||||||
|
:onclick "eww update selected_widget=0"
|
||||||
|
"X")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
;;second monitor can have cpu and ram usage, cpu temp, time
|
||||||
|
|
||||||
|
(defwindow resource_monitor []
|
||||||
|
:monitor 0
|
||||||
|
:geometry (geometry
|
||||||
|
:y "5%"
|
||||||
|
:x "5%"
|
||||||
|
:width "20%"
|
||||||
|
:height "20%"
|
||||||
|
:anchor "left top")
|
||||||
|
:stacking "bottom"
|
||||||
|
:exclusive false
|
||||||
|
(resource_widget))
|
||||||
|
|
||||||
|
|
||||||
|
(defwidget resource_widget []
|
||||||
|
(box
|
||||||
|
:orientation "v"
|
||||||
|
:halign "start"
|
||||||
|
:space-evenly false
|
||||||
|
(label :class "monitor clock" :text {time})
|
||||||
|
(cpu)
|
||||||
|
(ram)
|
||||||
|
(disk)
|
||||||
|
(network)
|
||||||
|
(visualizer)
|
||||||
|
))
|
||||||
|
|
||||||
|
(defwidget cpu []
|
||||||
|
(box
|
||||||
|
:orientation "h"
|
||||||
|
:space-evenly true
|
||||||
|
:halign "start"
|
||||||
|
(box
|
||||||
|
:class "monitor"
|
||||||
|
:orientation "v"
|
||||||
|
(label :text "cpu avg: ${round(EWW_CPU.avg, 1)}%")
|
||||||
|
(for core in {EWW_CPU.cores}
|
||||||
|
(label :tooltip "${core.freq} Mhz" :text "${core.core}: ${core.usage}%")))
|
||||||
|
(box
|
||||||
|
:class "monitor"
|
||||||
|
(graph
|
||||||
|
:thickness 2
|
||||||
|
:time-range "10s"
|
||||||
|
:max 100
|
||||||
|
:value {round(EWW_CPU.avg,1)}))
|
||||||
|
))
|
||||||
|
|
||||||
|
(defwidget ram []
|
||||||
|
(box
|
||||||
|
:orientation "h"
|
||||||
|
(box
|
||||||
|
:class "monitor"
|
||||||
|
:orientation "v"
|
||||||
|
(label :text "RAM: ${round(EWW_RAM.used_mem/1000000000, 2)}/${round(EWW_RAM.total_mem/1000000000, 2)} GB")
|
||||||
|
(label :text "Available: ${round(EWW_RAM.available_mem/1000000000, 2)} GB")
|
||||||
|
)
|
||||||
|
))
|
||||||
|
|
||||||
|
(defwidget disk []
|
||||||
|
(box
|
||||||
|
:class "monitor"
|
||||||
|
:orientation "h"
|
||||||
|
:space-evenly false
|
||||||
|
(label :text "/: ${round(EWW_DISK["/"].free/1000000000, 2)}/${round(EWW_DISK["/"].total/1000000000,2)} GB")
|
||||||
|
(circular-progress
|
||||||
|
:value {round(EWW_DISK["/"].used_perc, 1)}
|
||||||
|
:thickness 6)
|
||||||
|
(label :text "${round(EWW_DISK["/"].used_perc, 1)}% used")
|
||||||
|
))
|
||||||
|
|
||||||
|
(deflisten cava "bash $HOME/.config/eww/scripts/cava.sh")
|
||||||
|
|
||||||
|
(defwidget visualizer []
|
||||||
|
(box
|
||||||
|
:class "monitor"
|
||||||
|
:orientation "h"
|
||||||
|
(label :class "visualizer" :text cava)
|
||||||
|
))
|
||||||
11
scripts/cava.sh
Normal file
11
scripts/cava.sh
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
cava -p <(cat <<EOF
|
||||||
|
[general]
|
||||||
|
bars = 26
|
||||||
|
[output]
|
||||||
|
method = raw
|
||||||
|
raw_target = /dev/stdout
|
||||||
|
data_format = ascii
|
||||||
|
ascii_max_range = 7
|
||||||
|
EOF
|
||||||
|
) | sed -u 's/;//g;s/0/_/g;s/1/▂/g;s/2/▃/g;s/3/▄/g;s/4/▅/g;s/5/▆/g;s/6/▇/g;s/7/█/g;'
|
||||||
Reference in New Issue
Block a user