commit 537bc857045f2d13efc73c2185f491f90f3951bf
parent ff729277aad2a2111e187ec3758eaf5a4d956027
Author: Szymon Mikulicz <szymon.mikulicz@posteo.net>
Date: Mon, 18 May 2020 15:11:28 +0200
i3: Use cpp to include in config
Diffstat:
7 files changed, 194 insertions(+), 241 deletions(-)
diff --git a/i3/.i3/config b/i3/.i3/config
@@ -1,241 +0,0 @@
-# vim: filetype=i3config
-set $mod Mod4
-
-font pango:Terminus 11px
-
-floating_modifier $mod
-
-bindsym $mod+Return exec alacritty
-bindsym $mod+d exec rofi -modi drun -show drun
-
-bindsym $mod+Shift+d exec xhost + 192.168.0.227; mode "remote"
-mode "remote" {
- bindsym $mod+d exec ssh mikulicz@192.168.0.227 env DISPLAY=192.168.0.10:0 rofi -modi drun -show drun
- bindsym $mod+Return exec alacritty -e ssh -t mikulicz@192.168.0.227 env DISPLAY=192.168.0.10:0 '$SHELL'
-
- bindsym $mod+Shift+d mode "default"
-
- bindsym $mod+Shift+q kill
-
- bindsym $mod+h focus left
- bindsym $mod+j focus down
- bindsym $mod+k focus up
- bindsym $mod+l focus right
-
- bindsym $mod+Left focus left
- bindsym $mod+Down focus down
- bindsym $mod+Up focus up
- bindsym $mod+Right focus right
-
- bindsym $mod+Shift+h move left
- bindsym $mod+Shift+j move down
- bindsym $mod+Shift+k move up
- bindsym $mod+Shift+l move right
-
- 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+g split h
-
- bindsym $mod+v split v
-
- bindsym $mod+f fullscreen toggle
-
- bindsym $mod+s layout stacking
- bindsym $mod+w layout tabbed
- bindsym $mod+e layout toggle split
-
- bindsym $mod+Shift+space floating toggle
-
- bindsym $mod+space focus mode_toggle
-
- bindsym $mod+a focus parent
-
- #bindsym $mod+d focus child
-
- bindsym $mod+1 workspace 1
- bindsym $mod+2 workspace 2
- bindsym $mod+3 workspace 3
- bindsym $mod+4 workspace 4
- bindsym $mod+5 workspace 5
- bindsym $mod+6 workspace 6
- bindsym $mod+7 workspace 7
- bindsym $mod+8 workspace 8
- bindsym $mod+9 workspace 9
- bindsym $mod+0 workspace 10
-
- bindsym $mod+Shift+1 move container to workspace 1
- bindsym $mod+Shift+2 move container to workspace 2
- bindsym $mod+Shift+3 move container to workspace 3
- bindsym $mod+Shift+4 move container to workspace 4
- bindsym $mod+Shift+5 move container to workspace 5
- bindsym $mod+Shift+6 move container to workspace 6
- bindsym $mod+Shift+7 move container to workspace 7
- bindsym $mod+Shift+8 move container to workspace 8
- bindsym $mod+Shift+9 move container to workspace 9
- bindsym $mod+Shift+0 move container to workspace 10
-}
-
-bindsym $mod+Shift+q kill
-
-bindsym $mod+h focus left
-bindsym $mod+j focus down
-bindsym $mod+k focus up
-bindsym $mod+l focus right
-
-bindsym $mod+Left focus left
-bindsym $mod+Down focus down
-bindsym $mod+Up focus up
-bindsym $mod+Right focus right
-
-bindsym $mod+Shift+h move left
-bindsym $mod+Shift+j move down
-bindsym $mod+Shift+k move up
-bindsym $mod+Shift+l move right
-
-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+g split h
-
-bindsym $mod+v split v
-
-bindsym $mod+f fullscreen toggle
-
-bindsym $mod+s layout stacking
-bindsym $mod+w layout tabbed
-bindsym $mod+e layout toggle split
-
-bindsym $mod+Shift+space floating toggle
-
-bindsym $mod+space focus mode_toggle
-
-bindsym $mod+a focus parent
-
-#bindsym $mod+d focus child
-
-bindsym $mod+1 workspace 1
-bindsym $mod+2 workspace 2
-bindsym $mod+3 workspace 3
-bindsym $mod+4 workspace 4
-bindsym $mod+5 workspace 5
-bindsym $mod+6 workspace 6
-bindsym $mod+7 workspace 7
-bindsym $mod+8 workspace 8
-bindsym $mod+9 workspace 9
-bindsym $mod+0 workspace 10
-
-bindsym $mod+Shift+1 move container to workspace 1
-bindsym $mod+Shift+2 move container to workspace 2
-bindsym $mod+Shift+3 move container to workspace 3
-bindsym $mod+Shift+4 move container to workspace 4
-bindsym $mod+Shift+5 move container to workspace 5
-bindsym $mod+Shift+6 move container to workspace 6
-bindsym $mod+Shift+7 move container to workspace 7
-bindsym $mod+Shift+8 move container to workspace 8
-bindsym $mod+Shift+9 move container to workspace 9
-bindsym $mod+Shift+0 move container to workspace 10
-
-bindsym $mod+Shift+c reload
-
-bindsym $mod+Shift+r restart
-
-bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
-
-mode "resize" {
- bindsym l resize shrink width 10 px or 10 ppt
- bindsym semicolon resize grow height 10 px or 10 ppt
- bindsym apostrophe resize shrink height 10 px or 10 ppt
- bindsym backslash resize grow width 10 px or 10 ppt
-
- bindsym Left resize shrink width 10 px or 10 ppt
- bindsym Down resize grow height 10 px or 10 ppt
- bindsym Up resize shrink height 10 px or 10 ppt
- bindsym Right resize grow width 10 px or 10 ppt
-
- bindsym Return mode "default"
- bindsym Escape mode "default"
-}
-bindsym $mod+r mode "resize"
-
-set $power_control "[l]ock log[o]ut [s]uspend [h]ibernate [r]eboot [p]oweroff"
-mode $power_control {
- bindsym l exec xset s activate; mode "default"
- bindsym o exec i3-msg exit; mode "default"
- bindsym s exec systemctl suspend; mode "default"
- bindsym h exec systemctl hibernate; mode "default"
- bindsym r exec systemctl reboot; mode "default"
- bindsym p exec systemctl poweroff; mode "default"
-
- bindsym Return mode "default"
- bindsym Escape mode "default"
-}
-bindsym $mod+n mode $power_control
-
-mode "brightness" {
- bindsym grave exec ~/.i3/brightness.sh 00
- bindsym 1 exec ~/.i3/brightness.sh 10
- bindsym 2 exec ~/.i3/brightness.sh 20
- bindsym 3 exec ~/.i3/brightness.sh 30
- bindsym 4 exec ~/.i3/brightness.sh 40
- bindsym 5 exec ~/.i3/brightness.sh 50
- bindsym 6 exec ~/.i3/brightness.sh 60
- bindsym 7 exec ~/.i3/brightness.sh 70
- bindsym 8 exec ~/.i3/brightness.sh 80
- bindsym 9 exec ~/.i3/brightness.sh 90
- bindsym 0 exec ~/.i3/brightness.sh 100
-
- bindsym Return mode "default"
- bindsym Escape mode "default"
-}
-bindsym $mod+Shift+b mode "brightness"
-
-new_window pixel 2
-gaps inner 10
-
- # Pulse Audio controls
-bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5%
-bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5%
-bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle
-
-# C* Music Player controls
-bindsym XF86AudioPlay exec --no-startup-id cmus-remote -u
-bindsym XF86AudioStop exec --no-startup-id cmus-remote -s
-bindsym XF86AudioNext exec --no-startup-id cmus-remote -n
-bindsym XF86AudioPrev exec --no-startup-id cmus-remote -r
-
-# Sreen brightness controls
-bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 10 # increase screen brightness
-bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 10 # decrease screen brightness
-bindsym $mod+F12 exec --no-startup-id xbacklight -inc 10 # increase screen brightness
-bindsym $mod+F11 exec --no-startup-id xbacklight -dec 10 # decrease screen brightness
-
-# Change wallpaper
-bindsym $mod+p exec --no-startup-id ~/.fehbg
-
-# Take screenshot
-bindsym $mod+Shift+s exec --no-startup-id flameshot gui
-
-# class border backgr. text indicator
-client.focused #5c6370e6 #5c6370e6 #ffffff #5c6370e6
-client.unfocused #282c34e6 #282c34e6 #dcdfe4 #282c34e6
-client.focused_inactive #282c34e6 #282c34e6 #dcdfe4 #282c34e6
-client.urgent #383a3be6 #383a3be6 #e06c75 #383a3be6
-
-for_window [instance="polybar"] gaps inner 0
-for_window [instance="mpv"] pixel 0
-for_window [instance="^r_x11$"] floating enable
-for_window [instance="^octave\-gui$"] floating enable
-for_window [instance="^matplotlib$"] floating enable
-for_window [instance="^gnuplot_qt$"] floating enable
-
-exec ~/.screenlayout/default.sh
-exec feh --no-fehbg --bg-fill ~/.i3/BG.png
-exec --no-startup-id picom --experimental-backends
-exec --no-startup-id xss-lock -l -- ~/.i3/lock.sh
-exec --no-startup-id clight
-exec_always --no-startup-id ~/.config/polybar/launch.sh
diff --git a/i3/.i3/config.d/bindsyms b/i3/.i3/config.d/bindsyms
@@ -0,0 +1,93 @@
+// vim: filetype=i3config
+bindsym $mod+Shift+q kill
+
+bindsym $mod+h focus left
+bindsym $mod+j focus down
+bindsym $mod+k focus up
+bindsym $mod+l focus right
+
+bindsym $mod+Left focus left
+bindsym $mod+Down focus down
+bindsym $mod+Up focus up
+bindsym $mod+Right focus right
+
+bindsym $mod+Shift+h move left
+bindsym $mod+Shift+j move down
+bindsym $mod+Shift+k move up
+bindsym $mod+Shift+l move right
+
+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+g split h
+
+bindsym $mod+v split v
+
+bindsym $mod+f fullscreen toggle
+
+bindsym $mod+s layout stacking
+bindsym $mod+w layout tabbed
+bindsym $mod+e layout toggle split
+
+bindsym $mod+Shift+space floating toggle
+
+bindsym $mod+space focus mode_toggle
+
+bindsym $mod+a focus parent
+
+// bindsym $mod+d focus child
+
+bindsym $mod+1 workspace 1
+bindsym $mod+2 workspace 2
+bindsym $mod+3 workspace 3
+bindsym $mod+4 workspace 4
+bindsym $mod+5 workspace 5
+bindsym $mod+6 workspace 6
+bindsym $mod+7 workspace 7
+bindsym $mod+8 workspace 8
+bindsym $mod+9 workspace 9
+bindsym $mod+0 workspace 10
+
+bindsym $mod+Shift+1 move container to workspace 1
+bindsym $mod+Shift+2 move container to workspace 2
+bindsym $mod+Shift+3 move container to workspace 3
+bindsym $mod+Shift+4 move container to workspace 4
+bindsym $mod+Shift+5 move container to workspace 5
+bindsym $mod+Shift+6 move container to workspace 6
+bindsym $mod+Shift+7 move container to workspace 7
+bindsym $mod+Shift+8 move container to workspace 8
+bindsym $mod+Shift+9 move container to workspace 9
+bindsym $mod+Shift+0 move container to workspace 10
+
+bindsym $mod+Shift+c exec cpp ~/.i3/config.in > ~/.i3/config; reload
+
+bindsym $mod+Shift+r restart
+
+bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
+
+// Pulse Audio controls
+bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5%
+bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5%
+bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle
+
+// C* Music Player controls
+bindsym XF86AudioPlay exec --no-startup-id cmus-remote -u
+bindsym XF86AudioStop exec --no-startup-id cmus-remote -s
+bindsym XF86AudioNext exec --no-startup-id cmus-remote -n
+bindsym XF86AudioPrev exec --no-startup-id cmus-remote -r
+
+bindsym $mod+c exec alacritty --class CMUS -e fish -c cmus
+
+// Sreen brightness controls
+bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 10 # increase screen brightness
+bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 10 # decrease screen brightness
+bindsym $mod+F12 exec --no-startup-id xbacklight -inc 10 # increase screen brightness
+bindsym $mod+F11 exec --no-startup-id xbacklight -dec 10 # decrease screen brightness
+
+// Change wallpaper
+bindsym $mod+p exec --no-startup-id ~/.fehbg -r
+
+// Take screenshot
+bindsym $mod+Shift+s exec --no-startup-id flameshot gui
diff --git a/i3/.i3/config.d/execs b/i3/.i3/config.d/execs
@@ -0,0 +1,7 @@
+// vim: filetype=i3config
+exec ~/.screenlayout/default.sh
+exec ~/.fehbg
+// exec --no-startup-id picom --experimental-backends
+exec --no-startup-id xss-lock -l -- ~/.i3/lock.sh
+exec --no-startup-id redshift-gtk
+exec --no-startup-id ~/.config/polybar/launch.sh
diff --git a/i3/.i3/config.d/modes b/i3/.i3/config.d/modes
@@ -0,0 +1,48 @@
+// vim: filetype=i3config
+mode "resize" {
+ bindsym l resize shrink width 10 px or 10 ppt
+ bindsym semicolon resize grow height 10 px or 10 ppt
+ bindsym apostrophe resize shrink height 10 px or 10 ppt
+ bindsym backslash resize grow width 10 px or 10 ppt
+
+ bindsym Left resize shrink width 10 px or 10 ppt
+ bindsym Down resize grow height 10 px or 10 ppt
+ bindsym Up resize shrink height 10 px or 10 ppt
+ bindsym Right resize grow width 10 px or 10 ppt
+
+ bindsym Return mode "default"
+ bindsym Escape mode "default"
+}
+bindsym $mod+r mode "resize"
+
+set $power_control "[l]ock log[o]ut [s]uspend [h]ibernate [r]eboot [p]oweroff"
+mode $power_control {
+ bindsym l exec xset s activate; mode "default"
+ bindsym o exec i3-msg exit; mode "default"
+ bindsym s exec systemctl suspend; mode "default"
+ bindsym h exec systemctl hibernate; mode "default"
+ bindsym r exec systemctl reboot; mode "default"
+ bindsym p exec systemctl poweroff; mode "default"
+
+ bindsym Return mode "default"
+ bindsym Escape mode "default"
+}
+bindsym $mod+n mode $power_control
+
+mode "brightness" {
+ bindsym grave exec ~/.i3/brightness.sh 00
+ bindsym 1 exec ~/.i3/brightness.sh 10
+ bindsym 2 exec ~/.i3/brightness.sh 20
+ bindsym 3 exec ~/.i3/brightness.sh 30
+ bindsym 4 exec ~/.i3/brightness.sh 40
+ bindsym 5 exec ~/.i3/brightness.sh 50
+ bindsym 6 exec ~/.i3/brightness.sh 60
+ bindsym 7 exec ~/.i3/brightness.sh 70
+ bindsym 8 exec ~/.i3/brightness.sh 80
+ bindsym 9 exec ~/.i3/brightness.sh 90
+ bindsym 0 exec ~/.i3/brightness.sh 100
+
+ bindsym Return mode "default"
+ bindsym Escape mode "default"
+}
+bindsym $mod+Shift+b mode "brightness"
diff --git a/i3/.i3/config.d/windows b/i3/.i3/config.d/windows
@@ -0,0 +1,17 @@
+// vim: filetype=i3config
+// class border bg text indicator
+client.focused #5c6370e6 #5c6370e6 #ffffff #5c6370e6
+client.unfocused #282c34e6 #282c34e6 #dcdfe4 #282c34e6
+client.focused_inactive #282c34e6 #282c34e6 #dcdfe4 #282c34e6
+client.urgent #383a3be6 #383a3be6 #e06c75 #383a3be6
+
+new_window pixel 2
+gaps inner 10
+
+for_window [instance="polybar"] gaps inner 0
+for_window [instance="mpv"] pixel 0
+for_window [instance="^r_x11$"] floating enable
+for_window [instance="^octave\-gui$"] floating enable
+for_window [instance="^matplotlib$"] floating enable
+for_window [instance="^gnuplot_qt$"] floating enable
+for_window [instance="CMUS"] floating enable
diff --git a/i3/.i3/config.in b/i3/.i3/config.in
@@ -0,0 +1,25 @@
+// vim: filetype=i3config
+
+set $mod Mod4
+
+font pango:Terminus 11px
+
+floating_modifier $mod
+
+bindsym $mod+Return exec alacritty
+bindsym $mod+d exec rofi -modi drun -show drun
+
+bindsym $mod+Shift+d exec xhost + N-20L6PF16PQSK; mode "remote"
+mode "remote" {
+ bindsym $mod+d exec ssh mikulicz@N-20L6PF16PQSK env DISPLAY=SKRADAK:0 rofi -modi drun -show drun
+ bindsym $mod+Return exec alacritty -e ssh -t mikulicz@N-20L6PF16PQSK env DISPLAY=SKRADAK:0 '$SHELL'
+
+#include "config.d/bindsyms"
+
+ bindsym $mod+Shift+d mode "default"
+}
+
+#include "config.d/bindsyms"
+#include "config.d/modes"
+#include "config.d/windows"
+#include "config.d/execs"
diff --git a/i3/.i3/start.sh b/i3/.i3/start.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+cpp ~/.i3/config.in > ~/.i3/config
+exec i3