diff --git a/kuro/config.py b/kuro/config.py index 3e05df9..e82690b 100644 --- a/kuro/config.py +++ b/kuro/config.py @@ -17,11 +17,12 @@ class Config(BaseConfig): # Default Applications app_terminal = "terminator" app_launcher = "/home/kevin/bin/dmenu_wal.sh" - web_browser = "firefox-developer-edition" + web_browser = "firefox" file_manager = "thunar" app_chat = "/usr/bin/rambox" app_irc = "quasselclient" app_mail = "thunderbird" + app_music = "spotify" cmd_brightness_up = "sudo /usr/bin/xbacklight -inc 10" cmd_brightness_down = "sudo /usr/bin/xbacklight -dec 10" lock_command = "bash /home/kevin/bin/lock.sh" @@ -150,7 +151,7 @@ class Config(BaseConfig): do_keyboard_updates = False # Show audio visualizer - show_audio_visualizer = True + show_audio_visualizer = False kill_unnecessary_glava_processes = True # Show thermal widget @@ -165,3 +166,6 @@ class Config(BaseConfig): # Audio control applications # apps_audio = ["pavucontrol"] apps_audio_afterstart = [] + + # Comma-separated list of ignored players in the media widget + media_ignore_players = "kdeconnect" diff --git a/kuro/theme.py b/kuro/theme.py index 40915d4..f3d44d6 100644 --- a/kuro/theme.py +++ b/kuro/theme.py @@ -238,7 +238,7 @@ class Kuro(BaseTheme): groups.append(Group("", spawn=Config.get('file_manager', "true"))) groups.append(Group("", spawn=Config.get('app_mail', "true"))) groups.append(Group("")) - groups.append(Group("")) + groups.append(Group("", spawn=Config.get('app_music', "true"))) groups.append(Group("")) groups.append(Group("", spawn=Config.get('apps_audio', "true"))) groups.append(Group("", layout='floating', layouts=[ @@ -325,7 +325,7 @@ class Kuro(BaseTheme): widgets.append(kuro.utils.widgets.AudioVisualizerWidget(margin_x=0, margin_y=0)) widgets.extend([ - kuro.utils.widgets.MediaWidget(), + kuro.utils.widgets.MediaWidget(ignore_players=Config.get('media_ignore_players', '')), kuro.utils.widgets.TextSpacerWidget(fontsize=14), ]) diff --git a/kuro/utils/widgets.py b/kuro/utils/widgets.py index b665507..43b31ed 100644 --- a/kuro/utils/widgets.py +++ b/kuro/utils/widgets.py @@ -262,6 +262,7 @@ class MediaWidget(base.InLoopPollText): ('on_text_stop', ' {}', 'The pattern for the text if music is stopped.'), ('update_interval', 1, 'The update interval.'), ('max_chars_per_player', 50, 'Maximum characters of text per player.'), + ('ignore_players', '', 'Comma-separated list of players to ignore.') ] player_icons = { @@ -319,13 +320,13 @@ class MediaWidget(base.InLoopPollText): if button == BUTTON_LEFT: player = self._player_to_control() if player is not None: - command = ["playerctl", "-p", player, "play-pause"] + command = ["playerctl", "-i", self.ignore_players, "-p", player, "play-pause"] _ = self.call_process(command) notify("MediaWidget", "Toggled {}".format(player)) if button == BUTTON_RIGHT: player = self._player_to_control() if player is not None: - command = ["playerctl", "-p", player, "next"] + command = ["playerctl", "-i", self.ignore_players, "-p", player, "next"] _ = self.call_process(command) if button == BUTTON_MIDDLE: # Jump to the screen that the player is on @@ -358,7 +359,7 @@ class MediaWidget(base.InLoopPollText): # Playerctl players try: - result = self.call_process(["playerctl", "-l"]) + result = self.call_process(["playerctl", "-i", self.ignore_players, "-l"]) except subprocess.CalledProcessError: result = None @@ -398,17 +399,17 @@ class MediaWidget(base.InLoopPollText): else: # PlayerCtl player - command = ["playerctl", "-p", player, "status"] + command = ["playerctl", "-i", self.ignore_players, "-p", player, "status"] cmd_result = self.call_process(command).strip() text = "Unknown" if cmd_result in ["Playing", "Paused"]: try: - artist = self.call_process(['playerctl', '-p', player, 'metadata', 'artist']).strip() + artist = self.call_process(['playerctl', "-i", self.ignore_players, '-p', player, 'metadata', 'artist']).strip() except subprocess.CalledProcessError: artist = None try: - title = self.call_process(['playerctl', '-p', player, 'metadata', 'title']).strip() + title = self.call_process(['playerctl', "-i", self.ignore_players, '-p', player, 'metadata', 'title']).strip() except subprocess.CalledProcessError: title = None