mirror of
https://github.com/eoli3n/dotfiles
synced 2024-11-22 06:51:58 +01:00
added static sway workspace eww widget
This commit is contained in:
parent
8ffed97f67
commit
d284a47a54
3
roles/eww/files/change-active-workspace
Executable file
3
roles/eww/files/change-active-workspace
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
3
roles/eww/files/get-active-workspace
Executable file
3
roles/eww/files/get-active-workspace
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
swaymsg -t get_workspaces --raw | jq -r '.[] | select(.focused == true) | .name'
|
3
roles/eww/files/get-workspaces
Executable file
3
roles/eww/files/get-workspaces
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
swaymsg -t get_workspaces --raw | jq -c 'map({name: .name | tostring, output: .output, icon: .name[2:]})'
|
@ -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-active-workspace
|
||||
- get-workspaces
|
||||
#- change-active-workspace
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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.name == current_workspace ? "current" : ""}"
|
||||
(label :text "${workspace.icon}")
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defwidget music []
|
||||
(box :class "music"
|
||||
|
Loading…
Reference in New Issue
Block a user