feat: eww bar workspaces new style

This commit is contained in:
hesam-init 2024-06-29 20:47:44 +03:30
parent 59d4681c05
commit ffd6dd5220
6 changed files with 373 additions and 393 deletions

View file

@ -1,5 +1,5 @@
{ {
"files.associations": { "files.associations": {
"*.yuck": "commonlisp" "*.yuck": "clojure"
}, },
} }

View file

@ -1,17 +1,18 @@
.vbar { .vbar {
min-width: 2.4em; min-width: 2.6em;
padding: 0.5em; padding: 0.4em;
background-color: $base; background-color: $base;
.workspaces { .workspaces {
@include widget; @include widget;
padding: 4px;
* { * {
transition: all cubic-bezier(0.165, 0.84, 0.44, 1) 500ms; transition: all cubic-bezier(0.165, 0.84, 0.44, 1) 500ms;
} }
.workspace { .workspace {
margin: 6px; margin: 8px;
border-radius: 4px; border-radius: 4px;
} }

View file

@ -15,13 +15,7 @@ fi
format_file() { format_file() {
local file="$1" local file="$1"
echo "Formatting $file" echo "Formatting $file"
vim -E -s "$file" <<EOF vim -c "execute 'normal! =G' | :wq!" "$file"
:source /path/to/your/yuck.vim
:filetype plugin indent on
:set filetype=yuck
:normal gg=G
:wq
EOF
} }
last_run=0 last_run=0
@ -30,7 +24,7 @@ inotifywait -m -r -e modify,create,delete,move --format '%w%f' "$WATCH_DIR" | wh
if [[ "$file" == *.yuck ]]; then if [[ "$file" == *.yuck ]]; then
current_time=$(date +%s%N | cut -b1-13) current_time=$(date +%s%N | cut -b1-13)
if ((current_time - last_run > 500)); then if ((current_time - last_run > 2500)); then
sleep 0.1 sleep 0.1
if [ -e "$file" ]; then if [ -e "$file" ]; then
format_file $file format_file $file

View file

@ -14,11 +14,12 @@
(defwidget wallpaperselectwidget [] (defwidget wallpaperselectwidget []
(eventbox (eventbox
;; :onhoverlost "${EWW_CMD} close wallpaperselect"
(box (box
:orientation "v" :orientation "v"
:class "unbarwidget" :class "unbarwidget"
:space-evenly false :space-evenly false
(box (box
:orientation "h" :orientation "h"
:space-evenly false :space-evenly false
@ -65,6 +66,4 @@
:orientation "h" :orientation "h"
:space-evenly true :space-evenly true
(label :text "${wall.views} 󰈈") (label :text "${wall.views} 󰈈")
(label :text "${wall.fav} 󰣐") (label :text "${wall.fav} 󰣐")))))))))
))))
))))

View file

@ -12,8 +12,6 @@
(centerbox (centerbox
:class "vbar" :class "vbar"
:orientation "v" :orientation "v"
;; :space-evenly true
(top) (top)
(middle) (middle)
(bottom) (bottom)
@ -38,10 +36,11 @@
:vexpand false :vexpand false
:class "center_modules" :class "center_modules"
:height "180" :height "180"
(playerctl) (playerctl)
)) ))
(defwidget bottom [] (defwidget bottom []
(box (box
:orientation "v" :orientation "v"
:space-evenly false :space-evenly false
@ -55,7 +54,7 @@
; (battery) ; (battery)
)) ))
(defwidget workspaces [] (defwidget workspaces []
(eventbox (eventbox
:cursor "pointer" :cursor "pointer"
:onscroll "./scripts/workspace/set-active {} ${current_workspace}" :onscroll "./scripts/workspace/set-active {} ${current_workspace}"
@ -79,18 +78,14 @@
:duration 500 :duration 500
(box (box
:height 45 :height 45)))
)
)
)
) )
) )
) )
) )
) )
(defwidget home [] (defwidget home []
(box (box
:class "widget" :class "widget"
:hexpand false :hexpand false
@ -102,9 +97,10 @@
:onclick "${EWW_CMD} update revealControlpanel=${ !revealControlpanel }" :onclick "${EWW_CMD} update revealControlpanel=${ !revealControlpanel }"
:onrightclick "${EWW_CMD} open wallpaperselect --toggle" :onrightclick "${EWW_CMD} open wallpaperselect --toggle"
:cursor "pointer" :cursor "pointer"
(label :text "" :halign "center" :class "launchicon" :style "padding: 2px 0px;")))) (label :text "" :halign "center" :class "launchicon" :style "padding: 2px 0px;"))))
(defwidget systemtray [] (defwidget systemtray []
(box (box
:class "widget" :class "widget"
:space-evenly false :space-evenly false
@ -113,7 +109,6 @@
(eventbox (eventbox
:onclick "${EWW_CMD} update revealSystray=${!revealSystray}" :onclick "${EWW_CMD} update revealSystray=${!revealSystray}"
(label :angle {!revealSystray ? 90 : 270} :class "revealtouch" :tooltip "reveal systray" :text "")) (label :angle {!revealSystray ? 90 : 270} :class "revealtouch" :tooltip "reveal systray" :text ""))
(revealer (revealer
:reveal revealSystray :reveal revealSystray
:transition "slideup" :transition "slideup"
@ -123,7 +118,7 @@
)) ))
)) ))
(defwidget clock [] (defwidget clock []
(eventbox (eventbox
:cursor "pointer" :cursor "pointer"
:onclick "${EWW_CMD} open calendar --toggle" :onclick "${EWW_CMD} open calendar --toggle"
@ -131,12 +126,11 @@
:orientation "v" :orientation "v"
:space-evenly false :space-evenly false
:class "widget clock" :class "widget clock"
(label :text thour) (label :text thour)
(label :text tmin) (label :text tmin)
(label :text tpm)))) (label :text tpm))))
(defwidget battery [] (defwidget battery []
(box (box
:orientation "v" :orientation "v"
:space-evenly false :space-evenly false
@ -156,7 +150,7 @@
:text "󱐋")) :text "󱐋"))
(label :text "${EWW_BATTERY.BAT0.capacity}%" :limit-width 3 :show-truncated false))) (label :text "${EWW_BATTERY.BAT0.capacity}%" :limit-width 3 :show-truncated false)))
(defwidget hiddenctl [] (defwidget hiddenctl []
(eventbox (eventbox
:cursor "pointer" :cursor "pointer"
:onclick {reveal3 ? "${EWW_CMD} update reveal3=false" : "${EWW_CMD} update reveal3=true"} :onclick {reveal3 ? "${EWW_CMD} update reveal3=false" : "${EWW_CMD} update reveal3=true"}
@ -182,10 +176,9 @@
(revealer (revealer
:reveal {!reveal3} :reveal {!reveal3}
:transition "slidedown" :transition "slidedown"
;; (tasklist)))))
)))) ))))
(defwidget playerctl [] (defwidget playerctl []
(eventbox (eventbox
:cursor "pointer" :cursor "pointer"
(box (box
@ -193,7 +186,6 @@
:orientation "v" :orientation "v"
:space-evenly true :space-evenly true
:spacing 6 :spacing 6
(eventbox (eventbox
:onclick "${EWW_CMD} open music --toggle" :onclick "${EWW_CMD} open music --toggle"
(image :path { pcover == "" ? "./assets/image/emptympd.png" : pcover } :image-width 20 :image-height 20)) (image :path { pcover == "" ? "./assets/image/emptympd.png" : pcover } :image-width 20 :image-height 20))
@ -204,8 +196,7 @@
(button :onclick "playerctl next" (button :onclick "playerctl next"
(label :class "picon" :text "󰒭")) (label :class "picon" :text "󰒭"))
))) )))
(defwidget sliders []
(defwidget sliders []
(box (box
:class "widget" :class "widget"
:orientation "v" :orientation "v"
@ -214,7 +205,6 @@
:valign "end" :valign "end"
(button :onclick "alacritty -e nmtui" :tooltip wifi_essid (button :onclick "alacritty -e nmtui" :tooltip wifi_essid
(label :class "icon" :style "font-size: 18px;" :text wifi_icon)) (label :class "icon" :style "font-size: 18px;" :text wifi_icon))
(reveal_on_hover (reveal_on_hover
:var revealVolume :var revealVolume
:varname "revealVolume" :varname "revealVolume"
@ -234,7 +224,6 @@
:max 101 :max 101
:min 0 :min 0
:flipped true)) :flipped true))
(reveal_on_hover (reveal_on_hover
:var revealMicrophone :var revealMicrophone
:varname "revealMicrophone" :varname "revealMicrophone"
@ -252,7 +241,6 @@
:max 101 :max 101
:min 0 :min 0
:flipped true)) :flipped true))
(reveal_on_hover (reveal_on_hover
:var revealBrightness :var revealBrightness
:varname "revealBrightness" :varname "revealBrightness"
@ -271,9 +259,8 @@
:min 0 :min 0
:flipped true)) :flipped true))
)) ))
;; other windows
;; other windows (defwindow calendar
(defwindow calendar
:geometry (geometry :x "0" :geometry (geometry :x "0"
:y "0" :y "0"
:width "100" :width "100"
@ -286,8 +273,7 @@
(box (box
:class "unbarwidget" :class "unbarwidget"
(calendar :day calendar_day :year calendar_year :class "cal")))) (calendar :day calendar_day :year calendar_year :class "cal"))))
(defwindow music
(defwindow music
:geometry (geometry :x "0" :geometry (geometry :x "0"
:y "0" :y "0"
:width "440" :width "440"

@ -1 +1 @@
Subproject commit f39d12118656eb34ff64e857bde04250609d78b5 Subproject commit 70cd2cc2b6f50df0af9b117ceb214a543471a603