1
0
Fork 0
mirror of https://github.com/eoli3n/dotfiles synced 2024-05-12 02:26:04 +02:00

Compare commits

...

5 Commits

Author SHA1 Message Date
eoli3n 8fff6bd408 added todo and some eww scripts 2023-11-08 20:50:11 +01:00
eoli3n 5b870c787e raw jinja playerctl 2023-11-08 16:36:54 +01:00
eoli3n faaf8d5c0b dynamic sway workspace eww widget without multiscreen 2023-11-08 16:12:44 +01:00
eoli3n f56bdaa8b8 dynamic sway workspace eww widget without multiscreen 2023-11-08 16:11:55 +01:00
eoli3n d284a47a54 added static sway workspace eww widget 2023-11-08 15:01:15 +01:00
7 changed files with 92 additions and 15 deletions

4
roles/eww/TODO Normal file
View File

@ -0,0 +1,4 @@
# sway widget
- get-window-title : https://wiki.hyprland.org/Useful-Utilities/Status-Bars/#eww
- multi-monitor
- resize mode

13
roles/eww/files/get-outputs Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
function run() {
swaymsg -t get_outputs | jq -rc 'to_entries | map({name: .value.name, id: .key, active: .value.active})'
}
run
swaymsg -t subscribe '["workspace"]' --monitor | {
while read -r; do
run
done
}

13
roles/eww/files/get-workspaces Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
function run() {
swaymsg -t get_workspaces --raw | jq -c 'map({name: .name | tostring, output: .output, icon: .name[2:], focused: .focused})'
}
run
swaymsg -t subscribe '["workspace"]' --monitor | {
while read -r; do
run
done
}

5
roles/eww/files/start-eww Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
EWW="$HOME/dev/eww/target/release/eww"
$EWW --restart daemon
$EWW open bartop

View File

@ -29,3 +29,17 @@
dest: eww.scss
- src: eww.yuck.j2
dest: eww.yuck
- name: create eww scripts dir
file:
path: "$HOME/.config/eww/scripts"
state: directory
- name: copy eww scripts
copy:
src: '{{ item }}'
dest: "$HOME/.config/eww/scripts"
loop:
- get-workspaces
- get-outputs
- start-eww

View File

@ -1,10 +1,26 @@
$background: rgba(34, 34, 34, 0.9);
$active: rgba(68, 68, 68, 0.8);
$warning: rgba(243, 249, 157, 1);
$alert: rgba(255, 92, 87, 1);
$white: rgba(239, 240, 235, 1);
$darkgrey: rgba(73, 73, 73, 1);
$grey: rgba(146, 146, 146, 1);
$red: rgba(255, 92, 87, 1);
$yellow: rgba(243, 249, 157, 1);
$blue: rgba(10, 108, 245, 1);
$purple: rgba(159, 120, 255, 1);
$green: rgba(90, 247, 142, 1);
$cyan: rgba(154, 237, 254, 1);
* {
all: unset; //Unsets everything so you can style everything from scratch
font-family: "jetbrains mono light", "FontAwesome6FreeRegular", "FontAwesome6FreeSolid", "FontAwesome6Brands";
font-size: 12px;
}
//Global Styles
.bartop {
background-color: #3a3a3a;
background-color: $background;
color: #b0b4bc;
padding: 10px;
}
@ -49,6 +65,16 @@
.label-ram {
font-size: large;
}
.workspaces button:hover {
color: #D35D6E;
.workspaces {
padding-right: 30px;
}
.workspace-entry label {
padding: 0px 10px;
color: $white;
min-width: 20px;
border-top: 1px solid transparent;
border-bottom: 2px solid transparent;
}
.workspace-entry.current label {
border-bottom: 2px solid $yellow;
}

View File

@ -17,21 +17,23 @@
:onchange "")
time))
(deflisten workspaces :initial "[]" "bash ~/.config/eww/scripts/get-workspaces")
(deflisten current_workspace :initial "none" "bash ~/.config/eww/scripts/get-active-workspace")
(defwidget workspaces []
(box :class "workspaces"
:orientation "h"
:space-evenly true
:halign "start"
:spacing 10
(button :onclick "wmctrl -s 0" 1)
(button :onclick "wmctrl -s 1" 2)
(button :onclick "wmctrl -s 2" 3)
(button :onclick "wmctrl -s 3" 4)
(button :onclick "wmctrl -s 4" 5)
(button :onclick "wmctrl -s 5" 6)
(button :onclick "wmctrl -s 6" 7)
(button :onclick "wmctrl -s 7" 8)
(button :onclick "wmctrl -s 8" 9)))
(label :text "${current_workspace}" :visible false)
(for workspace in workspaces
(eventbox :onclick "swaymsg workspace ${workspace.name}"
(box :class "workspace-entry ${workspace.focused ? "current" : ""}"
(label :text "${workspace.icon}")
)
)
)
)
)
(defwidget music []
(box :class "music"
@ -54,7 +56,7 @@
(deflisten music :initial ""
"playerctl --follow metadata --format '{{ artist }} - {{ title }}' || true")
"playerctl --follow metadata --format '{% raw %}{{ artist }} - {{ title }}{% endraw %}' || true")
(defpoll volume :interval "1s"
"scripts/getvol")