mirror of
https://github.com/dcarrillo/dotfiles.git
synced 2025-01-09 16:56:48 +00:00
[polybar] Update conf for compatibility with polybar 3.7.0
This commit is contained in:
parent
0d35b2858e
commit
a4cdf15790
@ -39,14 +39,6 @@ module-margin-right = 2
|
||||
separator =
|
||||
dim-value = 1.0
|
||||
locale = es_ES.UTF-8
|
||||
tray-position = right
|
||||
tray-detached = false
|
||||
tray-maxsize = 32
|
||||
tray-background = ${root.background}
|
||||
tray-offset-x = 0
|
||||
tray-offset-y = 0
|
||||
tray-padding = 10
|
||||
tray-scale = 1.0
|
||||
|
||||
width = 100%
|
||||
enable-ipc = true
|
||||
@ -58,18 +50,18 @@ fixed-center = true
|
||||
background = ${colors.background}
|
||||
foreground = ${colors.foreground}
|
||||
|
||||
font-0 = "RobotoMono Nerd Font Mono:style=Regular:size=16:antialias=true;1"
|
||||
font-0 = "RobotoMono Nerd Font Mono:style=Regular:size=16:antialias=true;4"
|
||||
; https://fontawesome.com/cheatsheet/free
|
||||
font-1 = "FontAwesome:size=16:antialias=true;2"
|
||||
font-2 = "Material Icons:size=16:antialias=true;1"
|
||||
font-3 = "NotoSans-Regular:size=18:weight=bold:antialias=true;2"
|
||||
font-4 = "NotoSans-Regular:size=28:weight=bold:antialias=true;-12"
|
||||
font-3 = "NotoSans-Regular:size=18:weight=bold:antialias=true;6"
|
||||
font-4 = "NotoSans-Regular:size=28:weight=bold:antialias=true;-11
|
||||
font-5 = "FontAwesome:size=21:antialias=true;4"
|
||||
font-6 = "Font Awesome 6 Brands-Regular-400:size=32:antialias=true;1"
|
||||
|
||||
modules-left = polywins
|
||||
modules-center = custom_date
|
||||
modules-right = updates cpu_bar memory_bar docker vpn network_status network_usage alsa_bar
|
||||
modules-right = updates cpu_bar memory_bar docker vpn network_status network_usage alsa_bar tray
|
||||
|
||||
cursor-click = pointer
|
||||
cursor-scroll = ns-resize
|
||||
|
@ -1,6 +1,6 @@
|
||||
[module/windows]
|
||||
type = custom/text
|
||||
content =" "
|
||||
label =" "
|
||||
click-left = rofi -modi window -show window -theme $ROFI_THEME -show-icons -location 1 -yoffset +45 -xoffset +20
|
||||
|
||||
[module/mpd]
|
||||
@ -98,13 +98,6 @@ type = custom/script
|
||||
exec = ~/.config/polybar/scripts/check_vpn
|
||||
interval = 5
|
||||
|
||||
[module/spotify]
|
||||
type = custom/script
|
||||
exec = ~/.config/polybar/scripts/spotify.py
|
||||
interval = 5
|
||||
format-prefix = " "
|
||||
format-font = 1
|
||||
|
||||
[module/date]
|
||||
type = internal/date
|
||||
interval = 1
|
||||
@ -187,3 +180,9 @@ exec = ~/.config/polybar/scripts/docker
|
||||
exec-if = docker ps -q
|
||||
interval = 10
|
||||
label = "%output%"
|
||||
|
||||
[module/tray]
|
||||
type = internal/tray
|
||||
tray-maxsize = 40
|
||||
tray-background = ${root.background}
|
||||
tray-spacing = 7
|
||||
|
@ -69,11 +69,11 @@ get_icon_by_name()
|
||||
[librewolf]=
|
||||
[nautilus]=
|
||||
[nextcloud]=
|
||||
[nuclear]=
|
||||
[nvim]=
|
||||
[seahorse]=
|
||||
[skype]=
|
||||
[slack]=
|
||||
[spotify]=
|
||||
[spotube]=
|
||||
[steam]=
|
||||
[telegramdesktop]=
|
||||
|
@ -1,35 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import dbus
|
||||
|
||||
bus_name = 'org.mpris.MediaPlayer2.spotify'
|
||||
|
||||
|
||||
def get_spotify_song():
|
||||
output = ''
|
||||
|
||||
try:
|
||||
session_bus = dbus.SessionBus()
|
||||
spotify_bus = session_bus.get_object(bus_name, '/org/mpris/MediaPlayer2')
|
||||
spotify_properties = dbus.Interface(spotify_bus, 'org.freedesktop.DBus.Properties')
|
||||
metadata = spotify_properties.Get("org.mpris.MediaPlayer2.Player", "Metadata")
|
||||
|
||||
artist = metadata['xesam:artist'][0]
|
||||
title = metadata['xesam:title']
|
||||
|
||||
window_title = artist + ' - ' + title
|
||||
|
||||
output = "%{A1:$WM_CONTROL '" + window_title + "' &:}" + window_title + "%{A}"
|
||||
except dbus.DBusException as e:
|
||||
if (e.get_dbus_message() == f'The name {bus_name} was not provided by any .service files'):
|
||||
pass
|
||||
else:
|
||||
output = e.get_dbus_message()
|
||||
except Exception as e:
|
||||
output = str(e)
|
||||
|
||||
print(output)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
get_spotify_song()
|
Loading…
Reference in New Issue
Block a user