diff --git a/arch/i3.deps b/arch/i3.deps index 85f0899..b5546e9 100644 --- a/arch/i3.deps +++ b/arch/i3.deps @@ -4,3 +4,5 @@ rofi mpv mpd mpc +playerctl +zscroll-git diff --git a/bin/focus_class b/bin/focus_class new file mode 100755 index 0000000..4a60032 --- /dev/null +++ b/bin/focus_class @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +WM_DESKTOP=$(xdotool getwindowfocus) + +if [[ $WM_DESKTOP == "4194404" ]] ; then + echo "" +else + WM_CLASS=$(xprop -id "$WM_DESKTOP" WM_CLASS | awk 'NF {print $NF}' | sed 's/"//g') + WM_NAME=$(xprop -id "$WM_DESKTOP" WM_NAME | cut -d '=' -f 2 | awk -F '"' '{print $2}') + + # filtering + if [ "$WM_NAME" == "tmux" ] ; then + echo "tmux" + elif [ "$WM_CLASS" == "st-256color" ] ; then + echo "st" + elif [ "$WM_CLASS" == "Brave-browser" ] ; then + echo "Brave" + else + echo "$WM_NAME" + fi +fi + diff --git a/bin/poly_spotify b/bin/poly_spotify new file mode 100755 index 0000000..447fa8e --- /dev/null +++ b/bin/poly_spotify @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +if [[ "$1" == "--toggle" ]] ; then + playerctl play-pause +fi + +if [[ "$1" == "--scroll" ]] ; then + zscroll -l $2 \ + -p " 󰎈 " \ + --delay 0.5 \ + --update-check true \ + --match-command "playerctl status" \ + --match-text "Playing" "--scroll 1" \ + --match-text "Paused" "--scroll 0" \ + "playerctl metadata --format '{{artist}} - {{title}}'" & + wait +fi + diff --git a/editors/vim/pack/man/start/vim-go b/editors/vim/pack/man/start/vim-go index 63e79ba..582ceb4 160000 --- a/editors/vim/pack/man/start/vim-go +++ b/editors/vim/pack/man/start/vim-go @@ -1 +1 @@ -Subproject commit 63e79baca1c645ab6997fbc9f04ef0ecdda29645 +Subproject commit 582ceb4b14d1aaf9b0a52c7f4ede68ea29c85416 diff --git a/gui/polybar/config.ini b/gui/polybar/config.ini index 70b3566..65509d5 100644 --- a/gui/polybar/config.ini +++ b/gui/polybar/config.ini @@ -13,6 +13,8 @@ width = 100% radius = 5 ; font font-0 = Hack Nerd Font;2 +; ipc +enable-ipc = true ; seperator separator = | separator-foreground = ${colors.disabled} @@ -33,7 +35,7 @@ foreground = ${colors.foreground} inherit = section/base-bar height = 16pt ; modules -modules-left = xworkspaces xwindow-thinkpad weather-thinkpad +modules-left = xworkspaces focus weather-thinkpad modules-right = battery pulseaudio memory cpu wlan seafile date powermenu [bar/desktop-bar] @@ -42,11 +44,9 @@ inherit = section/base-bar ; height height = 24pt ; modules -modules-left = xworkspaces xwindow-desktop +modules-left = xworkspaces focus spotify spotify-len modules-center = weather-desktop -modules-right = pulseaudio memory cpu eth seafile date powermenu - - +modules-right = pulseaudio memory cpu temperature eth seafile date powermenu [module/xworkspaces] type = internal/xworkspaces @@ -66,16 +66,13 @@ label-urgent-padding = 1 label-empty = %name% label-empty-foreground = ${colors.disabled} label-empty-padding = 1 +format = -[module/xwindow-thinkpad] -; correct title size -type = internal/xwindow -label = %title:0:20:...% - -[module/xwindow-desktop] +[module/focus] ; correct title size -type = internal/xwindow -label = %title:0:40:...% +type = custom/script +interval = 0 +exec = ~/.dotfiles/bin/focus_class [module/pulseaudio] type = internal/pulseaudio @@ -148,6 +145,13 @@ format-prefix = "CPU " format-prefix-foreground = ${colors.primary} label = %percentage%% +[module/temperature] +type = internal/temperature +format-prefix = "TEMP " +format-prefix-foreground = ${colors.primary} +units = true +label = %temperature-c% + [network-base] type = internal/network interval = 5 @@ -189,5 +193,26 @@ content = %{F#F30}  click-left = rofi-powermenu +[module/spotify] +; playerctl interaction for spotify +type = custom/script +tail = true + +; spotify logo +format-prefix = " " +format-prefix-foreground = "#1ed760" +exec = poly_spotify --scroll 20 +click-left = poly_spotify --toggle +click-right = rofi-music + +[module/spotify-len] +; playerctl interaction for spotify +type = custom/script +tail = true + +interval = 1 +exec = playerctl metadata --format '{{duration(position)}}/{{duration(mpris:length)}}' + + [settings] screenchange-reload = true diff --git a/gui/rofi b/gui/rofi index 0786c86..692d5ef 160000 --- a/gui/rofi +++ b/gui/rofi @@ -1 +1 @@ -Subproject commit 0786c86b63dd66ae345ed51c79d46f427522dd08 +Subproject commit 692d5ef4bd5b9bd06126221cd1e895938166d183 diff --git a/meta/configs/scripts.yaml b/meta/configs/scripts.yaml index 57b4af0..3d26754 100644 --- a/meta/configs/scripts.yaml +++ b/meta/configs/scripts.yaml @@ -7,6 +7,7 @@ - link: ~/.local/bin/ssh_agent_check: bin/ssh_agent_check + ~/.local/bin/poly_spotify: bin/poly_spotify ~/.local/bin/display_uptime: bin/display_uptime ~/.local/bin/docker_check: bin/docker_check ~/.local/bin/seafile_check: bin/seafile_check diff --git a/src/fzf b/src/fzf index 6ea38b4..96c3de1 160000 --- a/src/fzf +++ b/src/fzf @@ -1 +1 @@ -Subproject commit 6ea38b44384e7a09a3863465dc3cc7b93cd7e781 +Subproject commit 96c3de12eb717e33b175fd01a9aaaac84ea8d6af