From dad9bd662680bb60f58e14ebd79848a4b4bf8f2c Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Thu, 12 Sep 2019 18:43:48 +0200 Subject: Refactored a lot --- config | 551 +++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 281 insertions(+), 270 deletions(-) diff --git a/config b/config index 6488365..d17f275 100644 --- a/config +++ b/config @@ -1,18 +1,22 @@ -# i3 config file (v4) -# -# Please see http://i3wm.org/docs/userguide.html for a complete reference! +# sway configuration file +# man sway(5) -# load xrdb -exec xrdb ~/.Xresources ; i3-msg reload +# ================================================================================ +# output device configuration +# man sway-output(5) +# ================================================================================ +# force_xinerama yes +# fake-outputs 3840x1080+0+0 -output DP-1 { + +output DP-2 { pos 0 0 res 1920x1080 background ~/.local/share/backgrounds/01-0.jpg fill dpms on } -output DP-2 { +output DP-1 { pos 1920 0 res 1920x1080 background ~/.local/share/backgrounds/01-1.jpg fill @@ -20,140 +24,32 @@ output DP-2 { dpms on } - -xwayland enable -gaps inner 0 -gaps outer 0 -smart_gaps on -smart_borders no_gaps - -# force_xinerama yes -# fake-outputs 3840x1080+0+0 - -# we basically want to configure our font with ~/.config/fontconfig/* -# font pango:GoMono Nerd Font 9 -# font pango:FuraCode Nerd Font Mono 9 -# font pango:Code New Roman Nerd Font 9 -font pango:monospace 9 - -hide_edge_borders both -title_align left -# focus_follows_mouse no -# mouse_warping none - -set $mod Mod4 - -bindsym $mod+j "mark --toggle a" - -# Use Mouse+$mod to drag floating windows to their wanted position -floating_modifier $mod - -# start a terminal -# bindsym $mod+Return exec i3-sensible-terminal -bindsym $mod+Return exec rofi -show drun -show-icons -bindsym Mod1+F2 exec rofi -show drun -bg #222222 -fg #888888 -hlbg #285577 -hlfg #ffffff -show-icons -5 -bindsym $mod+t exec termite -# bindsym $mod+t exec termite -# bindsym $mod+t exec urxvt -bindsym $mod+e exec thunar -bindsym $mod+l exec swaylock -f -i "/home/max/.local/share/backgrounds/IMG_5656 - IMG_5684-02.png" - -bindsym $mod+F10 exec pactl set-sink-mute 0 toggle -bindsym $mod+F11 exec pactl set-sink-volume 0 -5% -bindsym $mod+F12 exec pactl set-sink-volume 0 +5% - -# Pulse Audio controls -bindsym XF86AudioRaiseVolume exec pactl set-sink-volume 0 +5% # increase sound volume -bindsym XF86AudioLowerVolume exec pactl set-sink-volume 0 -5% # decrease sound volume -bindsym XF86AudioMute exec pactl set-sink-mute 0 toggle # mute sound - -# exec xrandr --dpi 95.48 --output LVDS-1 --mode 1024x768 && xrandr --output LVDS-1 --mode 1280x800 -# bindcode 156 -# exec xrandr --output DP-1 --rotate left --pos 1920x-420 -# exec xrandr --output DP1 --rotate left --right-of HDMI1 -# exec xrandr --output DP1 --rotate left --pos 1920x-420 - -# kill focused window -bindsym $mod+Shift+q kill -bindsym Mod1+F4 kill - -# start dmenu (a program launcher) -# bindsym $mod+d exec dmenu_run -# 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 -# bindsym $mod+d exec --no-startup-id j4-dmenu-desktop - - -bindsym $mod+Prior focus parent -bindsym $mod+Next focus child -bindsym $mod+Left focus left -bindsym $mod+Right focus right -bindsym $mod+Down focus down -bindsym $mod+Up focus up -bindsym $mod+Tab focus output right -bindsym $mod+Shift+Tab focus output left -bindsym mod1+Tab focus right -bindsym mod1+Shift+Tab focus left - -# alternatively, you can use the cursor keys: -bindsym $mod+Shift+Left move left ; exec pkill -SIGRTMIN+11 i3blocks -bindsym $mod+Shift+Down move down ; exec pkill -SIGRTMIN+11 i3blocks -bindsym $mod+Shift+Up move up ; exec pkill -SIGRTMIN+11 i3blocks -bindsym $mod+Shift+Right move right ; exec pkill -SIGRTMIN+11 i3blocks - -# split in horizontal orientation -# bindsym $mod+h split h - -# split in vertical orientation -# bindsym $mod+v split v - -# enter fullscreen mode for the focused container -bindsym $mod+f fullscreen toggle -bindsym $mod+g fullscreen toggle global - -# change container layout (stacked, tabbed, toggle split) -bindsym $mod+s layout stacking -bindsym $mod+w layout tabbed -bindsym $mod+q layout toggle split -bindsym $mod+x layout toggle all - -# toggle tiling / floating -bindsym $mod+Shift+space floating toggle - -# change focus between tiling / floating windows -# bindsym $mod+space focus mode_toggle - -# focus the parent container -bindsym $mod+a focus parent - -# focus the child container -#bindsym $mod+d focus child - +# ================================================================================ +# Workspace settings +# ================================================================================ workspace 1 output VGA1 workspace_layout tabbed # customize workspace names -set $WS1 1:1⃣ -set $WS2 2:2⃣ -set $WS3 3:3⃣ -set $WS4 4:4⃣ -set $WS5 5:5⃣ -set $WS6 6:6⃣ -set $WS7 7:7⃣ -set $WS8 8:8⃣ -set $WS9 9:9⃣ -set $WS10 10:0⃣ - -assign [class="^Thunderbird$"] → $WS10 -assign [class="^Pidgin"] → $WS10 -assign [class="^Hexchat"] → $WS10 -assign [class="(?i)pidgin"] → $WS10 +set $WS0 0:🄌 +set $WS1 1:➊ +set $WS2 2:➋ +set $WS3 3:➌ +set $WS4 4:➍ +set $WS5 5:➎ +set $WS6 6:➏ +set $WS7 7:➐ +set $WS8 8:➑ +set $WS9 9:➒ + +workspace $WS0 output XWAYLAND1 HDMI-1 DP-1 VGA-1 +workspace $WS1 output primary +workspace $WS9 output XWAYLAND1 HDMI-1 DP-1 VGA-1 bindsym Mod4+BackSpace exec i3-msg move workspace to output right # switch to workspace +bindsym Mod4+0 workspace $WS0 bindsym Mod4+1 workspace $WS1 bindsym Mod4+2 workspace $WS2 bindsym Mod4+3 workspace $WS3 @@ -163,9 +59,9 @@ bindsym Mod4+6 workspace $WS6 bindsym Mod4+7 workspace $WS7 bindsym Mod4+8 workspace $WS8 bindsym Mod4+9 workspace $WS9 -bindsym Mod4+0 workspace $WS10 # move focused container to workspace +bindsym Mod4+Shift+0 move container to workspace $WS0 bindsym Mod4+Shift+1 move container to workspace $WS1 bindsym Mod4+Shift+2 move container to workspace $WS2 bindsym Mod4+Shift+3 move container to workspace $WS3 @@ -175,132 +71,36 @@ bindsym Mod4+Shift+6 move container to workspace $WS6 bindsym Mod4+Shift+7 move container to workspace $WS7 bindsym Mod4+Shift+8 move container to workspace $WS8 bindsym Mod4+Shift+9 move container to workspace $WS9 -bindsym Mod4+Shift+0 move container to workspace $WS10 - -# workspace 1 output DP-1 -# workspace 2 output DP-1 -# workspace 3 output DP-1 -# workspace 4 output DP-1 -# workspace 5 output HDMI-1 -# workspace 6 output HDMI-1 -# workspace 7 output HDMI-1 -# workspace 8 output HDMI-1 -# workspace "music" output HDMI-1 -# workspace "background" output HDMI-1 - -# 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 -# 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'" - - -bindsym $mod+m move scratchpad -bindsym $mod+Shift+m scratchpad show ; resize set 1920 920 ; move position center - - - -bindsym $mod+F2 exec i3-input -F 'rename workspace to "%s"' -P 'New name: ' -bindsym Control+Mod1+Left workspace prev_on_output -bindsym Control+Mod1+Right workspace next_on_output - -# move focused window -bindsym $mod+Shift+h move left -bindsym $mod+Shift+j move down -bindsym $mod+Shift+k move up -bindsym $mod+Shift+l move right - -# split in horizontal orientation -# bindsym $mod+Shift+v split h - -# split in vertical orientation -# bindsym $mod+v split v -bindsym $mod+v split toggle -bindsym $mod+space split toggle - - - -bindsym $mod+r mode "resize" -# resize window (you can also use the mouse for that) -mode "resize" { - # These bindings trigger as soon as you enter the resize mode - - # Pressing left will shrink the window’s width. - # Pressing right will grow the window’s width. - # Pressing up will shrink the window’s height. - # Pressing down will grow the window’s height. - bindsym $mod+h resize shrink width 4 px or 4 ppt - bindsym $mod+j resize grow height 4 px or 4 ppt - bindsym $mod+k resize shrink height 4 px or 4 ppt - bindsym $mod+l resize grow width 4 px or 4 ppt - - # same bindings, but for the arrow keys - bindsym Left resize shrink width 4 px or 4 ppt - bindsym Up resize grow height 4 px or 4 ppt - bindsym Down resize shrink height 4 px or 4 ppt - bindsym Right resize grow width 4 px or 4 ppt - - # back to normal: Enter or Escape - bindsym Return mode "default" - bindsym Escape mode "default" -} - - -set $mode_brightness "display brightness 🔅 🔆" -bindsym $mod+b mode $mode_brightness -mode $mode_brightness { - bindsym Up exec xrandr-brightness .1 - bindsym Down exec xrandr-brightness -.1 - bindsym Return mode "default" - bindsym Escape mode "default" -} - - - - - -#! exec: execute when starting -#! exec_always: execute when starting or restarting - -# exec xrandr --output HDMI-1 --right-of DP-1 -# exec xrandr --output HDMI-1 --right-of VGA-1 -# exec /usr/bin/xrandr-reset.sh -exec xset r rate 330 40 -exec xinput --set-prop 'Xornet gaming mouse' 'libinput Accel Speed' 0.1 -# exec setsid xautolock -locker swaylock - -exec swayidle -w timeout 300 'swaylock -f' timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' before-sleep 'swaylock -f -c 000000' - -# exec gnome-keyring-daemon --start --components=secrets -# start compositor... -# exec compton -b --config ~/.config/i3/compton.conf -# exec nitrogen --restore -exec setsid mako -exec nm-applet -exec pidgin -exec bash -c 'for d in ~/.config/autostart/*.desktop; do awk -e 'match($0,"Exec=(.*)",q){ gsub(/ %.+/, "", q[1]); system("setsid -f " q[1])};' $d; done' -exec_always setxkbmap de,us -device evdev -model pc105 -option "" -option keypad:pointerkeys,grp_led:caps,grp:caps_toggle,terminate:ctrl_alt_bksp -v 1 -print -# exec setxkbmap -option caps:escape - - - - -exec setsid hexchat -e --minimize=2 - - -# ============================================== +# ================================================================================ # base16 Xressource depenend color configuration # with default values from base16-tomorrow-night -# ============================================== +# ================================================================================ +xwayland enable +hide_edge_borders both +title_align left +# gaps inner 6 +# smart_gaps on +# smart_borders no_gaps +# focus_follows_mouse no +# mouse_warping none + +# we basically want to configure our font with ~/.config/fontconfig/* and can +# configure what is called monospace that way. It is more portable that way. +font pango:monospace 9 +# font pango:GoMono Nerd Font 9 +# font pango:FuraCode Nerd Font Mono 9 +# font pango:Code New Roman Nerd Font 9 + +# load xrdb +exec xrdb ~/.Xresources ; swaymsg reload include /home/max/.config/base16/base16-sway/themes/base16-tomorrow.config # main variables ssource default # d variable default set $background $base01 set $foreground $base05 -set $cursorColor #00ff00 +set $cursorColor $foreground # set_from_resource $foreground base16.cursor $cursorColor # set_from_resource $foreground base16.cursor $base05 @@ -342,24 +142,36 @@ client.placeholder $base00 $base00 $base05 $base00 $base00 client.background $background -# for_window [class="^.*"] border normal 3 -# for_window [title="^.*Thunderbird"] border pixel 0 -# for_window [title="^.*Chromium"] border pixel 0 -# for_window [class="Gvim"] border pixel 0 -for_window [class="(?i)evolution"] title_format "📧 %title" -for_window [class="(?i)thunderbird"] title_format " %title" -for_window [class="(?i)firefox"] title_format " %title" -for_window [class="(?i)chromium"] title_format " %title" -for_window [class="(?i)hexchat"] title_format " %title" -for_window [class="(?i)pidgin"] title_format "👥 %title" -for_window [class="(?i)thunar"] title_format "🗄️ %title" -for_window [class="(?i)keepassx?"] title_format "🔑 %title" -for_window [class="(?i).*terminal?"] title_format " %title" -for_window [class="(?i).*termite?"] title_format " %title" -for_window [class="(?i)xfce4-appfinder"] title_format " %title" -for_window [title="YouTube"] title_format " %title" -for_window [title=""] title_format "%title" -for_window [title=" "] title_format "%title" + + +# ================================================================================ +# windows assignments and special treatment, e.g. icons +# ================================================================================ +assign [class="^Pidgin"] $WS0 +assign [class="^Hexchat"] $WS0 +assign [class="(?i)pidgin"] $WS0 +assign [class="^Thunderbird$"] $WS0 +assign [title="(?i)weechat"] $WS0 +# for_window [class="^.*"] border normal 3 +# for_window [title="^.*Thunderbird"] border pixel 0 +# for_window [title="^.*Chromium"] border pixel 0 +# for_window [class="Gvim"] border pixel 0 +for_window [title="(?i)Evolution"] title_format "📧 %title" +for_window [class="(?i)firefox"] title_format " %title" +for_window [class="(?i)chromium"] title_format " %title" +for_window [class="(?i)hexchat"] title_format " %title" +for_window [class="(?i)pidgin"] title_format "👥 %title" +for_window [class="(?i)thunar"] title_format "🗄️ %title" +for_window [class="(?i)keepassx?"] title_format "🔑 %title" +for_window [class="(?i).*terminal?"] title_format " %title" +for_window [class="(?i).*termite?"] title_format " %title" +for_window [class="(?i)xfce4-appfinder"] title_format " %title" +for_window [class="(?i)thunderbird"] title_format " %title" +for_window [title="(?i)weechat"] title_format " %title" +for_window [title="YouTube"] title_format " %title" +for_window [title=""] title_format "%title" +for_window [title=" "] title_format "%title" + # for_window [class="(?i)xfce4-terminal"] border pixel 0 # for_window [class="(?i)xfce4-appfinder"] border pixel 0 # for_window [title="^.*\|"] border pixel 4 @@ -371,6 +183,144 @@ for_window [title=" "] title_format "%title" # for_window [class=".*"] title_format "┋ %title" # for_window [con_id="__focused__"] title_format "%title" + + +# ================================================================================ +# Keyboard mappings +# Mod1 ctrl +# Mod4 windows key +# ================================================================================ + +set $mod Mod4 +bindsym $mod+j "mark --toggle a" + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# restart sway or reload config +bindsym $mod+Shift+c reload +bindsym $mod+Shift+r restart + +# kill focused window +bindsym $mod+Shift+q kill +bindsym Mod1+F4 kill + +bindsym $mod+F2 exec i3-input -F 'rename workspace to "%s"' -P 'New name: ' +bindsym Control+Mod1+Left workspace prev_on_output +bindsym Control+Mod1+Right workspace next_on_output + +# move focused window +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+Tab focus output right +bindsym $mod+Shift+Tab focus output left +bindsym mod1+Tab focus right +bindsym mod1+Shift+Tab focus left +bindsym $mod+Next focus child +bindsym $mod+Left focus left +bindsym $mod+Right focus right +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Prior focus parent +bindsym $mod+a focus parent + +# alternatively, you can use the cursor keys: +bindsym $mod+Shift+Left move left ; exec pkill -SIGRTMIN+11 i3blocks +bindsym $mod+Shift+Down move down ; exec pkill -SIGRTMIN+11 i3blocks +bindsym $mod+Shift+Up move up ; exec pkill -SIGRTMIN+11 i3blocks +bindsym $mod+Shift+Right move right ; exec pkill -SIGRTMIN+11 i3blocks + + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+q layout toggle split +bindsym $mod+x layout toggle all + +bindsym $mod+v split toggle +bindsym $mod+space split toggle + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle +bindsym $mod+g fullscreen toggle global + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle +bindsym $mod+m move scratchpad +bindsym $mod+Shift+m scratchpad show ; resize set 1920 920 ; move position center + +# start a terminal +# bindsym $mod+Return exec i3-sensible-terminal +bindsym $mod+Return exec "killall rofi ; rofi -show drun -show-icons" +bindsym Mod1+F2 exec "killall rofi ; rofi -show drun -bg #222222 -fg #888888 -hlbg #285577 -hlfg #ffffff -show-icons -5" +bindsym $mod+t exec alacritty +bindsym $mod+e exec thunar +bindsym $mod+l exec swaylock -K -f -F -c "#000000" --text-color '#ffffff' --indicator-radius 200 --indicator-thickness 10 +bindsym $mod+d exec i3-dmenu-desktop +# Pulse Audio controls +bindsym $mod+F10 exec pactl set-sink-mute @DEFAULT_SINK@ toggle +bindsym $mod+F11 exec pactl set-sink-volume @DEFAULT_SINK@ -5% +bindsym $mod+F12 exec pactl set-sink-volume @DEFAULT_SINK@ +5% +bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% +bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% +bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle + + + +# change focus between tiling / floating windows +# bindsym $mod+space focus mode_toggle + +# focus the child container +#bindsym $mod+d focus child + +# 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'" +# split in horizontal orientation +# bindsym $mod+h split h + +# split in vertical orientation +# bindsym $mod+v split v + +# resize window (you can also use the mouse for that) +bindsym $mod+r mode "resize" +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + + # Pressing left will shrink the window’s width. + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. + bindsym $mod+h resize shrink width 4 px or 4 ppt + bindsym $mod+j resize grow height 4 px or 4 ppt + bindsym $mod+k resize shrink height 4 px or 4 ppt + bindsym $mod+l resize grow width 4 px or 4 ppt + + # same bindings, but for the arrow keys + bindsym Left resize shrink width 4 px or 4 ppt + bindsym Up resize grow height 4 px or 4 ppt + bindsym Down resize shrink height 4 px or 4 ppt + bindsym Right resize grow width 4 px or 4 ppt + + # back to normal: Enter or Escape + bindsym Return mode "default" + bindsym Escape mode "default" +} + + +set $mode_brightness "display brightness 🔅 🔆" +bindsym $mod+b mode $mode_brightness +mode $mode_brightness { + bindsym Up exec xrandr-brightness .1 + bindsym Down exec xrandr-brightness -.1 + bindsym Return mode "default" + bindsym Escape mode "default" +} + + # Press $mod+o followed by either f, t, Escape or Return to launch firefox, # thunderbird or return to the default mode, respectively. set $mode_launcher Launch: [f]irefox [t]hunderbird @@ -383,6 +333,67 @@ mode "$mode_launcher" { bindsym Escape mode "default" bindsym Return mode "default" } +# bindsym $mod+d exec --no-startup-id j4-dmenu-desktop +# exec xrandr --dpi 95.48 --output LVDS-1 --mode 1024x768 && xrandr --output LVDS-1 --mode 1280x800 +# bindcode 156 +# exec xrandr --output DP-1 --rotate left --pos 1920x-420 +# exec xrandr --output DP1 --rotate left --right-of HDMI1 +# exec xrandr --output DP1 --rotate left --pos 1920x-420 + + + + + + +# ================================================================================ +# Execute (autostart) further applications + +#! exec: execute when starting +#! exec_always: execute when starting or restarting +# ================================================================================ + + +# exec xrandr --output HDMI-1 --right-of DP-1 +# exec xrandr --output HDMI-1 --right-of VGA-1 +# exec /usr/bin/xrandr-reset.sh +# exec setsid xautolock -locker swaylock + +exec swayidle -w timeout 300 'swaylock -f' timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' before-sleep 'swaylock -f -c 000000' + +# exec gnome-keyring-daemon --start --components=secrets +# start compositor... +# exec compton -b --config ~/.config/i3/compton.conf +# exec nitrogen --restore +exec mako +bindsym ctrl+space exec makoctl dismiss -a + +exec nm-applet +# exec pidgin +exec bash -c 'for d in ~/.config/autostart/*.desktop; do awk -e 'match($0,"Exec=(.*)",q){ gsub(/ %.+/, "", q[1]); system("setsid -f " q[1])};' $d; done' + +# exec setxkbmap de,us -device evdev -model pc105 -option "" -option keypad:pointerkeys,grp_led:caps,grp:caps_toggle,terminate:ctrl_alt_bksp -v 1 -print +# exec xset r rate 330 40 +# exec xinput --set-prop 'Xornet gaming mouse' 'libinput Accel Speed' 0.1 +# exec setxkbmap -option caps:escape + + + +# input 16700:8467:Dell_KB216_Wired_Keyboard_Consumer_Control { +# xkb_layout "us" +# xkb_variant "altgr-intl,nodeadkeys" +# xkb_options "keypad:pointerkeys,grp_led:caps,grp:caps_toggle,terminate:ctrl_alt_bksp" +# xkb_model "pc105" +# xkb_numlock "enable" +# repeat_delay 100 +# repeat_rate 330 +# } + + + + + +# exec setsid hexchat -e --minimize=2 +exec termite -e /home/max/.local/bin/weechat -# vim: iskeyword+=\$,\-,\# nospell ft=tcl +# vim: iskeyword+=\$,\-,\#,(,) nospell ft=tcl -- cgit v1.2.3