feat: desktop config as base

This commit is contained in:
Fabio Lenherr / DashieTM 2022-12-31 14:50:10 +01:00
parent d589775634
commit 7dba0b18be
34 changed files with 1148 additions and 890 deletions

View file

@ -1,17 +1,11 @@
;; date definitions ;;
(defpoll clock_time :interval "5m" "date +\%I")
(defpoll clock_time :interval "1m" "date +\%I")
(defpoll clock_minute :interval "5s" "date +\%M")
(defpoll clock_date :interval "10h" "date '+%d/%m'")
(defpoll clock_date :interval "1h" "date '+%d/%m'")
;; volume definitions ;;
(defpoll volume_percent :interval "1s" "pactl get-sink-volume @DEFAULT_SINK@ | awk -F '/' ' { print $2 } ' | tr -d ' %'")
(defpoll mic_percent :interval "1s" "pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '{ print $2 }' | tr -d ' %'")
(defpoll brightness_percent :interval "5s" "brightnessctl -m -d intel_backlight | awk -F, '{print substr($4, 0, length($4)-1)}' | tr -d '%'")
;; battery definitions ;;
(defpoll battery_status :interval "5s" "./scripts/battery stat")
(defpoll battery-capacity :interval "5s" "scripts/battery percent")
(defpoll battery :interval "5s" "scripts/battery icon")
;; memory definitions ;;
(defpoll memory :interval "15s" "scripts/memory")
@ -19,30 +13,22 @@
(defpoll memory_total_mb :interval "2m" "scripts/mem-ad total")
(defpoll memory_free_mb :interval "2m" "scripts/mem-ad free")
;; wifi definitions ;;
(defpoll COL_WLAN :interval "1m" "~/.config/eww/scripts/wifi --COL")
(defpoll ESSID_WLAN :interval "1m" "~/.config/eww/scripts/wifi --ESSID")
(defpoll WLAN_ICON :interval "1m" "~/.config/eww/scripts/wifi --ICON")
;; music definitions ;;
(defpoll Song_info :interval "2s" "scripts/music_control")
(defpoll Thumbnail :interval "2s" "scripts/music_control2")
;; current window ;;
;;(defpoll currentWindow :interval "100ms" "hyprctl activewindow | grep class | awk -F ':' '{ print $2 }'")
;; calendar definitions ;;
(defpoll calendar_day :interval "20h" "date '+%d'")
(defpoll calendar_year :interval "20h" "date '+%Y'")
;; Weather vars
(defpoll weather-interval :interval "20m" "scripts/weather")
(defpoll weather-icon :interval "20m" "cat ~/.cache/weather/weather-icon")
(defpoll temperature :interval "20m" "cat ~/.cache/weather/weather-degree")
(defpoll weather-hex :interval "20m" "cat ~/.cache/weather/weather-hex")
(defpoll weather-stat :interval "20m" "cat ~/.cache/weather/weather-stat")
(defpoll weather-stat-side :interval "20m" "~/.config/eww/scripts/weather-trimmer")
(defpoll weather-quote :interval "20m" "~/.config/eww/scripts/getwethquote")
(defpoll weather-icon :interval "21m" "cat ~/.cache/weather/weather-icon")
(defpoll temperature :interval "21m" "cat ~/.cache/weather/weather-degree")
(defpoll weather-hex :interval "21m" "cat ~/.cache/weather/weather-hex")
(defpoll weather-stat :interval "21m" "cat ~/.cache/weather/weather-stat")
(defpoll weather-stat-side :interval "21m" "~/.config/eww/scripts/weather-trimmer")
(defpoll weather-quote :interval "21m" "~/.config/eww/scripts/getwethquote")
(defpoll weather-quote2 :interval "21m" "~/.config/eww/scripts/getwethquote2")
;; simple variables ;;
(defvar eww "$HOME/.local/bin/eww -c $HOME/.config/eww")
@ -51,45 +37,21 @@
(defvar music_reveal false)
(defvar wifi_rev false)
(defvar time_rev false)
(defvar current_monitor 0)
(deflisten workspace "scripts/workspace")
(deflisten currentName "scripts/current_name")
;; widgets
;; wifi ;;
(defwidget wifi []
(eventbox :onhover "${eww} update wifi_rev=true"
:onhoverlost "${eww} update wifi_rev=false"
(box :vexpand "false" :hexpand "false" :space-evenly "false"
(button :class "module-wif" :onclick "hyprctl dispatch exec 'alacritty -e nmtui'" :wrap "false" :limit-width 12 :style "color: ${COL_WLAN};" WLAN_ICON)
(revealer :transition "slideright"
:reveal wifi_rev
:duration "350ms"
(button :class "module_essid" :onclick "hyprctl dispatch exec 'alacritty -e nmtui'" :wrap "false" :limit-width 12 :style "color: ${COL_WLAN};" ESSID_WLAN)))))
(defwidget bluetooth []
(box :vexpand "false" :hexpand "false" :space-evenly "false"
(button :class "module-wif" :onclick "hyprctl dispatch exec 'blueman-manager'" :wrap "false" :limit-width 12 :style "color: ${COL_WLAN};" "")
(button :class "module-blu" :onclick "hyprctl dispatch exec 'blueman-manager'" :wrap "false" :limit-width 12 "")
))
;; workspaces ;;
(defwidget workspaces []
(literal :content workspace))
;; Battery ;;
(defwidget bat []
(box :class "bat_module" :vexpand "false" :hexpand "false"
(button
:class "iconbat"
:tooltip "Battery: ${battery-capacity}%"
:show_truncated false
:onclick "$HOME/.config/eww/scripts/pop system"
:wrap false
"${battery}")))
;; memory ;;
(defwidget mem []
(box :class "mem_module" :vexpand "false" :hexpand "false"
@ -104,7 +66,6 @@
(label :class "mem_padding" :text "")
))))
;; seperator ;;
(defwidget sep []
(box :class "module-2" :vexpand "false" :hexpand "false"
@ -128,52 +89,8 @@
;; speaker volume ;;
(defwidget volume []
;;(eventbox :onhover "${eww} update vol_reveal=true"
;; :onhoverlost "${eww} update vol_reveal=false"
(box :class "module-2" :space-evenly "false" :orientation "h" :spacing "3"
(button :onclick "scripts/pop audio" :class "volume_icon" "")))
;;(revealer :transition "slideleft"
;; :reveal vol_reveal
;; :duration "350ms"
;;(scale :class "volbar"
;; :value volume_percent
;; :orientation "h"
;; :tooltip "${volume_percent}%"
;; :max 100
;; :min 0
;; :onchange "scripts/change-volume sink {}%" )))
;; screen brightness ;;
(defwidget bright []
;;(eventbox :onhover "${eww} update br_reveal=true" :onhoverlost "${eww} update br_reveal=false"
(box :class "module-2" :space-evenly "false" :orientation "h" :spacing "3"
(button :onclick "scripts/pop brightness" :class "bright_icon" "")))
;;(revealer :transition "slideleft"
;; :reveal br_reveal
;; :duration "350ms"
;; (scale :class "brightbar"
;; :value brightness_percent
;; :orientation "h"
;; :tooltip "${brightness_percent}%"
;; :max 100
;; :min 0
;; :onchange "brightnessctl set {}%" )))
;; brightness widget ;;
(defwidget brightness_overlay []
(eventbox :onhover "scripts/pop hoverCreate"
:onhoverlost "scripts/pop hoverGet brightness_window"
(box :class "audio-box" :halign "center" :orientation "v" :vexpand "false" :hexpand "false"
(label :class "speaker_text" :text "brightness" :halign "left" )
(box :class "brightbar" :halign "center" :vexpand "false" :hexpand "false"
(label :class "bright_icon_overlay" :text "")
(scale :value brightness_percent
:space-evenly "false"
:orientation "h"
:onchange "brightnessctl set {}%"
:tooltip "brightness on ${brightness_percent}%"
:max 100
:min 0)))))
;; audio volume widget ;;
(defwidget audio []
@ -205,19 +122,6 @@
:onchange "pactl set-source-volume @DEFAULT_SOURCE@ {}%"
:max 100
:min 0))))
(label :text "" :class "audio_sep" :halign "center")
(box :halign "center" :space-evenly "false" :hexpand "false" :vexpand "false"
(label :class "bright_icon_overlay" :orientation "v" :text "")
(box :orientation "v" :halign "center" :vexpand "false" :hexpand "false"
(label :class "bright_text" :text "lux" :valign "center" :halign "right" )
(box :class "brightbar" :halign "center" :vexpand "false" :hexpand "false"
(scale :value brightness_percent
:space-evenly "false"
:orientation "h"
:tooltip "brightness ${brightness_percent}%"
:onchange "brightnessctl set {}%"
:max 100
:min 0))))
(label :text "" :class "audio_sep" :halign "center")
(box :class "change_audio_box" :halign "center" :spac`e-evenly "false" :hexpand "false" :vexpand "false"
(box :class "change_audio" :orientation "v" :halign "left"
@ -226,21 +130,6 @@
(button :onclick "scripts/change-audio bluetooth" ""))
))))
;; Music ;;
;;(defwidget music []
;; (eventbox :onhover "${eww} update music_reveal=true"
;;;; :onhoverlost "${eww} update music_reveal=false"
;; (box :class "module-2" :orientation "h" :space-evenly "false" :vexpand "false" :hexpand "false"
;; (box :class "song_cover_art" :vexpand "false" :hexpand "false" :style "background-image: url('${cover_art}');")
;; (button :class "song" :wrap "true" :onclick "~/.config/eww/scripts/pop music" song)
;; (revealer :transition "slideright"
;; :reveal music_reveal
;; :duration "350ms"
;; (box :vexpand "false" :hexpand "false" :oreintation "h"
;; (button :class "song_btn_prev" :onclick "~/.config/eww/scripts/music_info --prev" "")
;; (button :class "song_btn_play" :onclick "~/.config/eww/scripts/music_info --toggle" song_status)
;; (button :class "song_btn_next" :onclick "~/.config/eww/scripts/music_info --next" ""))))))
(defwidget cname []
(literal :content currentName))
@ -254,54 +143,10 @@
:day calendar_day
:year calendar_year)))))
;; Music again.. ;;
;;(defwidget music_pop []
;; (box :class "music_pop" :orientation "h" :space-evenly "false" :vexpand "false" :hexpand "false"
;; (box :class "music_cover_art" :vexpand "false" :hexpand "false" :style "background-image: url('${cover_art}');")
;; (box :orientation "v" :spacing 20 :space-evenly "false" :vexpand "false" :hexpand "false"
;; (label :halign "center" :class "music" :wrap "true" :limit-width 13 :text song)
;; (label :halign "center" :class "music_artist" :wrap "true" :limit-width 15 :text song_artist)
;; (box :orientation "h" :spacing 15 :halign "center" :space-evenly "false" :vexpand "false" :hexpand "false"
;; (button :class "music_btn_prev" :onclick "~/.config/eww/scripts/music_info --prev" "")
;; (button :class "music_btn_play" :onclick "~/.config/eww/scripts/music_info --toggle" song_status)
;; (button :class "music_btn_next" :onclick "~/.config/eww/scripts/music_info --next" ""))
;; (box :class "music_bar" :halign "center" :vexpand "false" :hexpand "false" :space-evenly "false"
;; (scale :onscroll "mpc -q seek {}" :min 0 :active "true" :max 100 :value current_status)))))
(defwidget system []
(eventbox :onhover "scripts/pop hoverCreate"
:onhoverlost "scripts/pop hoverGet system"
(box :class "sys_win" :orientation "v" :space-evenly "false" :hexpand "false" :vexpand "false" :spacing 0
(box :class "sys_bat_box" :orientation "h" :space-evenly "false"
(circular-progress :value battery-capacity
:class "sys_bat"
:thickness 9
(label :text ""
:class "sys_icon_bat"
:limit-width 2
:show_truncated false
:wrap false))
(box :orientation "v" :space-evenly "false" :spacing 0 :hexpand "false" :vexpand "false"
(label :text "battery"
:halign "start"
:class "sys_text_bat"
:limit-width 9
:show_truncated false
:wrap false)
(label :text "${battery-capacity}%"
:halign "start"
:class "sys_text_bat_sub"
:limit-width 22
:show_truncated false
:wrap false)
(label :text "${battery_status}"
:halign "start"
:class "sys_text_bat_sub"
:limit-width 22
:show_truncated false
:wrap false)))
(label :text "" :class "sys_sep" :halign "center")
(box :class "sys_mem_box" :orientation "h" :space-evenly "false" :halign "start"
(circular-progress :value memory
:class "sys_mem"
@ -389,10 +234,8 @@
:halign "end"
:class "left_modules"
(volume)
(wifi)
(bluetooth)
(sep)
(bat)
(mem)
(sep)
(clock_module)))
@ -421,6 +264,9 @@
(center)
(left)
))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Drawing Windows ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -441,25 +287,10 @@
:y "2px"
:anchor "top right"
:width "250px"
:height "330px")
:height "230px")
:stacking "overlay"
(audio))
(defwindow brightness_window
:monitor 0
:geometry (geometry :x "250px"
:y "2px"
:anchor "top right"
:width "280px"
:height "60px")
:stacking "overlay"
(brightness_overlay))
;; music again .. ;;
;; (defwindow music_win :stacking "fg" :focusable "false" :screen 1
;; :geometry (geometry :x "0" :y "7%" :width 428 :height 104 :anchor "top center")
;; (music_pop))
(defwindow system
:monitor 0
:geometry (geometry :x "50px"
@ -475,20 +306,47 @@
:monitor 0
:geometry (geometry :x "0%"
:y "1px"
:width "99%"
:width "3417px"
:height "20px"
:anchor "top center")
:stacking "bg"
:stacking "bottom"
:wm-ignore false
:exclusive true
(bar_1))
;; draw the bar ;;
(defwindow cockpit_window
;; draw the cockpit monitor 0 ;;
(defwindow cockpit_window_0
:monitor 0
:geometry (geometry
:geometry (geometry :x "1470px"
:y "420px"
:width "600px"
:height "500px"
:height "400px"
:anchor "center")
:stacking "overlay"
:wm-ignore false
:exclusive true
(cockpit))
;; draw the cockpit monitor 1 ;;
(defwindow cockpit_window_1
:monitor 1
:geometry (geometry
:width "600px"
:height "400px"
:anchor "center")
:stacking "overlay"
:wm-ignore false
:exclusive true
(cockpit))
;; draw the cockpit monitor 2 ;;
(defwindow cockpit_window_2
:monitor 2
:geometry (geometry
:width "600px"
:height "400px"
:anchor "center")
:stacking "overlay"
:wm-ignore false