From 44eedb45800cde81336d41ba4b1d12736cf8f8b5 Mon Sep 17 00:00:00 2001 From: Daniel Bauer Date: Tue, 12 Dec 2017 14:50:33 +0100 Subject: [PATCH] update --- .i3/config | 2 ++ polybar/config | 2 +- polybar/spotify.py | 6 +++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.i3/config b/.i3/config index 2a6bb32..bd02a46 100644 --- a/.i3/config +++ b/.i3/config @@ -21,6 +21,8 @@ font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 # chose a FreeType font, such as: font pango:Source Code Pro for Powerline, FontAwesome Regular, Icons 12.5 +new_window 1pixel + # Use Mouse+$mod to drag floating windows to their wanted position floating_modifier $mod diff --git a/polybar/config b/polybar/config index f905969..9ad7b12 100644 --- a/polybar/config +++ b/polybar/config @@ -51,7 +51,7 @@ scroll-down = i3wm-wsprev [bar/example_left] inherit = bar/example -monitor = ${env:MONITOR:DVI-D-0} +monitor = ${env:MONITOR:DVI-D-1} modules-left = i3 modules-center = modules-right = spotify volume filesystem memory cpu gpu date diff --git a/polybar/spotify.py b/polybar/spotify.py index 1e437ce..3783e15 100755 --- a/polybar/spotify.py +++ b/polybar/spotify.py @@ -6,7 +6,11 @@ try: spotify = bus.get_object("org.mpris.MediaPlayer2.spotify", "/org/mpris/MediaPlayer2") spotify_iface = dbus.Interface(spotify, 'org.freedesktop.DBus.Properties') props = spotify_iface.Get('org.mpris.MediaPlayer2.Player', 'Metadata') - print(str(props['xesam:artist'][0]) + " - " + str(props['xesam:title'])) + try: + out = str(props['xesam:artist'][0]) + " - " + str(props['xesam:title']) + except IndexError: + out = '' + print(out) exit except dbus.exceptions.DBusException: exit