added eww folder

This commit is contained in:
2025-03-04 23:17:15 +01:00
parent 716b8a0f2f
commit bf6adceda3
9 changed files with 141 additions and 1 deletions

41
eww/eww.scss Normal file
View File

@@ -0,0 +1,41 @@
/* Widgets */
.lorem-text {
background: darkgrey;
color: black;
}
.music {
background: transparent;
color: transparent;
&--off {
background: transparent;
color: transparent;
}
&--on {
background: #8ce513;
color: #010101;
}
&--spotify {
background: #17d860;
color: #282828;
}
&--firefox {
background: #fd8728;
color: #010101;
}
&--mpv {
background: #420042;
color: white;
}
&--chromium {
background: #1a73e8;
color: white;
}
}

46
eww/eww.yuck Normal file
View File

@@ -0,0 +1,46 @@
(include "./widgets/music.yuck")
(include "./widgets/lorem.yuck")
(defwindow topbar_0
:monitor 1
:geometry (geometry :x "0%"
:y "0%"
:width "90%"
:height "10px"
:anchor "top center")
:stacking "bg"
:exclusive true
:reserve (struts :side "top" :distance "4%")
:windowtype "dock"
(bar0))
(defwidget bar0 []
(centerbox :orientation "h"
(left)
(center)
(right)))
(defwindow left []
(box :orientation 'h'
:class: 'left'
:space-evenly true
:spacing 5
:halign 'start'
(loremText :text "Workspaces")))
(defwidget center []
(box :orientation 'h'
:class 'center'
:space-evenly false
:spacing 5
(media)))
(defwidget right []
(box :orientation 'h'
:class 'right'
:space-evenly false
:spacing 5
:halign 'end'
(loremText :text "Bar stuff")))

12
eww/scripts/getvol Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
if command -v pamixer &>/dev/null; then
if [ true == $(pamixer --get-mute) ]; then
echo 0
exit
else
pamixer --get-volume
fi
else
amixer -D pulse sget Master | awk -F '[^0-9]+' '/Left:/{print $3}'
fi

View File

5
eww/widgets/lorem.yuck Normal file
View File

@@ -0,0 +1,5 @@
(defwidget loremText [text]
(label :text text
:class 'lorem-text')
)

33
eww/widgets/music.yuck Normal file
View File

@@ -0,0 +1,33 @@
; icons used can be found on https://www.nerdfonts.com/cheat-sheet
(defvar playerIcons `{
"spotify": "",
"mpv": "",
"firefox": "",
"chromium": ""
}`)
(defvar playerRegex "spotify|firefox|mpv|chromium") ; don't forget to update this with your icons
(defvar separator " | ") ; separator between artist and title
(defvar ellipsisIcon "…") ; your icon to display in case of ellipsis
(defvar ellipsisArtist 20) ; set length for ellipsis on artist
(defvar ellipsisTitle 25) ; set length for ellipsis on title
(defwidget media []
(box :class "media"
:halign "center"
:valign "center"
:class { playerctl == '' || objectlength(playerctl) == 0
? 'music--off'
: matches(playerctl.player, playerRegex)
? 'music--' + playerctl.player
: 'music--on' }
{ playerctl == '' || objectlength(playerctl) == 0
? ''
: matches(playerctl.player, playerRegex)
? "${playerIcons[playerctl.player]} ${substring(playerctl.artist, 0, ellipsisArtist)}${strlength(playerctl.artist) >= ellipsisArtist ? ellipsisIcon : ''} | ${substring(playerctl.title, 0, ellipsisTitle)}${strlength(playerctl.title) >= ellipsisTitle ? ellipsisIcon : ''}"
: "${playerctl.player} - ${substring(playerctl.artist, 0, ellipsisArtist)}${strlength(playerctl.artist) >= ellipsisArtist ? ellipsisIcon : ''} | ${ substring(playerctl.title, 0, ellipsisTitle)}${strlength(playerctl.title) >= ellipsisTitle ? ellipsisIcon : ''}"
}
)
)
(deflisten playerctl :initial ""
`playerctl --follow metadata --format '{"player": "{{ playerName }}", "trackid": "{{ mpris:trackid }}", "length": "{{ duration(mpris:length) }}", "artUrl": "{{ mrpis:artUrl }}", "album": "{{ album }}", "albumArtist": "{{ xesam:albumArtist }}", "artist": "{{ artist }}", "autoRating": "{{ xesam:autoRating }}", "discNumber": "{{ xesam:discNumber }}", "title": "{{ title }}", "trackNumber": "{{ xesam:trackNumber }}", "url": "{{ xesam:url }}", "position": "{{ position }}"}'`
)

View File

@@ -25,7 +25,7 @@ underline_shortcut=1
wheel_scroll_lines=3
[SettingsWindow]
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\a\x80\0\0\0\0\0\0\v3\0\0\x2\xe\0\0\a\x80\0\0\0\0\0\0\v?\0\0\x2\x1a\0\0\0\x1\x2\0\0\0\a\x80\0\0\a\x80\0\0\0\0\0\0\v3\0\0\x2\xe)
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\a\x80\0\0\0\0\0\0\xe\xe9\0\0\x4\x1f\0\0\a\x80\0\0\0\0\0\0\xe\xff\0\0\x4\x37\0\0\0\x1\x2\0\0\0\a\x80\0\0\a\x80\0\0\0\0\0\0\xe\xe9\0\0\x4\x1f)
[Troubleshooting]
force_raster_widgets=1

View File

@@ -17,3 +17,5 @@ export XDG_MENU_PREFIX=arch-
export MOZ_ENABLE_WAYLAND=1
export GRIMBLAST_EDITOR='swappy -f'
export PATH=$PATH:/home/mpuchstein/.local/bin

View File

@@ -17,6 +17,7 @@ call plug#begin()
Plug 'ryanoasis/vim-devicons'
Plug 'PhilRunninger/nerdtree-visual-selection'
Plug 'elkowar/yuck.vim'
Plug 'eraserhd/parinfer-rust', {'do':'cargo build --release'}
call plug#end()
" Enable plugins and load plugin for the detected file type.