;; ** ;; ** Widgets config for EWW ;; ** Created by : @adi1090x ;; ** Converted by : @tripleo1 ;; ** ;; ** Variables *********************************************************************** ;; Profile vars (defvar IMAGE "images/profile.png") (defvar NAME "Edoko") (defpoll UNAME :interval "5m" `whoami`) ;; System vars (defpoll HOST :interval "5s" `hostname`) (defpoll CPU_USAGE :interval "1s" `scripts/sys_info --cpu`) (defpoll MEM_USAGE :interval "1s" `scripts/sys_info --mem`) (defpoll BLIGHT :interval "1s" `scripts/sys_info --blight`) (defpoll BATTERY :interval "5s" `scripts/sys_info --bat`) ;; Time vars (defpoll HOUR :interval "5s" `date +\"%I\"`) (defpoll MIN :interval "5s" `date +\"%M\"`) (defpoll MER :interval "5s" `date +\"%p\"`) (defpoll DAY :interval "5s" `date +\"%A\"`) ;; Uptime vars (defpoll UPHOUR :interval "5s" `uptime -p | awk '{print $2 \" \" $3}' | sed 's/,//g'`) (defpoll UPMIN :interval "5s" `uptime -p | awk '{print $4 \" \" $5}'`) ;; Music vars (defpoll SONG :interval "1s" `playerctl metadata --format '{{title}}'`) (defpoll ARTIST :interval "1s" `playerctl metadata --format '{{artist}}`) (defpoll STATUS :interval "1s" `playerctl status | grep -q "Playing" && echo "" || echo ""`) (defpoll CURRENT :interval "1s" `scripts/current`) (defpoll COVER :interval "1s" "~/.config/hypr/Scripts/media-control get_album_art") (defpoll CTIME :interval "1s" `scripts/ctime`) (defpoll TTIME :interval "1s" `scripts/ttime`) ;; Weather vars (defpoll ICON :interval "15m" `scripts/weather_info --icon`) (defpoll STAT :interval "15m" `scripts/weather_info --stat`) (defpoll TEMP :interval "15m" `scripts/weather_info --temp`) (defpoll HEX :interval "15m" `scripts/weather_info --hex`) (defpoll QUOTE :interval "15m" `scripts/weather_info --quote`) (defpoll QUOTE2 :interval "15m" `scripts/weather_info --quote2`) (defpoll CLOCKCOLOR :interval "15m" `scripts/clockcolor $(date +"%H")`) ;; Apps vars (defpoll MAILS :interval "5m" `scripts/mails`) ;; Files vars (defpoll FREE :interval "5s" `df -h / | awk '{print $4}' | tail -n 1 | sed 's/G/GB/'`) ;; ** Widgets ************************************************************************* ;; background (defwidget bg [] (box :class "bg") ) ;; profile (defwidget user [] (box :class "genwin" :orientation "v" :spacing 35 :space-evenly "false" :vexpand "false" :hexpand "false" (box :style "background-image: url('${IMAGE}');" :class "face" :halign "center") (label :class "fullname" :halign "center" :wrap "true" :limit-width 25 :text NAME) (label :class "username" :halign "center" :wrap "true" :limit-width 25 :text UNAME))) ;; system (defwidget system [] (box :class "genwin" :vexpand "false" :hexpand "false" (box :orientation "v" :spacing 35 :halign "center" :valign "center" :space-evenly "false" :vexpand "false" :hexpand "false" (box :class "cpu_bar" :orientation "h" :spacing 20 :space-evenly "false" :vexpand "false" :hexpand "false" (label :class "iconcpu" :text " ") (scale :min 0 :max 100 :value CPU_USAGE :active "false")) (box :class "mem_bar" :orientation "h" :spacing 20 :space-evenly "false" :vexpand "false" :hexpand "false" (label :class "iconmem" :text " ") (scale :min 0 :max 100 :value MEM_USAGE :active "false")) (box :class "bright_bar" :orientation "h" :spacing 20 :space-evenly "false" :vexpand "false" :hexpand "false" (label :class "iconbright" :text " ") (scale :min 0 :max 100 :value BLIGHT :active "false")) (box :class "bat_bar" :orientation "h" :spacing 20 :space-evenly "false" :vexpand "false" :hexpand "false" (label :class "iconbat" :text " ") (scale :min 0 :max 100 :value BATTERY :active "false"))))) ;; clock (defwidget clock [] (box :class "genwin" :orientation "h" :spacing 50 :space-evenly false :vexpand "false" :hexpand "false" (box :orientation "h" :spacing 0 (label :class "time_hour" :valign "start" :wrap "true" :limit-width 25 :text HOUR) (label :class "time_min" :valign "end" :wrap "true" :limit-width 25 :text MIN)) (box :orientation "v" :spacing 0 (label :class "time_mer" :valign "start" :halign "end" :wrap "true" :limit-width 25 :text MER) (label :class "time_day" :valign "end" :halign "end" :wrap "true" :limit-width 25 :text DAY)))) ;; uptime (defwidget uptime [] (box :class "genwin" (box :orientation "h" :halign "center" :spacing 40 :space-evenly "false" :vexpand "false" :hexpand "false" (label :class "icontimer" :valign "center" :text "") (box :orientation "v" :valign "center" :spacing 0 :space-evenly "false" :vexpand "false" :hexpand "false" (label :class "uphour" :halign "start" :wrap "true" :limit-width 25 :text UPHOUR) (label :class "upmin" :halign "start" :wrap "true" :limit-width 25 :text UPMIN))))) ;; Music (defwidget music [] (box :class "genwin" :orientation "h" :space-evenly "false" :vexpand "false" :hexpand "false" (box :class "album_art" :vexpand "false" :hexpand "false" :style "background-image: url('${COVER}');") (box :orientation "v" :spacing 20 :space-evenly "false" :vexpand "false" :hexpand "false" (label :halign "center" :class "song" :wrap "true" :limit-width 20 :text SONG :height 140) (box :orientation "h" :spacing 20 :halign "center" :space-evenly "true" :vexpand "false" :hexpand "false" (button :class "btn_prev" :onclick "scripts/music_info --prev" " ") (button :class "btn_play" :onclick "scripts/music_info --toggle" STATUS) (button :class "btn_next" :onclick "scripts/music_info --next" " ")) (box :class "music_bar" :halign "center" :vexpand "false" :hexpand "false" (scale :onscroll "mpc -q seek +1" :min 0 :active "true" :max 100 :value CURRENT))))) ;; lapce (defwidget lapce [] (box :class "genwin" :orientation "h" :space-evenly "false" :vexpand "false" :hexpand "false" (button :class "app-lapce" :onclick "lapce" :valign "center" :halign "center" :vexpand "false" :hexpand "false" :spacing 72 :style "background-image: url('images/icons/lapce.svg');" ) ) ) ;; duckduckgo (defwidget duckduckgo [] (box :class "genwin" (button :class "app-duckduckgo" :onclick "lapce" :style "background-image: url('images/icons/duckduckgo.svg');") ) ) ;; steam (defwidget steam [] (box :class "genwin" (button :class "app-steam" :onclick "steam -silent" :style "background-image: url('images/icons/steam.svg');") ) ) ;; youtube (defwidget youtube [] (box :class "genwin" (button :class "app-youtube" :onclick "scripts/open_links --youtube" :style "background-image: url('images/icons/youtube.svg');") ) ) ;; mail (defwidget mail [] (box :class "app-mail" (box :orientation "h" :halign "center" :spacing "20" :space-evenly "false" :vexpand "false" :hexpand "false" (button :class "iconmail" :onclick "scripts/open_links --mail" " ") (box :class "mailbox" :space-evenly "false" :vexpand "false" :hexpand "false" (button :class "label_mails" :onclick "scripts/open_links --mail" MAILS))))) ;; weather (defwidget weather [] (box :class "genwin" :style "background-color: ${CLOCKCOLOR}" (box :orientation "v" :spacing 10 :space-evenly "false" :vexpand "false" :hexpand "false" (box :orientation "h" :vexpand "false" :hexpand "false" (label :class "iconweather" :halign "start" :style "color: ${HEX};" :text ICON) (label :class "label_temp" :halign "end" :text TEMP)) (box :orientation "v" :spacing 10 :halign "center" :space-evenly "false" :vexpand "false" :hexpand "false" (label :class "label_stat" :text STAT) (label :class "label_quote" :text QUOTE) (label :class "label_quote" :text QUOTE2))))) ;; apps (defwidget apps [] (box :class "genwin" :orientation "v" :space-evenly "false" :vexpand "false" :hexpand "false" (box :class "appbox" :orientation "h" :space-evenly "false" :vexpand "false" :hexpand "false" (button :style "background-image: url('images/icons/firefox.svg');" :class "app_fox" :onclick "scripts/open_apps --ff") (button :style "background-image: url('images/icons/telegram.svg');" :class "app_telegram" :onclick "scripts/open_apps --tg") (button :style "background-image: url('images/icons/discord.svg');" :class "app_discord" :onclick "scripts/open_apps --dc")) (box :class "appbox" :orientation "h" :space-evenly "false" :vexpand "false" :hexpand "false" (button :style "background-image: url('images/icons/terminal.svg');" :class "app_terminal" :onclick "scripts/open_apps --tr") (button :style "background-image: url('images/icons/files.svg');" :class "app_files" :onclick "scripts/open_apps --fm") (button :style "background-image: url('images/icons/geany.svg');" :class "app_geany" :onclick "scripts/open_apps --ge")) (box :class "appbox" :orientation "h" :space-evenly "false" :vexpand "false" :hexpand "false" (button :style "background-image: url('images/icons/code.svg');" :class "app_code" :onclick "scripts/open_apps --cd") (button :style "background-image: url('images/icons/gimp.svg');" :class "app_gimp" :onclick "scripts/open_apps --gp") (button :style "background-image: url('images/icons/virtualbox.svg');" :class "app_vbox" :onclick "scripts/open_apps --vb")))) ;; power buttons (defwidget logout [] (box :class "genwin" :vexpand "false" :hexpand "false" (button :class "btn_logout" :onclick "loginctl lock-session" ""))) (defwidget sleep [] (box :class "genwin" :vexpand "false" :hexpand "false" (button :class "btn_sleep" :onclick "systemctl suspend" "⏾"))) (defwidget reboot [] (box :class "genwin" :vexpand "false" :hexpand "false" (button :class "btn_reboot" :onclick "systemctl reboot" ""))) (defwidget poweroff [] (box :class "genwin margin-shadow" :vexpand "false" :hexpand "false" (button :class "btn_poweroff" :onclick "systemctl poweroff" ""))) ;; folders (defwidget folders [] (box :class "genwin" :orientation "v" :space-evenly "false" :vexpand "false" :hexpand "false" (box :class "hddbox" :orientation "h" :space-evenly "false" :vexpand "false" :hexpand "false" (box :space-evenly "false" :vexpand "false" :hexpand "false" (button :class "hddicon" :onclick "scripts/open_apps --fm" "") (label :class "fs_sep" :text "|")) (box :space-evenly "false" :vexpand "false" :hexpand "false" (label :class "hdd_label" :wrap "true" :limit-width 25 :text FREE))) (box :orientation "h" :space-evenly "false" :vexpand "false" :hexpand "false" (button :class "iconfolder1" :onclick "scripts/open_folders --docs" " ") (button :class "label_folder1" :onclick "scripts/open_folders --docs" "Documents")) (box :orientation "h" :space-evenly "false" :vexpand "false" :hexpand "false" (button :class "iconfolder2" :onclick "scripts/open_folders --dl" " ") (button :class "label_folder2" :onclick "scripts/open_folders --dl" "Downloads")) (box :orientation "h" :space-evenly "false" :vexpand "false" :hexpand "false" (button :class "iconfolder3" :onclick "scripts/open_folders --music" " ") (button :class "label_folder3" :onclick "scripts/open_folders --music" "Music")) (box :orientation "h" :space-evenly "false" :vexpand "false" :hexpand "false" (button :class "iconfolder4" :onclick "scripts/open_folders --pics" " ") (button :class "label_folder4" :onclick "scripts/open_folders --pics" "Pictures")) (box :orientation "h" :space-evenly "false" :vexpand "false" :hexpand "false" (button :class "iconfolder5" :onclick "scripts/open_folders --cfg" " ") (button :class "label_folder5" :onclick "scripts/open_folders --cfg" "~/.config")) (box :orientation "h" :space-evenly "false" :vexpand "false" :hexpand "false" (button :class "iconfolder6" :onclick "scripts/open_folders --local" " ") (button :class "label_folder6" :onclick "scripts/open_folders --local" "~/.local")))) ;; ** Windows ************************************************************************* ;; background (defwindow background :monitor 0 :stacking "fg" :focusable "false" :screen 1 :geometry (geometry :x 0 :y 0 :width "1920px" :height "1080px") (bg)) ;; profile (defwindow profile :monitor 0 :stacking "fg" :focusable "false" :screen 1 :geometry (geometry :x 140 :y 140 :width 370 :height 460) (user)) ;; system (defwindow system :monitor 0 :stacking "fg" :focusable "false" :screen 1 :geometry (geometry :x 140 :y 595 :width 370 :height 345) (system)) ;; clock (defwindow clock :monitor 0 :stacking "fg" :focusable "false" :screen 1 :geometry (geometry :x 505 :y 140 :width 370 :height 175) (clock)) ;; uptime (defwindow uptime :monitor 0 :stacking "fg" :focusable "false" :screen 1 :geometry (geometry :x 505 :y 310 :width 370 :height 175) (uptime)) ;; music (defwindow music :monitor 0 :stacking "fg" :focusable "false" :screen 1 :geometry (geometry :x 505 :y 480 :width 630 :height 300) (music)) ;; lapce (defwindow lapce :monitor 0 :stacking "fg" :focusable "false" :screen 1 :geometry (geometry :x 505 :y 775 :width 161 :height 165) (lapce)) ;; duckduckgo (defwindow duckduckgo :monitor 0 :stacking "fg" :focusable "false" :screen 1 :geometry (geometry :x 661 :y 775 :width 161 :height 165) (duckduckgo)) ;; steam (defwindow steam :monitor 0 :stacking "fg" :focusable "false" :screen 1 :geometry (geometry :x 817 :y 775 :width 161 :height 165) (steam)) ;; youtube (defwindow youtube :monitor 0 :stacking "fg" :focusable "false" :screen 1 :geometry (geometry :x 973 :y 775 :width 161 :height 165) (youtube)) ;; weather (defwindow weather :monitor 0 :stacking "fg" :focusable "false" :screen 1 :geometry (geometry :x 870 :y 140 :width 570 :height 345) (weather)) ;; apps (defwindow apps :monitor 0 :stacking "fg" :focusable "false" :screen 1 :geometry (geometry :x 1130 :y 480 :width 310 :height 300) (apps)) ;; mail (defwindow mail :monitor 0 :stacking "fg" :focusable "false" :screen 1 :geometry (geometry :x 1130 :y 775 :width 310 :height 165) (mail)) ;; logout (defwindow logout :monitor 0 :stacking "fg" :focusable "false" :screen 1 :geometry (geometry :x 1435 :y 140 :width 175 :height 175) (logout)) ;; sleep (defwindow sleep :monitor 0 :stacking "fg" :focusable "false" :screen 1 :geometry (geometry :x 1605 :y 140 :width 175 :height 175) (sleep)) ;; reboot (defwindow reboot :monitor 0 :stacking "fg" :focusable "false" :screen 1 :geometry (geometry :x 1435 :y 310 :width 175 :height 175) (reboot)) ;; poweroff (defwindow poweroff :monitor 0 :stacking "fg" :focusable "false" :screen 1 :geometry (geometry :x 1605 :y 310 :width 175 :height 175) (poweroff)) ;; folders (defwindow folders :monitor 0 :stacking "fg" :focusable "false" :screen 1 :geometry (geometry :x 1435 :y 480 :width 345 :height 460) (folders))