feat: formatter

This commit is contained in:
hesam-init 2024-06-29 16:05:09 +03:30
parent bf9e720177
commit 9cca7e76c2
3 changed files with 359 additions and 319 deletions

View file

@ -4,15 +4,15 @@
@import "./assets/scss/windows/vbar.scss";
@import "./assets/src/control-panel/styles.scss";
@import "./src/control-panel/styles.scss";
@import "./assets/src/dashboard/styles.scss";
@import "./src/dashboard/styles.scss";
@import "./assets/src/dock/styles.scss";
@import "./src/dock/styles.scss";
@import "./assets/src/desktop/styles.scss";
@import "./src/desktop/styles.scss";
@import "./assets/src/notification/styles.scss";
@import "./src/notification/styles.scss";
* {
all: unset;

View file

@ -1 +1,41 @@
echo "Shit"
#!/bin/bash
WATCH_DIR="$(pwd)"
if [ -z "$WATCH_DIR" ]; then
echo "Usage: $0 <directory>"
exit 1
fi
if [ ! -d "$WATCH_DIR" ]; then
echo "Directory $WATCH_DIR does not exist."
exit 1
fi
format_file() {
local file="$1"
echo "Formatting $file"
vim -E -s "$file" <<EOF
:source /path/to/your/yuck.vim
:filetype plugin indent on
:set filetype=yuck
:normal gg=G
:wq
EOF
}
last_run=0
inotifywait -m -r -e modify,create,delete,move --format '%w%f' "$WATCH_DIR" | while read -r file; do
if [[ "$file" == *.yuck ]]; then
current_time=$(date +%s%N | cut -b1-13)
if ((current_time - last_run > 500)); then
sleep 0.1
if [ -e "$file" ]; then
format_file $file
fi
last_run=$current_time
fi
fi
done

View file

@ -40,7 +40,7 @@
(playerctl)
))
(defwidget bottom []
(defwidget bottom []
(box
:orientation "v"
:space-evenly false
@ -54,7 +54,7 @@
; (battery)
))
(defwidget workspaces []
(defwidget workspaces []
(eventbox
:cursor "pointer"
:onscroll "./scripts/workspace/set-active {} ${current_workspace}"
@ -89,7 +89,7 @@
)
)
(defwidget home []
(defwidget home []
(box
:class "widget"
:hexpand false
@ -103,7 +103,7 @@
:cursor "pointer"
(label :text "" :halign "center" :class "launchicon" :style "padding: 2px 0px;"))))
(defwidget systemtray []
(defwidget systemtray []
(box
:class "widget"
:space-evenly false
@ -122,7 +122,7 @@
))
))
(defwidget clock []
(defwidget clock []
(eventbox
:cursor "pointer"
:onclick "${EWW_CMD} open calendar --toggle"
@ -135,7 +135,7 @@
(label :text tmin)
(label :text tpm))))
(defwidget battery []
(defwidget battery []
(box
:orientation "v"
:space-evenly false
@ -155,7 +155,7 @@
:text "󱐋"))
(label :text "${EWW_BATTERY.BAT0.capacity}%" :limit-width 3 :show-truncated false)))
(defwidget hiddenctl []
(defwidget hiddenctl []
(eventbox
:cursor "pointer"
:onclick {reveal3 ? "${EWW_CMD} update reveal3=false" : "${EWW_CMD} update reveal3=true"}
@ -184,7 +184,7 @@
;; (tasklist)))))
))))
(defwidget playerctl []
(defwidget playerctl []
(eventbox
:cursor "pointer"
(box
@ -204,7 +204,7 @@
(label :class "picon" :text "󰒭"))
)))
(defwidget sliders []
(defwidget sliders []
(box
:class "widget"
:orientation "v"
@ -271,8 +271,8 @@
:flipped true))
))
;; other windows
(defwindow calendar
;; other windows
(defwindow calendar
:geometry (geometry :x "0"
:y "0"
:width "100"
@ -286,7 +286,7 @@
:class "unbarwidget"
(calendar :day calendar_day :year calendar_year :class "cal"))))
(defwindow music
(defwindow music
:geometry (geometry :x "0"
:y "0"
:width "440"