4/6
This commit is contained in:
19
eww.scss
19
eww.scss
@@ -27,7 +27,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.clock-box-dash {
|
.clock-box-dash {
|
||||||
padding:10px;
|
padding:2px;
|
||||||
margin: 6px;
|
margin: 6px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
background-color: rgba(0,0,0,0.25);
|
background-color: rgba(0,0,0,0.25);
|
||||||
@@ -39,6 +39,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.clock-time-dash {
|
.clock-time-dash {
|
||||||
|
font-size: 100px;
|
||||||
|
font-weight: 800;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mem-dash {
|
||||||
font-size: 50px;
|
font-size: 50px;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
}
|
}
|
||||||
@@ -49,11 +54,12 @@
|
|||||||
|
|
||||||
.clock-date-dash {
|
.clock-date-dash {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
margin: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.media {
|
.media {
|
||||||
background-color: rgba(0,0,0,0.25);
|
background-color: rgba(0,0,0,0.25);
|
||||||
padding: 0px;
|
padding: 5px;
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
@@ -62,7 +68,7 @@
|
|||||||
background: none;
|
background: none;
|
||||||
border: none;
|
border: none;
|
||||||
font-size: 40px;
|
font-size: 40px;
|
||||||
padding: 0px;
|
padding: 5px;
|
||||||
border-radius: 9px;
|
border-radius: 9px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,3 +104,10 @@
|
|||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mem-circle {
|
||||||
|
min-width: 64px;
|
||||||
|
min-height: 64px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
73
eww.yuck
73
eww.yuck
@@ -76,7 +76,11 @@
|
|||||||
|
|
||||||
(defpoll clock-date
|
(defpoll clock-date
|
||||||
:interval "60s"
|
:interval "60s"
|
||||||
"date '+%A %B %d'")
|
"date '+%B %d'")
|
||||||
|
|
||||||
|
(defpoll clock-dow
|
||||||
|
:interval "60s"
|
||||||
|
"date '+%A'")
|
||||||
|
|
||||||
(defwidget clock-widget []
|
(defwidget clock-widget []
|
||||||
(box
|
(box
|
||||||
@@ -84,17 +88,26 @@
|
|||||||
:spacing 2
|
:spacing 2
|
||||||
:class "clock-box"
|
:class "clock-box"
|
||||||
(label :text clock-time :class "clock-time")
|
(label :text clock-time :class "clock-time")
|
||||||
|
(label :test clock-dow :class "clock-date")
|
||||||
(label :text clock-date :class "clock-date")))
|
(label :text clock-date :class "clock-date")))
|
||||||
|
|
||||||
(defwidget clock-dash []
|
(defwidget clock-dash []
|
||||||
(box
|
(box
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
:spacing 2
|
|
||||||
:class "clock-box-dash"
|
:class "clock-box-dash"
|
||||||
|
:space-evenly true
|
||||||
|
:valign "center"
|
||||||
|
(box
|
||||||
|
:orientation "v"
|
||||||
|
:valign "center"
|
||||||
|
:halign "center"
|
||||||
|
:space-evenly false
|
||||||
(label :text clock-time :class "clock-time-dash")
|
(label :text clock-time :class "clock-time-dash")
|
||||||
|
(label :text clock-dow :class "clock-date-dash")
|
||||||
(label :text clock-date :class "clock-date-dash")
|
(label :text clock-date :class "clock-date-dash")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
|
||||||
(defwindow clock
|
(defwindow clock
|
||||||
:monitor 0
|
:monitor 0
|
||||||
@@ -118,30 +131,44 @@
|
|||||||
| sed 's/^file:\\/\\///' \
|
| sed 's/^file:\\/\\///' \
|
||||||
| tr -d '\\n'")
|
| tr -d '\\n'")
|
||||||
|
|
||||||
(defpoll free_mem :interval "5s"
|
(defpoll mem_used :interval "2s"
|
||||||
"free -h | awk '/Mem:/ {print $7}'")
|
"sh ~/.config/eww/mem_used.sh")
|
||||||
|
|
||||||
(defpoll used_mem :interval "5s"
|
(defpoll mem_ratio :interval "5s"
|
||||||
"free -h | awk '/Mem:/ {print $3}'")
|
"free --si -h | awk '/Mem:/ {printf \"%s / %s\", $3, $2}'")
|
||||||
|
|
||||||
(defwidget memory []
|
(defwidget mem_circle []
|
||||||
(box
|
(box
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
:class "clock-box"
|
:class "clock-box"
|
||||||
(label :text "Memory" :class "header")
|
:space-evenly true
|
||||||
(box
|
(label :text mem_ratio :class "mem-dash")
|
||||||
:orientation "h"
|
(progress
|
||||||
(label :text "Free" :class "subhead")
|
:value mem_used
|
||||||
(label :text "Used" :class "subhead")
|
:min 0
|
||||||
)
|
:max 100
|
||||||
(box
|
|
||||||
:orientation "h"
|
|
||||||
(label :text free_mem)
|
|
||||||
(label :text used_mem)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
;(defwidget memory []
|
||||||
|
; (box
|
||||||
|
; :orientation "v"
|
||||||
|
; :class "clock-box"
|
||||||
|
; (label :text "Memory" :class "header")
|
||||||
|
; (box
|
||||||
|
; :orientation "h"
|
||||||
|
; (label :text "Free" :class "subhead")
|
||||||
|
; (label :text "Used" :class "subhead")
|
||||||
|
; )
|
||||||
|
; (box
|
||||||
|
; :orientation "h"
|
||||||
|
; (label :text free_mem)
|
||||||
|
; (label :text used_mem)
|
||||||
|
; )
|
||||||
|
; )
|
||||||
|
;)
|
||||||
|
|
||||||
(defwindow media_popup
|
(defwindow media_popup
|
||||||
:monitor 0
|
:monitor 0
|
||||||
:geometry (geometry
|
:geometry (geometry
|
||||||
@@ -179,12 +206,14 @@
|
|||||||
(defwidget media-small [art]
|
(defwidget media-small [art]
|
||||||
(box
|
(box
|
||||||
:class "media"
|
:class "media"
|
||||||
:orientation "vertical"
|
:orientation "horizontal"
|
||||||
:space-evenly true
|
:space-evenly true
|
||||||
(box :radius 10 :clip true (image :path art :image-width 150 :image-height 150))
|
(box :radius 10 :clip true (image :path art :image-width 225 :image-height 225))
|
||||||
(box
|
(box
|
||||||
:orientation "vertical"
|
:orientation "vertical"
|
||||||
:halign "left"
|
:halign "left"
|
||||||
|
:valign "center"
|
||||||
|
:space-evenly false
|
||||||
(label :text track :class "tlabel")
|
(label :text track :class "tlabel")
|
||||||
(label :text artist :class "alabel")
|
(label :text artist :class "alabel")
|
||||||
(box
|
(box
|
||||||
@@ -212,8 +241,8 @@
|
|||||||
:monitor 0
|
:monitor 0
|
||||||
:stacking "bg"
|
:stacking "bg"
|
||||||
:geometry (geometry
|
:geometry (geometry
|
||||||
:width "60%"
|
:width "80%"
|
||||||
:height "40%"
|
:height "50%"
|
||||||
:anchor "center"
|
:anchor "center"
|
||||||
)
|
)
|
||||||
(box
|
(box
|
||||||
@@ -223,7 +252,7 @@
|
|||||||
)
|
)
|
||||||
(box
|
(box
|
||||||
(box :orientation "h" (common-ports))
|
(box :orientation "h" (common-ports))
|
||||||
(box :orientation "v" (clock-dash) (memory))
|
(box :orientation "v" (clock-dash) (mem_circle))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
5
mem_used.sh
Executable file
5
mem_used.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
mem_total=$(awk '/MemTotal/ {print $2}' /proc/meminfo)
|
||||||
|
mem_avail=$(awk '/MemAvailable/ {print $2}' /proc/meminfo)
|
||||||
|
mem_used=$((mem_total - mem_avail))
|
||||||
|
printf "%.0f\n" "$(echo "$mem_used * 100 / $mem_total" | bc -l)"
|
||||||
29
todo.sh
Executable file
29
todo.sh
Executable file
@@ -0,0 +1,29 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
FILE="$HOME/.config/eww/todo.json"
|
||||||
|
|
||||||
|
add() {
|
||||||
|
TEXT="$1"
|
||||||
|
jq --arg text "$TEXT" '. += [{"text": $text, "done": false}]' "$FILE" >"$FILE.tmp" && mv "$FILE.tmp" "$FILE"
|
||||||
|
}
|
||||||
|
|
||||||
|
toggle() {
|
||||||
|
INDEX="$1"
|
||||||
|
jq ".[$INDEX].done |= not" "$FILE" >"$FILE.tmp" && mv "$FILE.tmp" "$FILE"
|
||||||
|
}
|
||||||
|
|
||||||
|
remove() {
|
||||||
|
INDEX="$1"
|
||||||
|
jq "del(.[$INDEX])" "$FILE" >"$FILE.tmp" && mv "$FILE.tmp" "$FILE"
|
||||||
|
}
|
||||||
|
|
||||||
|
list() {
|
||||||
|
cat "$FILE"
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
add) add "$2" ;;
|
||||||
|
toggle) toggle "$2" ;;
|
||||||
|
remove) remove "$2" ;;
|
||||||
|
list) list ;;
|
||||||
|
esac
|
||||||
Reference in New Issue
Block a user