├── LICENSE
├── README.md
├── bar-concept
├── .github
│ └── preview.gif
├── README.md
├── eww.scss
└── eww.yuck
├── collapsed-scales-concept
├── .github
│ └── preview.gif
├── README.md
├── eww.scss
└── eww.yuck
├── drag-drop-clipboard
├── .github
│ └── preview.gif
├── README.md
├── eww.scss
├── eww.yuck
└── update-file-list.py
├── hover-switch-example
├── .github
│ └── preview.gif
├── README.md
├── eww.scss
└── eww.yuck
├── notification-revealer
├── .github
│ └── preview.gif
├── README.md
├── eww.yuck
└── notifications.sh
├── polybar-replacement
├── .github
│ └── preview.png
├── README.md
├── eww.scss
├── eww.yuck
└── modules
│ ├── github.sh
│ ├── microphone.sh
│ ├── noisetorch.sh
│ ├── notifications.sh
│ ├── nvidia.sh
│ ├── ping.sh
│ ├── player.sh
│ ├── speaker.sh
│ ├── trash.sh
│ ├── updates.sh
│ └── workspaces.sh
├── revealer-example
├── .github
│ └── preview.gif
├── README.md
├── eww.scss
└── eww.yuck
├── revealer-hover-module
├── .github
│ └── preview.gif
├── README.md
├── eww.scss
└── eww.yuck
├── simpler-bar
├── .github
│ └── preview.png
├── eww.scss
├── eww.yuck
└── modules
│ ├── camera.sh
│ ├── listen-mic.sh
│ ├── listen-volume.sh
│ ├── sway-workspaces.py
│ └── wifi.sh
└── workspace-indicator
├── .github
└── preview.png
├── README.md
├── eww.scss
├── eww.yuck
└── res
└── rhombus.png
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Pedro Burgos
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # eugh
2 | The different [eww](https://github.com/elkowar/eww) configs that I've been making
3 |
4 |
5 |
6 |
7 | Simpler Bar (My most recent bar)
8 |
9 |
10 |
11 |
12 |
13 | Polybar Replacement
14 |
15 |
16 |
17 |
18 |
19 | Workspace Indicator
20 |
21 |
22 |
23 |
24 |
25 | Drag and Drop Clipboard
26 |
27 |
28 |
29 |
30 |
31 | Revealer Example
32 |
33 |
34 |
35 |
36 |
37 | Notification Revealer
38 |
39 |
40 |
41 |
42 |
43 | Hover Switch
44 |
45 |
46 |
47 |
48 |
49 | Revealer Hover Module
50 |
51 |
52 |
53 |
54 |
55 | Collapsed Scales Concept
56 |
57 |
58 |
59 |
60 |
61 | Bar Concept
62 |
63 |
64 | ## See also
65 | [My dotfiles](https://github.com/druskus20/dots) (for the most uppdated version of my current eww config)
66 |
--------------------------------------------------------------------------------
/bar-concept/.github/preview.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/druskus20/eugh/987f9272725f9d50c58854c4da094458a97d947d/bar-concept/.github/preview.gif
--------------------------------------------------------------------------------
/bar-concept/README.md:
--------------------------------------------------------------------------------
1 | # Bar Concept
2 |
3 | This is a concept that showcases how different modules
4 | could make use of revealers
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/bar-concept/eww.scss:
--------------------------------------------------------------------------------
1 | $foreground: #ffffff;
2 | $grey: #aaaaaa;
3 | $foreground-alt: #465059;
4 | $background: #0e1419;
5 | $black: #000000;
6 | $red: #ff6565;
7 | $green: #b8cc52;
8 | $yellow: #e6c446;
9 | $blue: #68d4ff;
10 | $magenta: #ffa3aa;
11 | $cyan: #36a3d9;
12 | $white: #ffffff;
13 |
14 | * {
15 | all: unset;
16 | font-size: 20px;
17 | }
18 |
19 | scale trough {
20 | all: unset;
21 | background-color: $grey;
22 | border-radius: 50px;
23 | min-height: 10px;
24 | min-width: 100px;
25 | margin: 0 20px 0 20px;
26 | }
27 |
28 | scale trough highlight {
29 | all: unset;
30 | background-color: $red;
31 | border-radius: 10px;
32 | }
33 |
34 | .cpus {
35 | margin: 0 20px 0 20px;
36 | label {
37 | margin: 0 2px 0 2px;
38 | }
39 | }
40 |
41 |
42 |
43 | .bar {
44 | // padding: 5px
45 | }
46 | .hover-module {
47 | .icon, .content {
48 | padding: 10px;
49 | background: $red;
50 | }
51 | }
52 |
53 | .hover-module .eventbox {
54 | color: #000000;
55 |
56 | }
57 |
58 | .hover-module .eventbox:hover {
59 | color: $foreground;
60 | }
61 |
62 | // Test
63 | .test-box {
64 | background-color: #2a2a2a;
65 | }
66 | .test-box.red {
67 | background-color: red;
68 | }
69 | .test-box.blue {
70 | background-color: blue;
71 | }
72 | .test-box.green {
73 | background-color: green;
74 | }
75 |
--------------------------------------------------------------------------------
/bar-concept/eww.yuck:
--------------------------------------------------------------------------------
1 | (defwindow test
2 | :monitor 0
3 | :hexpand false
4 | :vexpand false
5 | :geometry (geometry :anchor "top left" :x 350 :y 30 :width "500px" :height "30px")
6 | (box :class "bar"
7 | :space-evenly false
8 | :halign "end"
9 | (hover-slider-module :var reveal3 :varname "reveal3"
10 | (box :class "cpus"
11 | (label :text "▁")
12 | (label :text "▃")
13 | (label :text "▂")
14 | (label :text "▃")
15 | (label :text "▅")
16 | (label :text "▅")
17 | (label :text "▃")
18 | (label :text "▃")
19 | (label :text "▅")
20 | (label :text "▃")
21 | (label :text "▃")
22 | (label :text "▅")
23 | (label :text "▃")
24 | (label :text "▇"))
25 | (label :class "icon" :text ""))
26 | (hover-slider-module :var reveal1 :varname "reveal1"
27 | (scale :value 5 :max 10 :min 0)
28 | (label :class "icon" :text ""))
29 | (hover-slider-module :var reveal2 :varname "reveal2"
30 | (scale :value 5 :max 10 :min 0)
31 | (label :class "icon" :text ""))
32 | (hover-module :var reveal4 :varname "reveal4"
33 | (label :class "icon" :text "")
34 | (label :class "content" :text "3"))))
35 |
36 | (defvar reveal1 false)
37 | (defvar reveal2 false)
38 | (defvar reveal3 false)
39 | (defvar reveal4 false)
40 | (defvar eww "eww") ; for testing
41 |
42 | ; Revealer on hover, using children
43 | (defwidget revealer-on-hover [var varname ?duration ?transition]
44 | (eventbox :class "eventbox"
45 | :onhover "${eww} update ${varname}=true"
46 | :onhoverlost "${eww} update ${varname}=false"
47 | (box :space-evenly false
48 | (revealer :reveal var
49 | :transition {transition ?: "slideright"}
50 | :duration {duration ?: "500ms"}
51 | (children :nth 0))
52 | (children :nth 1))))
53 |
54 | (defwidget hover-slider-module [var varname ?class]
55 | (box :space-evenly false
56 | :class "hover-module ${class}"
57 | (revealer-on-hover :var var
58 | :varname "${varname}"
59 | :duration "300ms"
60 | (children :nth 0)
61 | (children :nth 1))))
62 |
63 | (defwidget hover-switch [var varname ?duration ?transition]
64 | (eventbox :class "eventbox"
65 | :onhover "${eww} update ${varname}=true"
66 | :onhoverlost "${eww} update ${varname}=false"
67 | (box
68 | :orientation "v"
69 | :valign "center"
70 | :space-evenly false
71 | (revealer :reveal {!var}
72 | :duration {duration ?: "500ms"}
73 | :transition {transition ?: "slideup"}
74 | (children :nth 0))
75 | (revealer :reveal {var}
76 | :duration {duration ?: "500ms"}
77 | :transition {transition ?: "slideup"}
78 | (children :nth 1)))))
79 |
80 | (defwidget hover-module [var varname ?class]
81 | (box :space-evenly false
82 | :class "hover-module ${class}"
83 | (hover-switch :var var
84 | :varname "${varname}"
85 | :duration "300ms"
86 | (children :nth 0)
87 | (children :nth 1))))
88 |
89 |
--------------------------------------------------------------------------------
/collapsed-scales-concept/.github/preview.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/druskus20/eugh/987f9272725f9d50c58854c4da094458a97d947d/collapsed-scales-concept/.github/preview.gif
--------------------------------------------------------------------------------
/collapsed-scales-concept/README.md:
--------------------------------------------------------------------------------
1 | # Collapsed Scales Concept
2 |
3 | This is a concept for a way to have scale (slider) modules that dont take
4 | a lot of space
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/collapsed-scales-concept/eww.scss:
--------------------------------------------------------------------------------
1 | $foreground: #ffffff;
2 | $grey: #aaaaaa;
3 | $foreground-alt: #465059;
4 | $background: #0e1419;
5 | $black: #000000;
6 | $red: #ff6565;
7 | $green: #b8cc52;
8 | $yellow: #e6c446;
9 | $blue: #68d4ff;
10 | $magenta: #ffa3aa;
11 | $cyan: #36a3d9;
12 | $white: #ffffff;
13 |
14 | * {
15 | all: unset;
16 | font-size: 20px;
17 | }
18 |
19 | scale trough {
20 | all: unset;
21 | background-color: $grey;
22 | border-radius: 50px;
23 | min-height: 10px;
24 | min-width: 100px;
25 | margin: 0 20px 0 20px;
26 | }
27 | scale trough highlight {
28 | all: unset;
29 | background-color: $red;
30 | border-radius: 10px;
31 | }
32 |
33 |
34 | .bar {
35 | // padding: 5px
36 | }
37 | .hover-module {
38 | .icon, .hovered-sign, .revealed-content {
39 | padding: 10px;
40 | }
41 |
42 | .icon, .hovered-sign {
43 | background: $red;
44 | }
45 |
46 | .revealed-content {
47 | background: $magenta;
48 | }
49 | }
50 |
51 | .hover-module .eventbox {
52 | color: #000000;
53 |
54 | }
55 | .hover-module .eventbox:hover {
56 | color: $foreground;
57 | }
58 |
59 | // Test
60 | .test-box {
61 | background-color: #2a2a2a;
62 | }
63 | .test-box.red {
64 | background-color: red;
65 | }
66 | .test-box.blue {
67 | background-color: blue;
68 | }
69 | .test-box.green {
70 | background-color: green;
71 | }
72 |
--------------------------------------------------------------------------------
/collapsed-scales-concept/eww.yuck:
--------------------------------------------------------------------------------
1 | (defwindow test
2 | :monitor 0
3 | :hexpand false
4 | :vexpand false
5 | :geometry (geometry :anchor "top left" :x 350 :y 30 :width "300px" :height "30px")
6 | (box :class "bar"
7 | :space-evenly false
8 | :halign "end"
9 | (hover-module :vara reveal1 :varname "reveal1" :icon "")
10 | (hover-module :vara reveal2 :varname "reveal2" :icon "")))
11 |
12 | (defvar icono "Wo")
13 |
14 | (defvar reveal1 false)
15 | (defvar reveal2 false)
16 | (defvar eww "eww -c ~/.config/eww-testing")
17 |
18 | ; Revealer on hover, using children
19 | (defwidget revealer-on-hover [var varname ?class ?duration ?transition]
20 | (box :class "${class} revealer-on-hover"
21 | :orientation "h"
22 | :space-evenly false
23 | (eventbox :class "eventbox"
24 | :onhover "${eww} update ${varname}=true"
25 | :onhoverlost "${eww} update ${varname}=false"
26 | (box :space-evenly false
27 | (revealer :reveal var
28 | :transition {transition ?: "slideright"}
29 | :duration {duration ?: "500ms"}
30 | (children :nth 0))
31 | (children :nth 1)))))
32 |
33 | (defwidget hover-module [vara varname icon ?class]
34 | (box :space-evenly false
35 | :class "hover-module ${class}"
36 | (revealer-on-hover :var vara
37 | :varname "${varname}"
38 | :icon icon ; BUG: We need to pass icon so that the children widget can find it
39 | :transition "slideleft"
40 | (scale :value 5 :max 10 :min 0)
41 | (label :class "icon"
42 | :text icon))))
43 |
44 | (defwidget test-box [?color]
45 | (box :class "${color} test-box"
46 | :orientation "h"
47 | :halign "start"
48 | :hexpand false
49 | :space-evenly false
50 | :width 50))
51 |
--------------------------------------------------------------------------------
/drag-drop-clipboard/.github/preview.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/druskus20/eugh/987f9272725f9d50c58854c4da094458a97d947d/drag-drop-clipboard/.github/preview.gif
--------------------------------------------------------------------------------
/drag-drop-clipboard/README.md:
--------------------------------------------------------------------------------
1 | # Drag and Drop Clipboard
2 |
3 | This is a proof-of-concept for a drag and drop clipboard area.
4 |
5 | NOTE: This example makes use of the `loop_widget` and `droptarget` branches
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/drag-drop-clipboard/eww.scss:
--------------------------------------------------------------------------------
1 | * {
2 | all: unset;
3 | }
4 |
5 | .clipboard {
6 | background-color: #707070;
7 | padding: 10px;
8 | }
9 |
10 | .files {
11 | background-color: blue;
12 | margin: 10px;
13 | }
14 | .file {
15 | margin: 10px;
16 | background-color: green;
17 | }
18 |
--------------------------------------------------------------------------------
/drag-drop-clipboard/eww.yuck:
--------------------------------------------------------------------------------
1 | ; Note: there are definitely some rough edges here, this is just a proof of concept
2 |
3 | (defwindow bar
4 | :monitor 0
5 | :geometry (geometry :anchor "top left" :x 350 :y 50 :width "200px" :height "100px")
6 | (box :class "top"
7 | (clipboard)))
8 |
9 | (defvar file_list "")
10 |
11 | (defwidget clipboard []
12 | (eventbox
13 | :class "clipboard"
14 | ;:ondropped "${eww_command} update tmp_value={}"
15 | :ondropped "./update-file-list.py {}"
16 | :dragvalue {file_list}
17 | (files :file_list file_list)))
18 |
19 |
20 | (defwidget files [file_list]
21 | (box :class "files"
22 | (for f in file_list
23 | (file :file f))))
24 |
25 |
26 | (defwidget file [file]
27 | (eventbox :class "file"
28 | :ondropped "./update-file-list.py {}"
29 | :dragvalue {file}
30 | (label :text file)))
31 |
32 |
33 |
--------------------------------------------------------------------------------
/drag-drop-clipboard/update-file-list.py:
--------------------------------------------------------------------------------
1 | #!/bin/python3
2 |
3 | import sys
4 | import subprocess
5 | import json
6 | from io import StringIO
7 |
8 | eww_files_var = "file_list"
9 |
10 | # get "file_list" from eww
11 | r = subprocess.run(['eww', 'get', eww_files_var], stdout=subprocess.PIPE)
12 | io = StringIO(r.stdout.decode('utf-8'))
13 |
14 | # try loading file_list as json or initialize a new empty list
15 | try:
16 | file_list = json.load(io)
17 | except json.decoder.JSONDecodeError:
18 | file_list = []
19 |
20 | # if the file_list is full, pop one file from it
21 | if len(file_list) >= 3:
22 | file_list.pop(0)
23 |
24 | # add the new file to the end of the list
25 | new_file = sys.argv[1]
26 | file_list.append(new_file)
27 |
28 | # update eww's file_list
29 | r = subprocess.run(['eww', 'update', eww_files_var+ '=' + json.dumps(file_list)])
30 |
--------------------------------------------------------------------------------
/hover-switch-example/.github/preview.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/druskus20/eugh/987f9272725f9d50c58854c4da094458a97d947d/hover-switch-example/.github/preview.gif
--------------------------------------------------------------------------------
/hover-switch-example/README.md:
--------------------------------------------------------------------------------
1 | # Hover Switch Example
2 |
3 | This is an example of a widget that switches between 2 children on hover
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/hover-switch-example/eww.scss:
--------------------------------------------------------------------------------
1 | * {
2 | all: unset;
3 | }
4 |
5 | window {
6 | background: #0e1419;
7 | }
8 |
9 | .test-box {
10 | background-color: #2a2a2a;
11 | }
12 | .test-box.red {
13 | background-color: red;
14 | }
15 | .test-box.blue {
16 | background-color: blue;
17 | }
18 | .test-box.green {
19 | background-color: green;
20 | }
21 |
22 | * {
23 | all: unset;
24 | }
25 |
26 | window {
27 | background: $background;
28 | }
29 |
30 |
--------------------------------------------------------------------------------
/hover-switch-example/eww.yuck:
--------------------------------------------------------------------------------
1 | (defwindow test
2 | :monitor 0
3 | :hexpand false
4 | :vexpand false
5 | :geometry (geometry :anchor "top left" :x 350 :y 30 :width "200px" :height "50px")
6 | (box :space-evenly false
7 | (hover-switch :var reveal
8 | :varname "reveal")))
9 |
10 | (defvar reveal false)
11 |
12 | ; NOTE: GTK revealer transitions are kinda stupid
13 | (defwidget hover-switch [var varname]
14 | (eventbox :onhover "eww update ${varname}=true"
15 | :onhoverlost "eww update ${varname}=false"
16 | (box
17 | :space-evenly false
18 | (revealer :reveal {!var}
19 | :duration "100ms"
20 | :transition "slideleft"
21 | (test-box :color "green"))
22 | (revealer :reveal {var}
23 | :duration "100ms"
24 | :transition "slideleft"
25 | (test-box :color "red")))))
26 |
27 | (defwidget test-box [?color]
28 | (box :class "${color} test-box"
29 | :orientation "h"
30 | :halign "start"
31 | :hexpand false
32 | :space-evenly false
33 | :width 50))
34 |
--------------------------------------------------------------------------------
/notification-revealer/.github/preview.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/druskus20/eugh/987f9272725f9d50c58854c4da094458a97d947d/notification-revealer/.github/preview.gif
--------------------------------------------------------------------------------
/notification-revealer/README.md:
--------------------------------------------------------------------------------
1 | # Notification Revealer
2 |
3 | This is an example of the use of revealer to show notifications
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/notification-revealer/eww.yuck:
--------------------------------------------------------------------------------
1 | (defwindow test
2 | :monitor 0
3 | :hexpand false
4 | :vexpand false
5 | :geometry (geometry :anchor "top left" :x 350 :y 30 :width "900px" :height "50px")
6 | (box
7 | :space-evenly false
8 | (notification-revealer)))
9 |
10 | (deflisten notifications_listen :initial '{"show": false, "content": ""}' "./notifications.sh")
11 |
12 | (defwidget notification-revealer []
13 | (box :class "notification-revealer"
14 | :orientation "h"
15 | :space-evenly false
16 | "NOTIFICATIONS: "
17 | (revealer :reveal {notifications_listen.show}
18 | :transition "slideright"
19 | (box
20 | (literal :valign "center" :content {notifications_listen.content})))))
21 |
22 | (defwidget test-box [?color]
23 | (box :class "${color} test-box"
24 | :orientation "h"
25 | :halign "start"
26 | :hexpand false
27 | :space-evenly false
28 | :width 100))
29 |
--------------------------------------------------------------------------------
/notification-revealer/notifications.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | print_notification() {
4 | content=$(echo "$1" | tr '\n' ' ')
5 | content="(label :limit-width 50 :text '$content')"
6 | echo "{\"show\": $2, \"content\": \"$content\"}"
7 | }
8 |
9 | print_notification "" "false"
10 | tiramisu -o '#summary' | while read -r line; do
11 | print_notification "$line" "true"
12 | kill "$pid" 2> /dev/null
13 | (sleep 3; print_notification "$line" "false") &
14 | pid="$!"
15 | done
16 |
--------------------------------------------------------------------------------
/polybar-replacement/.github/preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/druskus20/eugh/987f9272725f9d50c58854c4da094458a97d947d/polybar-replacement/.github/preview.png
--------------------------------------------------------------------------------
/polybar-replacement/README.md:
--------------------------------------------------------------------------------
1 | # Polybar Replacement
2 |
3 | This bar is meant to be a replacement for my original polybar.
4 | All of the required PR's have been merged by now, so this config should work on `master`.
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/polybar-replacement/eww.scss:
--------------------------------------------------------------------------------
1 | $foreground: #ffffff;
2 | $grey: #aaaaaa;
3 | $foreground-alt: #465059;
4 | $background: #0e1419;
5 | $black: #000000;
6 | $red: #ff6565;
7 | $green: #b8cc52;
8 | $yellow: #e6c446;
9 | $blue: #68d4ff;
10 | $magenta: #ffa3aa;
11 | $cyan: #36a3d9;
12 | $white: #ffffff;
13 |
14 | * {
15 | all: unset;
16 | }
17 |
18 | window {
19 | background: $background;
20 | }
21 |
22 | .bar {
23 | font-family: "Noto Sans";
24 | font-size: 13px;
25 | margin: 0 10px;
26 | }
27 |
28 | .icon-module {
29 | margin: 0 5px;
30 | & > &__icon {
31 | margin-right: 5px;
32 | font-family: "Font Awesome 5 Free Solid";
33 | }
34 | }
35 |
36 |
37 | .workspaces {
38 | font-family: "Font Awesome 5 Free Solid";
39 | font-size: 12px;
40 | margin-right: 20px;
41 |
42 | button {
43 | margin: 0px 3px;
44 | }
45 | .occupied {
46 | color: $grey;
47 | }
48 |
49 | .focused {
50 | color: $white;
51 | }
52 |
53 | .urgent {
54 | color: $red;
55 | }
56 |
57 | .empty {
58 | padding-top: 2px;
59 | color: $foreground-alt;
60 | font-size: 10px;
61 | // font-family: "Font Awesome 5 Free Regular"
62 | }
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/polybar-replacement/eww.yuck:
--------------------------------------------------------------------------------
1 | ; Windows foldstart
2 | (defwindow bar
3 | :monitor 0
4 | :hexpand false
5 | :vexpand false
6 | :geometry (geometry :anchor "top left" :x 0 :y 0 :width "100%")
7 | :reserve (struts :distance "10px" :side "top")
8 | (bar :screen 0))
9 | ; foldend
10 |
11 | ; Bar foldstart
12 | (defwidget bar [screen]
13 | (box :orientation "h"
14 | :space-evenly false
15 | :class "bar"
16 | (box :halign "start"
17 | :space-evenly false
18 | (workspaces)
19 | (player))
20 | (box :halign "end"
21 | :spacing 12
22 | :hexpand true
23 | :space-evenly false
24 | (notifications)
25 | (github)
26 | (updates)
27 | (trash)
28 | (noisetorch)
29 | (microphone)
30 | (speaker)
31 | (ping)
32 | (network)
33 | (disk)
34 | (ram)
35 | (nvidia)
36 | (cpu)
37 | (date)
38 | (time))))
39 | ; foldend
40 |
41 | ; Variables foldstart
42 | (defpoll time_poll :interval "1s" "date +%H:%M")
43 | (defpoll date_poll :interval "1m" "date +%d/%m/%Y")
44 | (defpoll trash_poll :interval "10s" "./modules/trash.sh")
45 | (defpoll noisetorch_poll :initial "" :interval "10s" "./modules/noisetorch.sh")
46 | (defpoll updates_poll :initial "" :interval "1m" "./modules/updates.sh &")
47 | (defpoll github_poll :initial "" :interval "1m" "./modules/github.sh")
48 | (defpoll ping_poll :interval "10s" "./modules/ping.sh")
49 |
50 | (deflisten workspaces_listen "./modules/workspaces.sh")
51 | (deflisten player_listen :initial '{"show": "no", "content": ""}' "./modules/player.sh")
52 | (deflisten nvidia_listen "./modules/nvidia.sh")
53 | (deflisten notifications_listen :initial '{"show": "no", "content": ""}' "./modules/notifications.sh")
54 |
55 | ; Make this cleaner at some point
56 | (defpoll microphone_poll :interval "999h" "./modules/microphone.sh")
57 | (defpoll speaker_poll :interval "999h" "./modules/speaker.sh")
58 | ; foldend
59 |
60 | ; Modules foldstart
61 | ; Generic icon module foldstart
62 | (defwidget icon-module [icon ?class ?visible]
63 | (box :class "${class} icon-module"
64 | :orientation "h"
65 | :halign "end"
66 | :space-evenly false
67 | :visible {visible ?: true} ; because the argument is optional
68 | (label :class "icon-module__icon" :text "${icon}")
69 | (children)))
70 | ; foldend
71 |
72 | ; Polybar-Style modules foldstart
73 | (defwidget workspaces []
74 | (literal :content workspaces_listen))
75 |
76 | (defwidget player []
77 | (icon-module :class "player" :icon "" :visible {player_listen.show == "yes"}
78 | (literal :content {player_listen.content})))
79 |
80 | (defwidget ram []
81 | (icon-module :class "ram" :icon "" :visible {EWW_RAM.used_mem_perc != ""}
82 | (label :text "${round(EWW_RAM.used_mem_perc, 0)}%")))
83 |
84 | (defwidget notifications []
85 | (icon-module :class "notifications" :icon "" :visible {notifications_listen.show == "yes"}
86 | (literal :content {notifications_listen.content})))
87 |
88 | (defwidget date []
89 | (icon-module :class "date" :icon ""
90 | (label :text date_poll)))
91 |
92 | (defwidget time []
93 | (icon-module :class "time" :icon ""
94 | (label :text time_poll)))
95 |
96 | (defwidget nvidia []
97 | (icon-module :class "nvidia" :icon ""
98 | (label :text nvidia_listen)))
99 |
100 | (defwidget cpu []
101 | (icon-module :class "cpu" :icon ""
102 | (label :text "${round(EWW_CPU.avg, 0)}%")))
103 |
104 | (defwidget disk []
105 | (icon-module :class "disk" :icon ""
106 | (label :text "${round(EWW_DISK["/"].used_perc, 0)}%")))
107 |
108 | (defwidget trash []
109 | (icon-module :class "trash" :icon ""
110 | (label :text trash_poll)))
111 |
112 | (defwidget noisetorch []
113 | (icon-module :class "noisetorch" :icon ""
114 | (label :text noisetorch_poll)))
115 |
116 | (defwidget updates []
117 | (icon-module :class "updates" :icon "" :visible {updates_poll != ""}
118 | (label :text updates_poll)))
119 |
120 | (defwidget github []
121 | (icon-module :class "github" :icon "" :visible {github_poll != ""}
122 | (label :text github_poll)))
123 |
124 | (defwidget ping []
125 | (icon-module :class "ping" :icon ""
126 | (label :text ping_poll)))
127 |
128 | (defwidget network []
129 | (icon-module :class "network" :icon ""
130 | (label :text "${round(EWW_NET.enp42s0.NET_UP / 1000000, 2)}/${round(EWW_NET.enp42s0.NET_DOWN / 1000000, 2)}")))
131 |
132 | (defwidget speaker []
133 | (icon-module :class "speaker"
134 | :icon {speaker_poll.icon}
135 | (eventbox :onscroll `eww update speaker_poll="$(./modules/speaker.sh {})"`
136 | (button :onclick `eww update speaker_poll="$(./modules/speaker.sh toogle)"`
137 | (label :text {speaker_poll.content})))))
138 |
139 | (defwidget microphone []
140 | (icon-module :class "microphone"
141 | :icon {microphone_poll.icon}
142 | (eventbox :onscroll `eww update microphone_poll="$(./modules/microphone.sh {})"`
143 | (button :onclick `eww update microphone_poll="$(./modules/microphone.sh toogle)"`
144 | (label :text {microphone_poll.content})))))
145 | ; foldend
146 |
147 | ; vim:foldmarker=foldstart,foldend
148 |
--------------------------------------------------------------------------------
/polybar-replacement/modules/github.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | notifications="$(gh api notifications 2> /dev/null | jq '. | length')"
4 | [ -z notifications ] && echo "" || echo "$notifications"
5 |
--------------------------------------------------------------------------------
/polybar-replacement/modules/microphone.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | case $1 in
4 | "*") command="" ;;
5 | "up") command="--allow-boost -i 5" ;;
6 | "down") command="--allow-boost -d 5" ;;
7 | "toogle") command="-t" ;;
8 | esac
9 |
10 | [ -n "$command" ] && pamixer --default-source $command
11 | mute=$(pamixer --default-source --get-mute)
12 | if [ "$mute" = "true" ]; then
13 | volume="muted"
14 | icon=""
15 | else
16 | volume="$(pamixer --default-source --get-volume)%"
17 | icon=""
18 | fi
19 |
20 | echo "{\"content\": \"$volume\", \"icon\": \"$icon\"}"
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/polybar-replacement/modules/noisetorch.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | nmodules="$(pactl list modules short 2> /dev/null | grep -c noisetorch)"
4 | [ "$nmodules" = 0 ] && echo "off" || echo "on"
5 |
6 |
--------------------------------------------------------------------------------
/polybar-replacement/modules/notifications.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | print_notification() {
4 | content=$(echo "$1" | tr '\n' ' ')
5 | content="(label :text '$content')"
6 | echo "{\"show\": \"$2\", \"content\": \"$content\"}"
7 | }
8 |
9 | print_notification "" "no"
10 | tiramisu -o '#summary' | while read -r line; do
11 | print_notification "$line" "yes"
12 | kill "$pid"
13 | (sleep 10; print_notification "" "no") &
14 | pid="$!"
15 | done
16 |
--------------------------------------------------------------------------------
/polybar-replacement/modules/nvidia.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits -l 2 2> /dev/null | while read -r line ; do
4 | [ "$result" = "Failed" ] && echo "Failed" || echo "$line%"
5 | done
6 |
7 |
8 |
--------------------------------------------------------------------------------
/polybar-replacement/modules/ping.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | HOST="8.8.8.8"
4 |
5 | if ! ping=$(ping -n -c 1 -W 1 $HOST 2> /dev/null); then
6 | echo "No"
7 | else
8 | rtt=$(echo "$ping" | sed -rn 's/.*time=([0-9]{1,})\.?[0-9]{0,} ms.*/\1/p')
9 |
10 | [ -z "$rtt" ] && echo "" && exit
11 | echo "$rtt ms"
12 | fi
13 |
--------------------------------------------------------------------------------
/polybar-replacement/modules/player.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 |
4 | echo "{\"show\": \"no\", \"content\": \"\"}"
5 | playerctl --follow metadata --format '{{artist}} ¿¿¿¿¿ {{ title }}' 2> /dev/null | while read -r line ; do
6 | case "$line" in
7 | ?*\ ¿¿¿¿¿\ ?*) text="$(echo "$line" | sed "s/¿¿¿¿¿/-/")" && should_show="yes";;
8 | *) text="" && should_show="no" ;;
9 | esac
10 |
11 | echo "{\"show\": \"$should_show\", \"content\": \"(box (label :text \\\"$text\\\"))\"}"
12 | done
13 |
14 |
--------------------------------------------------------------------------------
/polybar-replacement/modules/speaker.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | case $1 in
4 | "*") command="" ;;
5 | "up") command="--allow-boost -i 5" ;;
6 | "down") command="--allow-boost -d 5" ;;
7 | "toogle") command="-t" ;;
8 | esac
9 |
10 | [ -n "$command" ] && pamixer $command
11 | mute=$(pamixer --get-mute)
12 | if [ "$mute" = "true" ]; then
13 | volume="muted"
14 | icon=""
15 | else
16 | volume="$(pamixer --get-volume)"
17 | if [ "$volume" -gt 66 ]; then
18 | icon=""
19 | elif [ "$volume" -gt 33 ]; then
20 | icon=""
21 | elif [ "$volume" -gt 0 ]; then
22 | icon=""
23 | else
24 | icon=""
25 | fi
26 | volume="$volume%"
27 | fi
28 |
29 | echo "{\"content\": \"$volume\", \"icon\": \"$icon\"}"
30 |
31 |
32 |
--------------------------------------------------------------------------------
/polybar-replacement/modules/trash.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | case "$1" in
4 | --clean)
5 | if [ -x /bin/trash-empty ]; then
6 | trash-empty
7 | else
8 | rm -rf ~/.local/share/Trash/files
9 | rm -rf ~/.local/share/Trash/info
10 | mkdir ~/.local/share/Trash/files
11 | mkdir ~/.local/share/Trash/info
12 | fi
13 | echo "0"
14 | ;;
15 | *)
16 | nfiles=$(find ~/.local/share/Trash/files/ -maxdepth 1 | wc -l)
17 | echo $((nfiles-1))
18 | ;;
19 | esac
20 |
--------------------------------------------------------------------------------
/polybar-replacement/modules/updates.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | updates_arch=$(checkupdates 2> /dev/null | wc -l );
4 | [ -z "$updates_arch" ] && updates_arch=0
5 |
6 | updates_aur=$(checkupdates-aur 2> /dev/null | wc -l)
7 | [ -z "$updates_aur" ] && updates_aur=0
8 |
9 | updates=$((updates_arch + updates_aur))
10 | echo "$updates"
11 |
12 | #[ "$updates" -gt 0 ] && echo "$updates" || echo "A"
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/polybar-replacement/modules/workspaces.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Checks if a list ($1) contains an element ($2)
4 | contains() {
5 | for e in $1; do
6 | [ "$e" -eq "$2" ] && echo 1 && return
7 | done
8 | echo 0
9 | }
10 |
11 | print_workspaces() {
12 | buf=""
13 | desktops=$(bspc query -D --names)
14 | focused_desktop=$(bspc query -D -d focused --names)
15 | occupied_desktops=$(bspc query -D -d .occupied --names)
16 | urgent_desktops=$(bspc query -D -d .urgent --names)
17 |
18 | for d in $desktops; do
19 | if [ "$(contains "$focused_desktop" "$d")" -eq 1 ]; then
20 | ws=$d
21 | icon=""
22 | class="focused"
23 | elif [ "$(contains "$occupied_desktops" "$d")" -eq 1 ]; then
24 | ws=$d
25 | icon=""
26 | class="occupied"
27 | elif [ "$(contains "$urgent_desktops" "$d")" -eq 1 ]; then
28 | ws=$d
29 | icon=""
30 | class="urgent"
31 | else
32 | ws=$d
33 | icon=""
34 | class="empty"
35 | fi
36 |
37 | buf="$buf (eventbox :cursor \"hand\" (button :class \"$class\" :onclick \"bspc desktop -f $ws\" \"$icon\"))"
38 | done
39 |
40 | echo "(box :class \"workspaces\" :halign \"center\" :valign \"center\" :vexpand true :hexpand true $buf)"
41 | }
42 |
43 | # Listen to bspwm changes
44 | print_workspaces
45 | bspc subscribe desktop node_transfer | while read -r _ ; do
46 | print_workspaces
47 | done
48 |
49 |
--------------------------------------------------------------------------------
/revealer-example/.github/preview.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/druskus20/eugh/987f9272725f9d50c58854c4da094458a97d947d/revealer-example/.github/preview.gif
--------------------------------------------------------------------------------
/revealer-example/README.md:
--------------------------------------------------------------------------------
1 | # Revealer Example
2 |
3 | This is an example of the use of revealer and eventbox together.
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/revealer-example/eww.scss:
--------------------------------------------------------------------------------
1 | * {
2 | all: unset;
3 | }
4 |
5 | window {
6 | background: #0e1419;
7 | }
8 |
9 | .test-box {
10 | background-color: #2a2a2a;
11 | }
12 | .test-box.red {
13 | background-color: red;
14 | }
15 | .test-box.blue {
16 | background-color: blue;
17 | }
18 | .test-box.green {
19 | background-color: green;
20 | }
21 |
22 | * {
23 | all: unset;
24 | }
25 |
26 | window {
27 | background: $background;
28 | }
29 |
30 |
--------------------------------------------------------------------------------
/revealer-example/eww.yuck:
--------------------------------------------------------------------------------
1 | (defwindow test
2 | :monitor 0
3 | :hexpand false
4 | :vexpand false
5 | :geometry (geometry :anchor "top left" :x 350 :y 30 :width "900px" :height "50px")
6 | (box
7 | :space-evenly false
8 | (revealer1)
9 | (revealer2)))
10 |
11 | (defvar reveal1 true)
12 | (defvar reveal2 true)
13 | (defvar reveal2-nested true)
14 |
15 | ; Revealer on hover, using children
16 | (defwidget revealer-on-hover [revealvar revealvar-name ?class ?duration ?transition]
17 | (box
18 | :class "${class} revealer-on-hover"
19 | :orientation "h"
20 | :space-evenly false
21 | (eventbox
22 | :onhover "eww update ${revealvar-name}=true"
23 | :onhoverlost "eww update ${revealvar-name}=false"
24 | (box
25 | :space-evenly false
26 | (children :nth 0)
27 | (revealer
28 | :reveal revealvar
29 | :transition {transition ?: "slideright"}
30 | :duration {duration ?: "500ms"}
31 | (children :nth 1))))))
32 |
33 | (defwidget revealer1 []
34 | (revealer-on-hover
35 | :revealvar reveal1
36 | :revealvar-name "reveal1"
37 | (test-box)
38 | (box
39 | :space-evenly false
40 | (test-box :color "red")
41 | (test-box :color "green"))))
42 |
43 | (defwidget revealer2 []
44 | (revealer-on-hover
45 | :revealvar reveal2
46 | :revealvar-name "reveal2"
47 | (test-box)
48 | (box
49 | :space-evenly false
50 | (test-box :color "red")
51 | (test-box :color "green")
52 | (revealer-on-hover
53 | :duration "100ms"
54 | :revealvar reveal2-nested
55 | :revealvar-name "reveal2-nested"
56 | (test-box)
57 | (box
58 | :space-evenly false
59 | (test-box :color "blue")
60 | (test-box :color "green"))))))
61 |
62 | (defwidget test-box [?color]
63 | (box :class "${color} test-box"
64 | :orientation "h"
65 | :halign "start"
66 | :hexpand false
67 | :space-evenly false
68 | :width 100))
69 |
--------------------------------------------------------------------------------
/revealer-hover-module/.github/preview.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/druskus20/eugh/987f9272725f9d50c58854c4da094458a97d947d/revealer-hover-module/.github/preview.gif
--------------------------------------------------------------------------------
/revealer-hover-module/README.md:
--------------------------------------------------------------------------------
1 | # Revealer Hover Module
2 |
3 | This is a concept of a revealer module for my bar
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/revealer-hover-module/eww.scss:
--------------------------------------------------------------------------------
1 | * {
2 | all: unset;
3 | }
4 |
5 | window {
6 | background: #0e1419;
7 | }
8 |
9 | .test-box {
10 | background-color: #2a2a2a;
11 | }
12 | .test-box.red {
13 | background-color: red;
14 | }
15 | .test-box.blue {
16 | background-color: blue;
17 | }
18 | .test-box.green {
19 | background-color: green;
20 | }
21 |
22 | * {
23 | all: unset;
24 | }
25 |
26 | window {
27 | background: $background;
28 | }
29 |
30 |
--------------------------------------------------------------------------------
/revealer-hover-module/eww.yuck:
--------------------------------------------------------------------------------
1 | (defwindow test
2 | :monitor 0
3 | :hexpand false
4 | :vexpand false
5 | :geometry (geometry :anchor "top left" :x 350 :y 30 :width "300px" :height "30px")
6 | :anchor "top left"
7 | (box :space-evenly false
8 | :halign "end"
9 | (hover-module)))
10 |
11 | (defvar reveal false)
12 |
13 | ; NOTE: GTK revealer transitions are kinda stupid
14 | (defwidget hovered-sign [var]
15 | (box :space-evenly false
16 | (revealer :reveal {!var}
17 | :duration "100ms"
18 | :transition "slideleft"
19 | (children :nth 0))
20 | (revealer :reveal {var}
21 | :duration "100ms"
22 | :transition "slideleft"
23 | (children :nth 1))))
24 |
25 | ; Revealer on hover, using children
26 | (defwidget revealer-on-hover [var varname ?class ?duration ?transition]
27 | (box :class "${class} revealer-on-hover"
28 | :orientation "h"
29 | :space-evenly false
30 | (eventbox :class "eventbox"
31 | :onhover "eww update ${varname}=true"
32 | :onhoverlost "eww update ${varname}=false"
33 | (box :space-evenly false
34 | (children :nth 0)
35 | (revealer :reveal var
36 | :transition {transition ?: "slideright"}
37 | :duration {duration ?: "500ms"}
38 | (children :nth 1))
39 | (children :nth 2)))))
40 |
41 |
42 | (defwidget hover-module [?class]
43 | (box :space-evenly false
44 | :class "hover-module ${class}"
45 | (revealer-on-hover :class "hl-on-hover"
46 | :var reveal
47 | :varname "reveal"
48 | :transition "slideleft"
49 |
50 | (hovered-sign :var reveal
51 | "《"
52 | "》")
53 | "You have 1 notification"
54 | " ")))
55 |
56 | (defwidget test-box [?color]
57 | (box :class "${color} test-box"
58 | :orientation "h"
59 | :halign "start"
60 | :hexpand false
61 | :space-evenly false
62 | :width 50))
63 |
--------------------------------------------------------------------------------
/simpler-bar/.github/preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/druskus20/eugh/987f9272725f9d50c58854c4da094458a97d947d/simpler-bar/.github/preview.png
--------------------------------------------------------------------------------
/simpler-bar/eww.scss:
--------------------------------------------------------------------------------
1 | $rosewater: #f5e0dc;
2 | $flamingo: #f2cdcd;
3 | $pink: #f5c2e7;
4 | $mauve: #cba6f7;
5 | $red: #f38ba8;
6 | $maroon: #eba0ac;
7 | $peach: #fab387;
8 | $yellow: #f9e2af;
9 | $green: #a6e3a1;
10 | $teal: #94e2d5;
11 | $sky: #89dceb;
12 | $sapphire: #74c7ec;
13 | $blue: #89b4fa;
14 | $lavender: #b4befe;
15 | $text: #cdd6f4;
16 | $subtext1: #bac2de;
17 | $subtext0: #a6adc8;
18 | $overlay2: #9399b2;
19 | $overlay1: #7f849c;
20 | $overlay0: #6c7086;
21 | $surface2: #585b70;
22 | $surface1: #45475a;
23 | $surface0: #313244;
24 | $base: #1e1e2e;
25 | $mantle: #181825;
26 | $crust: #11111b;
27 |
28 |
29 | * {
30 | all: unset;
31 | }
32 |
33 | window {
34 | font-family: "NotoSans Nerd Font", sans-serif;
35 | background-color: $base;
36 | }
37 |
38 | .workspace {
39 | margin: 3px;
40 | padding: 0px;
41 | }
42 |
43 | .icon {
44 | margin: 0 5px;
45 | color: $text;
46 | }
47 |
48 | .icon.single-icon {
49 | margin: 0;
50 | }
51 |
52 | .mic {
53 | .icon.running {
54 | color: $green;
55 | }
56 | }
57 |
58 | .workspace {
59 | .icon {
60 | margin: 0 3px;
61 | font-size: 10px;
62 | }
63 | .name {
64 | background-color: $base;
65 | }
66 | }
67 |
68 | .workspace.focused {
69 | .icon {
70 | color: $text;
71 | }
72 | }
73 |
74 | .battery, .time, .date .tray .speakers .mic .wifi {
75 | color: $text;
76 | font-size: 10px;
77 | }
78 |
79 | .battery {
80 | .icon.critical {
81 | color: $red;
82 | }
83 | }
84 |
85 | .tooltip {
86 | background-color: $surface0;
87 | color: $text;
88 | font-size: 10px;
89 | }
90 | .camera {
91 | .icon.connected {
92 | color: $green;
93 | }
94 | }
95 |
96 | .icon.muted {
97 | color: $red;
98 | }
99 |
100 | .wifi {
101 | .icon.connected {
102 | color: $green;
103 | }
104 | }
105 |
106 | .tray image {
107 | -gtk-icon-transform: scale(0.5);
108 | }
109 |
110 |
111 | scale trough {
112 | background-color: $crust;
113 | border-radius: 2px;
114 | min-height: 5px;
115 | min-width: 50px;
116 | }
117 |
118 | scale trough highlight {
119 | background-color: $text;
120 | border-radius: 2px;
121 | }
122 |
123 | scale.over trough highlight {
124 | background-color: $peach;
125 | border-radius: 2px;
126 | }
127 |
128 |
129 |
--------------------------------------------------------------------------------
/simpler-bar/eww.yuck:
--------------------------------------------------------------------------------
1 | ; eww config
2 |
3 | ; ━━━━ windows ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
4 |
5 | (defwindow win0 :monitor 0
6 | :geometry (geometry :x 0 :y 0 :height "15px" :width "100%" :anchor "center top")
7 | :stacking "fg"
8 | :exclusive true
9 | :focusable false
10 | (bar0 :monitor "eDP-1"))
11 | (defwindow win1 :monitor 1
12 | :geometry (geometry :x 0 :y 0 :height "15px" :width "100.01%" :anchor "center top")
13 | :stacking "fg"
14 | :exclusive true
15 | :focusable false
16 | (bar0 :monitor "HDMI-A-1"))
17 | (defwindow win2 :monitor 2
18 | :geometry (geometry :x 0 :y 0 :height "15px" :width "100.01%" :anchor "center top")
19 | :stacking "fg"
20 | :exclusive true
21 | :focusable false
22 | (bar0 :monitor "DP-2"))
23 |
24 | ; ━━━━ bars ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
25 |
26 | (defwidget bar0 [monitor]
27 | (box :orientation "h"
28 | :space-evenly true
29 | :class "bar"
30 | (box :class "right"
31 | :halign "start"
32 | :spacing 20
33 | (workspaces :monitor monitor))
34 | (box :class "right"
35 | :halign "end"
36 | :spacing 20
37 | :space-evenly false
38 | (tray)
39 | (wifi)
40 | (camera)
41 | (mic)
42 | (speakers)
43 | (battery)
44 | (time)
45 | (date))))
46 |
47 | ; ━━━━ workspaces ╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
48 |
49 | (deflisten workspaces :initial '{"DP-2": [], "HDMI-A-1": [], "eDP-1": []}' "./modules/sway-workspaces.py")
50 |
51 | (defwidget workspaces [monitor]
52 | (box :orientation "h" :class "workspaces"
53 | (for wsp in {workspaces[monitor]}
54 | (button :class "workspace ${wsp.class}"
55 | :onclick "swaymsg workspace ${wsp.name}"
56 | (box
57 | (label :class "icon" :text "${wsp.icon}")
58 | (label :class "name" :text "${wsp.name}"))))))
59 | ;{wsp.name}))))
60 |
61 | ; ━━━━ tray ╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
62 |
63 | (defwidget tray []
64 | (box :class "tray"
65 | (systray)))
66 |
67 | ; ━━━━ camera ╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
68 |
69 | (defpoll camera :initial "0" :interval "10s" "./modules/camera.sh")
70 |
71 | (defwidget camera []
72 | (box :class "camera"
73 | :space-evenly false
74 | (label :class "icon ${camera == 0 ? 'disconnected' : 'connected'}"
75 | :text "${camera == 0 ? '' : ''}")))
76 |
77 | ; ━━━━ wifi ╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
78 |
79 | (defpoll wifi :initial "0" :interval "1m" "./modules/wifi.sh")
80 |
81 | (defwidget wifi []
82 | (tooltip
83 | (label :class "tooltip" :text "${wifi == 0 ? 'Disconnected' : wifi}")
84 | (box :class "wifi"
85 | :space-evenly false
86 | ;(label :class "icon" :text "")
87 | (label
88 | :class "icon ${wifi == 0 ? 'disconnected' : 'connected'} "
89 | :text "${wifi == 0 ? '' : '' }"))))
90 |
91 |
92 | ; ━━━━ mic ╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
93 |
94 | (deflisten mic :initial 0 "./modules/listen-mic.sh")
95 |
96 | (defwidget mic []
97 | (box :class "mic"
98 | :space-evenly false
99 | (button :class "mute-toggle"
100 | :onclick "pactl set-source-mute @DEFAULT_SOURCE@ toggle"
101 | ; 0: muted, 1: unmuted, 2: running
102 | (label :class "icon single-icon ${mic == 2 ? 'running' : mic == 0 ? 'muted' : ''}"
103 | :text "${mic == 0 ? '' : '' }"))))
104 |
105 | ; ━━━━ volume ╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
106 |
107 | (deflisten speakers :initial '{ "volume": 0, "muted": "false" }' "./modules/listen-volume.sh")
108 |
109 | (defwidget speakers []
110 | (tooltip
111 | (label :class "tooltip" :text "${ speakers.volume }%")
112 | (box :class "speakers"
113 | :space-evenly false
114 | (button :class "icon ${ speakers.volume > 100 ? 'over' : '' } ${ speakers.muted ? 'muted' : '' }"
115 | :onclick "pactl set-sink-mute @DEFAULT_SINK@ toggle"
116 | (label :text "${ speakers.muted ? '' :
117 | speakers.volume > 70 ? '' :
118 | speakers.volume > 35 ? '' :
119 | '' }"))
120 |
121 | (scale
122 | :class "${ speakers.volume > 100 ? 'over' : '' }"
123 | :min 0
124 | :max 100
125 | :value "${speakers.volume}"
126 | :onchange "pactl set-sink-volume @DEFAULT_SINK@ {}%"))))
127 |
128 | ; ━━━━ battery ╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
129 |
130 | (defwidget battery []
131 | (box :class "battery"
132 | :space-evenly false
133 | (label :class "icon ${ EWW_BATTERY["BAT0"].capacity <= 10 ? 'critical' : '' }"
134 | :text "${ EWW_BATTERY["BAT0"].capacity > 95 ? ''
135 | : EWW_BATTERY["BAT0"].capacity > 90 ? ''
136 | : EWW_BATTERY["BAT0"].capacity > 80 ? ''
137 | : EWW_BATTERY["BAT0"].capacity > 70 ? ''
138 | : EWW_BATTERY["BAT0"].capacity > 60 ? ''
139 | : EWW_BATTERY["BAT0"].capacity > 50 ? ''
140 | : EWW_BATTERY["BAT0"].capacity > 40 ? ''
141 | : EWW_BATTERY["BAT0"].capacity > 30 ? ''
142 | : EWW_BATTERY["BAT0"].capacity > 20 ? ''
143 | : EWW_BATTERY["BAT0"].capacity > 10 ? ''
144 | : '' }")
145 | (label :text "${EWW_BATTERY["BAT0"].capacity}" :halign "center" :xalign 0.5 :justify "right")))
146 |
147 | ; ━━━━ date ╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
148 |
149 | (defpoll date_poll :interval "1m" "date +%d/%m")
150 |
151 | (defwidget date []
152 | (box :class "date"
153 | :space-evenly false
154 | (label :class "icon" :text "")
155 | (label :text date_poll)))
156 |
157 | ; ━━━━ time ╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
158 |
159 | (defpoll time_poll :interval "1s" "date +%H:%M")
160 |
161 | (defwidget time []
162 | (box :class "time"
163 | :space-evenly false
164 | (label :class "icon" :text "")
165 | (label :text time_poll)))
166 |
167 |
--------------------------------------------------------------------------------
/simpler-bar/modules/camera.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | usage_count=$(lsmod | grep '^uvcvideo' | awk '{print $3}')
4 | if [[ "$usage_count" -gt 0 ]]; then
5 | echo 1
6 | else
7 | echo 0
8 | fi
9 |
10 |
--------------------------------------------------------------------------------
/simpler-bar/modules/listen-mic.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # returns 0: muted, 1: not running, 2: running
3 |
4 | get_mic_status() {
5 | mic_id=$1
6 |
7 | # Check the mute status
8 | mute_status=$(pactl list sources | grep -A 15 "Source #$mic_id" | grep 'Mute:' | awk '{print $2}')
9 |
10 | # Check if the source is running
11 | running_status=$(pactl list sources | grep -A 15 "Source #$mic_id" | grep 'State:' | awk '{print $2}')
12 |
13 | if [[ -z "$mute_status" ]] || [[ -z "$running_status" ]]; then
14 | return 1
15 | fi
16 |
17 | # If muted, return 1
18 | if [[ "$mute_status" == "yes" ]]; then
19 | echo 0
20 | # If running, return 2
21 | elif [[ "$running_status" == "RUNNING" ]]; then
22 | echo 2
23 | else
24 | echo 1
25 | fi
26 | }
27 |
28 | DEFAULT_SOURCE_NAME="$(pactl get-default-source)"
29 | DEFAULT_SOURCE_ID="$(pactl list sources short | grep "$DEFAULT_SOURCE_NAME" | awk '{print $1}')"
30 | MUTE_STATUS="$(get_mic_status $DEFAULT_SOURCE_ID)"
31 |
32 | echo "$MUTE_STATUS"
33 |
34 | pactl subscribe | while read -r line; do
35 | if echo "$line" | grep -q "Event 'change' on source #$DEFAULT_SOURCE_ID"; then
36 | MUTE_STATUS="$(get_mic_status $DEFAULT_SOURCE_ID)"
37 | echo "$MUTE_STATUS"
38 | DEFAULT_SOURCE_NAME="$(pactl get-default-source)"
39 | DEFAULT_SOURCE_ID=$(pactl list sources short | grep "$DEFAULT_SOURCE_NAME" | awk '{print $1}')
40 | fi
41 | done
42 |
43 |
--------------------------------------------------------------------------------
/simpler-bar/modules/listen-volume.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | get_sink_volume_and_mute_status() {
4 | sink_id=$1
5 | # Extract volume percentage
6 | volume=$(pactl list sinks | grep -A 10 "Sink #$sink_id" | grep 'Volume:' | awk '{print $5}' | cut -d'%' -f1)
7 | # Extract mute status
8 | mute_status=$(pactl list sinks | grep -A 15 "Sink #$sink_id" | grep 'Mute:' | awk '{print $2}')
9 |
10 | if [[ -z "$volume" || -z "$mute_status" ]]; then
11 | return 1
12 | fi
13 |
14 | # Format the output
15 | echo "{\"volume\": $volume, \"muted\": $( [[ "$mute_status" == "yes" ]] && echo "true" || echo "false" ) }"
16 | }
17 |
18 | DEFAULT_SINK_NAME="$(pactl get-default-sink)"
19 | DEFAULT_SINK_ID="$(pactl list sinks short | grep "$DEFAULT_SINK_NAME" | awk '{print $1}')"
20 | CURR_STATUS="$(get_sink_volume_and_mute_status $DEFAULT_SINK_ID)"
21 |
22 | echo "$CURR_STATUS"
23 |
24 | pactl subscribe | while read -r line; do
25 | if echo "$line" | grep -q "Event 'change' on sink #$DEFAULT_SINK_ID"; then
26 | NEW_STATUS="$(get_sink_volume_and_mute_status $DEFAULT_SINK_ID)"
27 | # Avoids double events
28 | if [[ "$CURR_STATUS" != "$NEW_STATUS" ]]; then
29 | CURR_STATUS=$NEW_STATUS
30 | echo "$CURR_STATUS"
31 | fi
32 | # Update default sink in case it has changed
33 | DEFAULT_SINK_NAME="$(pactl get-default-sink)"
34 | DEFAULT_SINK_ID=$(pactl list sinks short | grep "$DEFAULT_SINK_NAME" | awk '{print $1}')
35 | fi
36 | done
37 |
38 |
--------------------------------------------------------------------------------
/simpler-bar/modules/sway-workspaces.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # Original Author: Elkowar https://github.com/elkowar/dots-of-war/blob/master/eww-bar/.config/eww-bar/swayspaces.py
3 |
4 | import subprocess
5 | import json
6 |
7 |
8 | def get_workspaces():
9 | output = subprocess.check_output(["swaymsg", "-t", "get_workspaces"])
10 | return json.loads(output.decode("utf-8"))
11 |
12 |
13 | def generate_workspace_data() -> dict:
14 | data = {}
15 | for wsp in get_workspaces():
16 | if wsp["output"] not in data:
17 | data[wsp["output"]] = []
18 | i = { "name": wsp["name"],
19 | "monitor": wsp["output"],
20 | "focused": wsp["focused"],
21 | "visible": wsp["visible"],
22 | }
23 | if wsp["focused"]:
24 | i["class"] = "focused"
25 | i["icon"] = ""
26 | elif wsp["visible"]:
27 | i["class"] = "visible"
28 | i["icon"] = ""
29 | else:
30 | i["class"] = "hidden"
31 | i["icon"] = ""
32 | data[wsp["output"]].append(i)
33 |
34 |
35 | return data
36 |
37 |
38 | if __name__ == "__main__":
39 | process = subprocess.Popen(
40 | ["swaymsg", "-t", "subscribe", "-m", '["workspace"]', "--raw"],
41 | stdout=subprocess.PIPE,
42 | )
43 | if process.stdout is None:
44 | print("Error: could not subscribe to sway events")
45 | exit(1)
46 | while True:
47 | print(json.dumps(generate_workspace_data()), flush=True)
48 | line = process.stdout.readline().decode("utf-8")
49 | if line == "":
50 | break
51 |
52 |
--------------------------------------------------------------------------------
/simpler-bar/modules/wifi.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | wifi_ssid=$(nmcli -t -f ACTIVE,SSID dev wifi | awk -F':' '$1=="yes" {print $2}')
4 |
5 | if [[ -z "$wifi_ssid" ]]; then
6 | echo "0"
7 | else
8 | echo "$wifi_ssid"
9 | fi
10 |
--------------------------------------------------------------------------------
/workspace-indicator/.github/preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/druskus20/eugh/987f9272725f9d50c58854c4da094458a97d947d/workspace-indicator/.github/preview.png
--------------------------------------------------------------------------------
/workspace-indicator/README.md:
--------------------------------------------------------------------------------
1 | # Workspace Indicator
2 |
3 | This is a new take on workspace indicators. It uses a background image for the big diamond at the bottom.
4 |
5 | NOTE: This example makes use of the `loop_widget` branch
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/workspace-indicator/eww.scss:
--------------------------------------------------------------------------------
1 | * {
2 | all: unset;
3 | }
4 |
5 | .top {
6 | background-color: #202020;
7 | }
8 |
9 | .ws {
10 | // Figure out new font awesome stuff
11 |
12 | .small-ws {
13 | &.status-empty {
14 | font-family: "Font Awesome 6 Free Solid";
15 | color: rgba(237, 112, 112, 0.3);
16 | }
17 | &.status-occupied {
18 | font-family: "Font Awesome 6 Free Solid";
19 | color: rgba(255, 255, 255, 0.5);
20 | color: rgba(237, 112, 112, 0.5);
21 | }
22 | &.status-focused {
23 | font-family: "Font Awesome 6 Free Solid";
24 | color: rgba(237, 112, 112, 1.0);
25 | }
26 | &.status-urgent {
27 | font-family: "Font Awesome 6 Free Solid";
28 | color: rgba(255, 255, 255, 1.0)
29 | }
30 |
31 | }
32 |
33 | .big-ws {
34 | font-size: 20px;
35 | font-weight: bold;
36 | color: white;
37 | margin: 4px;
38 | background-image: url("res/rhombus.png");
39 | background-size: 100% 100%;
40 | background-repeat: no-repeat;
41 | background-position: center;
42 | }
43 | }
44 |
45 |
--------------------------------------------------------------------------------
/workspace-indicator/eww.yuck:
--------------------------------------------------------------------------------
1 | (defvar WS '{"ws1": [{"name": "1", "icon": "", "status": "occupied"},
2 | {"name": "2", "icon": "", "status": "empty"},
3 | {"name": "3", "icon": "", "status": "focused"}],
4 | "ws2": [{"name": "4", "icon": "", "status": "empty"},
5 | {"name": "5", "icon": "", "status": "occupied"},
6 | {"name": "6", "icon": "", "status": "urgent"}],
7 | "focused": "3"}')
8 |
9 | (defwindow bar
10 | :monitor 0
11 | :reserve (struts :distance "50px" :side "left")
12 | :geometry (geometry :anchor "top left" :x 0 :y 0 :width "50px" :height "100%")
13 | (box :class "top"
14 | :orientation "vertical"
15 | :space-evenly false
16 | :hexpand false
17 | :vexpand false
18 | :valign "start"
19 | (ws)))
20 |
21 |
22 | (defwidget ws []
23 | (box :class "ws"
24 | :orientation "vertical"
25 | :space-evenly false
26 | (small-wss :wss "${WS.ws1}")
27 | (small-wss :wss "${WS.ws2}")
28 | (big-ws :focused-ws "${WS.focused}")))
29 |
30 |
31 | (defwidget small-wss [wss]
32 | (box
33 | :class "small-wss"
34 | :hexpand false
35 | :vexpand false
36 | (for ws in wss
37 | (small-ws :ws ws))))
38 |
39 | (defwidget small-ws [ws]
40 | (eventbox
41 | :cursor "hand"
42 | (button
43 | :onclick "bspc desktop -f ${ws.name}"
44 | (label
45 | :class "small-ws status-${ws.status}"
46 | :text "${ws.icon}"))))
47 |
48 | (defwidget big-ws [focused-ws]
49 | (box
50 | :class "big-ws"
51 | :hexpand false
52 | :vexpand false
53 | :height "50"
54 | :width "50"
55 |
56 | (label
57 | :text "${focused-ws}")))
58 |
--------------------------------------------------------------------------------
/workspace-indicator/res/rhombus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/druskus20/eugh/987f9272725f9d50c58854c4da094458a97d947d/workspace-indicator/res/rhombus.png
--------------------------------------------------------------------------------