From fca079098a67c7a958fbee29ef30e189ac6912b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesper=20Fussing=20M=C3=B8rk?= Date: Fri, 6 Jul 2018 09:57:47 +0200 Subject: [PATCH] Added WS09 Fixed gpmdp script to show note/pause and nothing if gpmdp is not running --- i3/.i3/config | 9 +++++---- ...kspace8-media.json => workspace9-news.json} | 0 i3/.i3/workspaces/ws08.sh | 5 ----- i3/.i3/workspaces/ws09.sh | 5 +++++ i3status-rs/.config/i3status-rs/gpmdp.sh | 18 +++++++++++++++--- 5 files changed, 25 insertions(+), 12 deletions(-) rename i3/.i3/layouts/{workspace8-media.json => workspace9-news.json} (100%) delete mode 100755 i3/.i3/workspaces/ws08.sh create mode 100755 i3/.i3/workspaces/ws09.sh diff --git a/i3/.i3/config b/i3/.i3/config index 2866e76..8e754de 100644 --- a/i3/.i3/config +++ b/i3/.i3/config @@ -137,6 +137,7 @@ set $ws5 5:OC Test set $ws6 6:OC Prod set $ws7 7:Prod set $ws8 8:Media +set $ws9 9:News # switch to workspace bindsym $mod+1 workspace $ws1 @@ -147,6 +148,7 @@ bindsym $mod+5 workspace $ws5 bindsym $mod+6 workspace $ws6 bindsym $mod+7 workspace $ws7 bindsym $mod+8 workspace $ws8 +bindsym $mod+9 workspace $ws9 # Move focused container to workspace #bindsym $mod+Ctrl+1 move container to workspace $ws1 @@ -157,6 +159,7 @@ bindsym $mod+8 workspace $ws8 #bindsym $mod+Ctrl+6 move container to workspace $ws6 #bindsym $mod+Ctrl+7 move container to workspace $ws7 #bindsym $mod+Ctrl+8 move container to workspace $ws8 +#bindsym $mod+Ctrl+9 move container to workspace $ws9 # Move to workspace with focused container bindsym $mod+Shift+1 move container to workspace $ws1; workspace $ws1 @@ -167,6 +170,7 @@ bindsym $mod+Shift+5 move container to workspace $ws5; workspace $ws5 bindsym $mod+Shift+6 move container to workspace $ws6; workspace $ws6 bindsym $mod+Shift+7 move container to workspace $ws7; workspace $ws7 bindsym $mod+Shift+8 move container to workspace $ws8; workspace $ws8 +bindsym $mod+Shift+9 move container to workspace $ws9; workspace $ws9 # WORKSPACE CREATION bindsym $mod+Ctrl+1 exec --no-startup-id ~/.i3/workspaces/ws01.sh @@ -176,7 +180,7 @@ bindsym $mod+Ctrl+4 exec --no-startup-id ~/.i3/workspaces/ws04.sh #bindsym $mod+Ctrl+5 exec --no-startup-id ~/.i3/workspaces/ws05.sh #bindsym $mod+Ctrl+6 exec --no-startup-id ~/.i3/workspaces/ws06.sh #bindsym $mod+Ctrl+7 exec --no-startup-id ~/.i3/workspaces/ws07.sh -bindsym $mod+Ctrl+8 exec --no-startup-id ~/.i3/workspaces/ws08.sh +bindsym $mod+Ctrl+9 exec --no-startup-id ~/.i3/workspaces/ws09.sh # Open specific applications in floating mode for_window [class="Nitrogen"] floating enable sticky enable border normal @@ -210,9 +214,6 @@ mode "$mode_system" { bindsym Escape mode "default" } -# Lock screen -bindsym $mod+9 exec --no-startup-id blurlock - # Autostart applications exec --no-startup-id nitrogen --restore; sleep 1; compton -b exec --no-startup-id nm-applet diff --git a/i3/.i3/layouts/workspace8-media.json b/i3/.i3/layouts/workspace9-news.json similarity index 100% rename from i3/.i3/layouts/workspace8-media.json rename to i3/.i3/layouts/workspace9-news.json diff --git a/i3/.i3/workspaces/ws08.sh b/i3/.i3/workspaces/ws08.sh deleted file mode 100755 index b4ea163..0000000 --- a/i3/.i3/workspaces/ws08.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -. ~/.i3/env -i3-msg "workspace 8:Media; append_layout ~/.i3/layouts/workspace8-media.json" -i3-msg "workspace 8:Media; exec termite -t newsboat -e newsboat" -#i3-msg "workspace 8:Media; move workspace to output $LAPTOP" diff --git a/i3/.i3/workspaces/ws09.sh b/i3/.i3/workspaces/ws09.sh new file mode 100755 index 0000000..cde5fb2 --- /dev/null +++ b/i3/.i3/workspaces/ws09.sh @@ -0,0 +1,5 @@ +#!/bin/bash +. ~/.i3/env +i3-msg "workspace 9:News; append_layout ~/.i3/layouts/workspace9-news.json" +i3-msg "workspace 9:News; exec termite -t newsboat -e newsboat" +i3-msg "workspace 9:News; move workspace to output $SECONDARY" diff --git a/i3status-rs/.config/i3status-rs/gpmdp.sh b/i3status-rs/.config/i3status-rs/gpmdp.sh index 24265aa..b52ed77 100755 --- a/i3status-rs/.config/i3status-rs/gpmdp.sh +++ b/i3status-rs/.config/i3status-rs/gpmdp.sh @@ -1,9 +1,21 @@ #!/bin/bash +RUNNING_CMD=$(ps ax | grep gpmdp | wc -l) STATUS_CMD=$(gpmdp-remote status) -ICON='\uf001' +CURRENT_CMD=$(gpmdp-remote current) +ICON_PLAYING='\uf001' +ICON_PAUSE='\uf04c' -if [ $STATUS_CMD == "Playing" ] +if [ $RUNNING_CMD -gt 3 ] then - echo -e $ICON $(gpmdp-remote current) + if [ $STATUS_CMD == "Playing" ] + then + echo -e $ICON_PLAYING $(gpmdp-remote current) + else + current=$CURRENT_CMD + if [ ${#current} -gt 3 ] + then + echo -e $ICON_PAUSE $(gpmdp-remote current) + fi + fi fi