From 5bca040f13556d13b80a91a43b0b88ca9c21b218 Mon Sep 17 00:00:00 2001 From: Peter Son Struschka Date: Sat, 11 May 2019 15:53:16 +0700 Subject: update makefile and configs --- i3wm/.bin/spotifycl | 16 ++++++++++------ i3wm/.config/i3/config | 35 ++++++++++++++++++++++------------- i3wm/.config/polybar/config | 20 +++++++++++--------- i3wm/.config/polybar/launch.sh | 5 ++--- 4 files changed, 45 insertions(+), 31 deletions(-) (limited to 'i3wm') diff --git a/i3wm/.bin/spotifycl b/i3wm/.bin/spotifycl index 4cd6943..78d60d6 100755 --- a/i3wm/.bin/spotifycl +++ b/i3wm/.bin/spotifycl @@ -50,6 +50,7 @@ server_address = '/tmp/spotifycl-socket' class Spotify: SPOTIFY_BUS = 'org.mpris.MediaPlayer2.spotify' + SPOTIFYD_BUS = 'org.mpris.MediaPlayer2.spotifyd' SPOTIFY_OBJECT_PATH = '/org/mpris/MediaPlayer2' PLAYER_INTERFACE = 'org.mpris.MediaPlayer2.Player' @@ -81,7 +82,7 @@ class Spotify: self.freedesktop.connect_to_signal( "NameOwnerChanged", self.on_name_owner_changed, - arg0="org.mpris.MediaPlayer2.spotify" + arg0=self.SPOTIFYD_BUS ) executor = ThreadPoolExecutor(max_workers=2) @@ -197,10 +198,13 @@ class Spotify: self.last_output = line def setup_spotify(self): - self.spotify = self.session_bus.get_object( - Spotify.SPOTIFY_BUS, - Spotify.SPOTIFY_OBJECT_PATH - ) + try: + self.spotify = self.session_bus.get_object( + Spotify.SPOTIFY_BUS, + Spotify.SPOTIFY_OBJECT_PATH + ) + except dbus.DBusException: + self.spotify = self.session_bus.get_object(Spotify.SPOTIFYD_BUS, Spotify.SPOTIFY_OBJECT_PATH) def setup_properties_changed(self): try: @@ -265,7 +269,7 @@ class Spotify: self.output_playback_status(data) def on_name_owner_changed(self, name, old_owner, new_owner): - if name == 'org.mpris.MediaPlayer2.spotify': + if name == self.SPOTIFY_BUS: if new_owner: # Spotify was opened. self.setup_properties_changed() diff --git a/i3wm/.config/i3/config b/i3wm/.config/i3/config index c918ff2..29e90c2 100644 --- a/i3wm/.config/i3/config +++ b/i3wm/.config/i3/config @@ -60,31 +60,33 @@ bindsym $mod+l focus up bindsym $mod+semicolon focus right # alternatively, you can use the cursor keys: -#bindsym $mod+Left focus left bindsym $mod+Left workspace prev_on_output -bindsym $mod+Control+Left workspace prev +bindsym $mod+Shift+Left workspace prev +bindsym $mod+Shift+j workspace prev bindsym $mod+Shift+Control+Left move workspace to output left + bindsym $mod+Down focus down bindsym $mod+Up focus up -#bindsym $mod+Right focus right bindsym $mod+Right workspace next_on_output -bindsym $mod+Control+Right workspace next +bindsym $mod+Shift+Right workspace next +bindsym $mod+Shift+semicolon workspace next bindsym $mod+Shift+Control+Right move workspace to output right + bindsym $mod+b workspace back_and_forth bindsym $mod+Shift+b move container to workspace back_and_forth bindsym $mod+n exec --no-startup-id rofiworkspace # move focused window -bindsym $mod+Shift+j move left -bindsym $mod+Shift+k move down -bindsym $mod+Shift+l move up -bindsym $mod+Shift+semicolon move right +bindsym $mod+Control+j move left +bindsym $mod+Control+k move down +bindsym $mod+Control+l move up +bindsym $mod+Control+semicolon move right # alternatively, you can use the cursor keys: -bindsym $mod+Shift+Left move left -bindsym $mod+Shift+Down move down -bindsym $mod+Shift+Up move up -bindsym $mod+Shift+Right move right +bindsym $mod+Control+Left move left +bindsym $mod+Control+Down move down +bindsym $mod+Control+Up move up +bindsym $mod+Control+Right move right # split in horizontal orientation bindsym $mod+h split h @@ -231,7 +233,7 @@ bindsym XF86AudioNext exec playerctl next bindsym XF86AudioPrev exec playerctl previous -bindsym $mod+Control+l exec "xautolock -locknow" +bindsym $mod+Shift+l exec "xautolock -locknow" @@ -248,3 +250,10 @@ gaps outer 0 # status_command i3status # position top #} + + +# window assignments +for_window [class="Spotify"] move to workspace Spotify +assign [class="Firefox"] → Browser +assign [class="Zeal"] → Zeal +assign [class="kitty"] → Term diff --git a/i3wm/.config/polybar/config b/i3wm/.config/polybar/config index 07b9d8e..419ff49 100644 --- a/i3wm/.config/polybar/config +++ b/i3wm/.config/polybar/config @@ -30,7 +30,8 @@ alert = #bd2c40 [bar/topbar] monitor = ${env:MONITOR:eDP-1} width = 100% -height = 30 +height = 40 +dpi = 156 ;offset-x = 1% ;offset-y = 1% radius = 6.0 @@ -80,7 +81,8 @@ modules-right = filesystem backlight pulseaudio xkeyboard memory cpu wlan eth et [bar/topbar-second] monitor = ${env:MONITOR:eDP-1} width = 100% -height = 30 +height = 40 +dpi = 156 ;offset-x = 1% ;offset-y = 0 radius = 6.0 @@ -138,11 +140,11 @@ tail = true format =