From bbe3dafed0fa6d092e2e8e1a6653584676b72e3a Mon Sep 17 00:00:00 2001 From: Christian Colglazier Date: Sun, 16 Jun 2019 21:11:56 -0400 Subject: [PATCH] Created configurable i3wm config builder --- .gitignore | 1 + i3/desktop.conf | 14 +++++++ i3/i3wm-config-gen.sh | 8 ++++ i3/{config => shared.conf} | 79 ++++---------------------------------- i3/w530.conf | 26 +++++++++++++ 5 files changed, 57 insertions(+), 71 deletions(-) create mode 100644 .gitignore create mode 100644 i3/desktop.conf create mode 100755 i3/i3wm-config-gen.sh rename i3/{config => shared.conf} (67%) create mode 100644 i3/w530.conf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2a82381 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +i3/config diff --git a/i3/desktop.conf b/i3/desktop.conf new file mode 100644 index 0000000..4d3f63d --- /dev/null +++ b/i3/desktop.conf @@ -0,0 +1,14 @@ +# Assign workspaces to monitors +workspace $ws1 output DP-2 +workspace $ws2 output DP-4 +workspace $ws3 output DVI-D-0 +workspace $ws4 output DP-2 +workspace $ws5 output DP-4 +workspace $ws6 output DVI-D-0 +workspace $ws7 output DP-2 +workspace $ws8 output DP-4 +workspace $ws9 output DVI-D-0 +workspace $ws10 output DP-2 + +# Set caps lock key to super +exec setxkbmap -option 'caps:super' \ No newline at end of file diff --git a/i3/i3wm-config-gen.sh b/i3/i3wm-config-gen.sh new file mode 100755 index 0000000..577b408 --- /dev/null +++ b/i3/i3wm-config-gen.sh @@ -0,0 +1,8 @@ +#! /bin/bash + +# Load user settings from config file. +. ~/.config/i3/settings.conf + +cat ~/.config/i3/shared.conf ~/.config/i3/${computer}.conf > ~/.config/i3/config + +i3-msg restart diff --git a/i3/config b/i3/shared.conf similarity index 67% rename from i3/config rename to i3/shared.conf index 343a39b..20b4dd1 100644 --- a/i3/config +++ b/i3/shared.conf @@ -1,24 +1,10 @@ -# i3 config file (v4) -# -# Please see https://i3wm.org/docs/userguide.html for a complete reference! - +# Set super key as mod set $mod Mod4 # Font for window titles. Will also be used by the bar unless a different font # is used in the bar {} block below. font pango:NimbusSans Bold 10 -# This font is widely installed, provides lots of unicode glyphs, right-to-left -# text rendering and scalability on retina/hidpi displays (thanks to pango). -#font pango:DejaVu Sans Mono 8 - -# Before i3 v4.8, we used to recommend this one as the default: -# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 -# The font above is very space-efficient, that is, it looks good, sharp and -# clear in small sizes. However, its unicode glyph coverage is limited, the old -# X core fonts rendering does not support right-to-left and this being a bitmap -# font, it doesn’t scale on retina/hidpi displays. - # Use Mouse+$mod to drag floating windows to their wanted position floating_modifier $mod @@ -31,11 +17,6 @@ bindsym $mod+q kill # start dmenu (a program launcher) bindsym $mod+d exec --no-startup-id dmenu_run -i -nb '#000000' -nf '#03A9F4' -sb '#E91E63' -sf '#FFCDD2' -fn 'NimbusSans:bold:pixelsize=20' -# There also is the (new) i3-dmenu-desktop which only displays applications -# shipping a .desktop file. It is a wrapper around dmenu, so you need that -# installed. -# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop - # change focus bindsym $mod+j focus left bindsym $mod+k focus down @@ -83,11 +64,7 @@ bindsym $mod+space focus mode_toggle # focus the parent container bindsym $mod+a focus parent -# focus the child container -#bindsym $mod+d focus child - -# Define names for default workspaces for which we configure key bindings later on. -# We use variables to avoid repeating the names in multiple places. +# Define names for default workspaces set $ws1 "1" set $ws2 "2" set $ws3 "3" @@ -123,21 +100,14 @@ bindsym $mod+Shift+8 move container to workspace $ws8 bindsym $mod+Shift+9 move container to workspace $ws9 bindsym $mod+Shift+0 move container to workspace $ws10 -workspace $ws1 output DP-2 -workspace $ws2 output DP-4 -workspace $ws3 output DVI-D-0 -workspace $ws4 output DP-2 -workspace $ws5 output DP-4 -workspace $ws6 output DVI-D-0 -workspace $ws7 output DP-2 -workspace $ws8 output DP-4 -workspace $ws9 output DVI-D-0 -workspace $ws10 output DP-2 - # reload the configuration file bindsym $mod+Shift+c reload # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) -bindsym $mod+Shift+r restart +#bindsym $mod+Shift+r exec "sh ~/config/i3/i3wm-config-gen.sh && restart" +bindsym $mod+Shift+r exec "sh ~/.config/i3/i3wm-config-gen.sh"; restart +#"~/.config/i3/i3wm-config-gen.sh" +#"touch ~/.config/i3/test.txt & cat test > ~/.config/i3/test.txt" +#"sh ~/.config/i3/i3wm-config-gen.sh & sleep 5 && i3-msg restart" # exit i3 (logs you out of your X session) 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'" @@ -178,34 +148,9 @@ mode "resize" { bindsym $mod+r mode "resize" -# Screen brightness controls -bindsym XF86MonBrightnessUp exec light -A 5 # increase screen brightness -bindsym XF86MonBrightnessDown exec light -U 5 # decrease screen brightness - -# Pulse Audio controls -bindsym XF86AudioRaiseVolume exec amixer set Master 3%+ #increase sound volume -bindsym XF86AudioLowerVolume exec amixer set Master 3%- #decrease sound volume -bindsym XF86AudioMute exec amixer set Master toggle # mute sound - -# Turn off trackpad -bindsym $mod+Shift+u exec sh ~/.config/i3/trackpad-toggle.sh -exec --no-startup-id ~/.config/i3/trackpad-toggle.sh - # Start bar exec --no-startup-id polybar aqua -# Wifi bar -#exec --no-startup-id nm-applet & - -# Desktop wallpaper -exec --no-startup-id feh --bg-scale ~/Pictures/wallpaper/tysiwugztgyjajrvznfy.jpg - -# -bindsym XF86Launch1 exec xset -display :0.0 dpms force off - -# lockscreen -bindsym $mod+Shift+h exec sh ~/.config/i3/lock.sh - # class border backgr. text indicator child_border client.focused #0288D1 #0288D1 #B3E5FC #000000 #000000 client.focused_inactive #212121 #212121 #ffffff #000000 #000000 @@ -220,12 +165,4 @@ for_window [class="^.*"] border pixel 1 new_window 1pixel #new_window normal 0 px -bindsym $mod+Shift+s exec scrot -b -d 5 '%Y:%m:%d:%H:%M:%S.png' -e 'mv $f ~/Desktop/' - -# Start up programs -for_window [class="Firefox"] move to workspace $ws1 -for_window [title="emacs@*"] move to workspace $ws2 -for_window [class="jetbrains-studio"] move to workspace $ws3 -for_window [title="Google Play Music Desktop Player"] move to workspace $ws10 - -exec --no-startup-id "firefox" +bindsym $mod+Shift+s exec scrot -b -d 5 '%Y:%m:%d:%H:%M:%S.png' -e 'mv $f ~/Desktop/' \ No newline at end of file diff --git a/i3/w530.conf b/i3/w530.conf new file mode 100644 index 0000000..123c3d3 --- /dev/null +++ b/i3/w530.conf @@ -0,0 +1,26 @@ +# Screen brightness controls +bindsym XF86MonBrightnessUp exec light -A 5 # increase screen brightness +bindsym XF86MonBrightnessDown exec light -U 5 # decrease screen brightness + +# Pulse Audio controls +bindsym XF86AudioRaiseVolume exec amixer set Master 3%+ #increase sound volume +bindsym XF86AudioLowerVolume exec amixer set Master 3%- #decrease sound volume +bindsym XF86AudioMute exec amixer set Master toggle # mute sound + +# Turn off trackpad +bindsym $mod+Shift+u exec sh ~/.config/i3/trackpad-toggle.sh +exec --no-startup-id ~/.config/i3/trackpad-toggle.sh + +# Desktop wallpaper +exec --no-startup-id feh --bg-scale ~/Pictures/wallpaper/tysiwugztgyjajrvznfy.jpg + +bindsym XF86Launch1 exec xset -display :0.0 dpms force off + +# Start up programs +for_window [class="Firefox"] move to workspace $ws1 +for_window [title="emacs@*"] move to workspace $ws2 +for_window [class="jetbrains-studio"] move to workspace $ws3 +for_window [title="Google Play Music Desktop Player"] move to workspace $ws10 + +exec --no-startup-id "firefox" +