diff options
| author | srdusr <trevorgray@srdusr.com> | 2022-11-16 16:24:16 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2022-11-16 16:24:16 +0200 |
| commit | e383d2893fc0dfbff4e6207610f3d02ca59f2187 (patch) | |
| tree | d5368fe9c7e273c08665da4ddfa4a12a1f0ebc7b /.config/eww/panel | |
| parent | a4985f2015b7d467e1c342015ea04bb454dc22f4 (diff) | |
| download | dotfiles-e383d2893fc0dfbff4e6207610f3d02ca59f2187.tar.gz dotfiles-e383d2893fc0dfbff4e6207610f3d02ca59f2187.zip | |
Added eww
Diffstat (limited to '.config/eww/panel')
| -rw-r--r-- | .config/eww/panel/drives.yuck | 77 | ||||
| -rw-r--r-- | .config/eww/panel/main.yuck | 142 | ||||
| -rw-r--r-- | .config/eww/panel/style.scss | 69 |
3 files changed, 288 insertions, 0 deletions
diff --git a/.config/eww/panel/drives.yuck b/.config/eww/panel/drives.yuck new file mode 100644 index 0000000..122f0d8 --- /dev/null +++ b/.config/eww/panel/drives.yuck @@ -0,0 +1,77 @@ +(defwidget dock-drives [] + (box + :orientation "v" + (disk + :label "System" + :mount "/" + :space "100" + ) + (disk + :label "SSD 1" + :mount "/mnt/ssd250" + :space "250" + ) + (disk + :label "SSD 2" + :mount "/mnt/games" + :space "250" + ) + (disk + :label "HDD" + :mount "/mnt/hdd500" + :space "500" + ) + (disk + :label "RAID" + :mount "/mnt/raid" + :space "3000" + ) + ) +) + +(defwidget disk [label mount space] + (eventbox + :class "disk-wrapper" + (button + :onclick "quick file ${mount}" + (box + :class "disk" + :space-evenly false + (box + :class "disk-icon" + :width 30 + (image :path "/home/edwin/workspace/icons/hard-drive.svg") + ) + (box + :class "disk-usage" + :orientation "v" + :spacing 3 + :space-evenly false + (box + :class "disk-usage-text" + :width 140 + (box + :halign "start" + :valign "start" + label + ) + (box + :halign "end" + :valign "end" + :hexpand true + :vexpand true + "${round(EWW_DISK[mount].free/1000000000, 0)} GB" + ) + ) + (scale + :class "disk-usage-bar" + :marks "false" + :max 100 + :min 0 + :value {EWW_DISK[mount].used_perc} + ) + ) + ) + ) + ) +) diff --git a/.config/eww/panel/main.yuck b/.config/eww/panel/main.yuck new file mode 100644 index 0000000..ac8b559 --- /dev/null +++ b/.config/eww/panel/main.yuck @@ -0,0 +1,142 @@ +(defwindow panel + :monitor 0 + :geometry (geometry :x 28 :y 0 :anchor "center left") + (panel)) + +(defwidget panel [] + (box + :class "panel" + :orientation "v" + :space-evenly false + (panel-audio) + (panel-video) + ) +) + +; Panel Items + +(defwidget panel-buttons [] + (box + :class "panel-buttons" + :space-evenly false + (children) + ) +) + +(defwidget panel-checkbox [?change text ?value] + (button + :onclick change + (box + :class "panel-checkbox" + :space-evenly false + (icon :name {value ? "check-square" : "square"}) + text + ) + ) +) + +(defwidget panel-slider [icon ?setter ?value] + (eventbox + ;:onscroll setter + (box + :space-evenly false + (icon :name icon) + (scale + :class "panel-slider" + :min 0 + :max 11 + :onchange setter + :value value + ) + ) + ) +) + +; Panel Sections + +(defwidget panel-section [color icon title] + (box + :class "panel-section" + :orientation "v" + :space-evenly false + (box + :class "panel-header" + :spacing 10 + :space-evenly false + (icon :name icon :color color) + title + ) + (box + :orientation "v" + :space-evenly false + :spacing 14 + (children) + ) + ) +) + +(defwidget panel-audio [] + (panel-section + :color "green" + :icon "sliders" + :title "Audio" + + ; audio device + (panel-buttons + (button :onclick "set-output -a pci-0000_00_1b" "Bar") + (button :onclick "set-output -a stereo-game" "Headset") + (button :onclick "set-output -a HD3" "Speakers") + ) + + ; volume slider + (panel-slider + :icon "volume-2" + :setter "set-volume {}" + :value volume + ) + ) +) + +(defwidget panel-video [] + (panel-section + :color "red" + :icon "monitor" + :title "Video" + + ; wallpaper setter + (eventbox + :ondropped "set-wallpaper {}" + (button + :onclick "quick-app -c Thunar -f \ + && thunar /home/edwin/.local/share/backgrounds" + (image + :class "panel-wallpaper" + :path "/home/edwin/.config/wallpaper" + :image-height 108 + :image-width 256 + ) + ) + ) + + ; brightness slider + (panel-slider + :icon "sun" + :setter "set-brightness {}" + :value brightness + ) + + ; external monitor + (panel-checkbox + :change "set-output -e ${!externalMonitor}" + :text "External Monitor" + :value externalMonitor + ) + + ; ultrawide resolution + (panel-checkbox + :change "set-output -u ${!ultrawide}" + :text "Ultrawide Resolution" + :value ultrawide + ) + ) +) diff --git a/.config/eww/panel/style.scss b/.config/eww/panel/style.scss new file mode 100644 index 0000000..0f39959 --- /dev/null +++ b/.config/eww/panel/style.scss @@ -0,0 +1,69 @@ +.panel { + background-color: $borderColor; + padding: $borderSize; + + .button { + background-color: $borderColor; + border-radius: $borderRadius; + margin-left: 10; + padding: 8; + + &:first-child { + margin-left: 0; + } + } +} + +.panel-buttons { + button { + background-color: $borderColor; + border-radius: $borderRadius; + margin-left: 14; + padding: 7 9; + + &:first-child { + margin-left: 0; + } + } +} + +.panel-checkbox { + image { + margin-right: 10; + } +} + +.panel-header { + margin-bottom: 14; +} + +.panel-section { + background-color: $bgColor; + border-radius: $borderRadius; + margin-top: $borderSize; + padding: 14; + + &:first-child { + margin-top: 0; + } +} + +.panel-slider { + margin-left: 10; + + trough { + background-color: $borderColor; + border-radius: 5; + min-height: 10px; + min-width: 232px; + + highlight { + border-radius: 5; + background-color: #414868; + } + } +} + +.panel-wallpaper { + border: 3px solid $borderColor; +} |
