Compare commits

..

1 Commits

Author SHA1 Message Date
5dec53729f
Update 2020-06-14 21:38:52 +02:00
4 changed files with 59 additions and 167 deletions

143
config
View File

@ -10,17 +10,12 @@
# Please see http://i3wm.org/docs/userguide.html for a complete reference! # Please see http://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4 set $mod Mod4
set $mod2 Control set $mod2 Mod1
set $left DP-0.3
set $right DP-0.2
set $lap DP-2
# Font for window titles. Will also be used by the bar unless a different font # Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below. ISO 10646 = Unicode # is used in the bar {} block below. ISO 10646 = Unicode
#font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 #font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
font pango:DejaVu Sans Mono 10 font pango:DejaVu Sans Mono 12
# font pango:DejaVu Sans Mono 12
# The font above is very space-efficient, that is, it looks good, sharp and # The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, if you need a lot of unicode glyphs or # clear in small sizes. However, if you need a lot of unicode glyphs or
# right-to-left text rendering, you should instead use pango for rendering and # right-to-left text rendering, you should instead use pango for rendering and
@ -32,20 +27,14 @@ floating_modifier $mod
# start a terminal # start a terminal
# bindsym $mod+Return exec i3-sensible-terminal # bindsym $mod+Return exec i3-sensible-terminal
bindsym $mod+Return exec alacritty bindsym $mod+Return exec sakura
# keepassxc
bindsym $mod+k exec /home/hasufell/.local/bin/keepmenu
# kill focused window # kill focused window
bindsym $mod+$mod2+x kill bindsym $mod+$mod2+q kill
# start dmenu (a program launcher) # start dmenu (a program launcher)
bindsym $mod+$mod2+t exec --no-startup-id rofi -show window bindsym $mod+$mod2+w exec --no-startup-id rofi -show window
bindsym $mod+Mod1+s exec --no-startup-id rofi -show run bindsym $mod+d exec --no-startup-id rofi -show run
bindsym $mod+$mod2+s exec --no-startup-id rofi -show drun
bindsym $mod+$mod2+l exec --no-startup-id systemctl suspend
bindsym $mod+l exec --no-startup-id i3lock -c 000000
# bindsym $mod+$mod2+d exec dmenu_run # bindsym $mod+$mod2+d exec dmenu_run
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop # bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
# bindsym $mod+d exec --no-startup-id xfce4-popup-whiskermenu # bindsym $mod+d exec --no-startup-id xfce4-popup-whiskermenu
@ -60,6 +49,11 @@ bindsym $mod+e focus down
bindsym $mod+o focus up bindsym $mod+o focus up
bindsym $mod+i focus right bindsym $mod+i focus right
bindsym $mod+KP_Prior focus left
bindsym $mod+KP_Down focus down
bindsym $mod+KP_Up focus up
bindsym $mod+KP_Next focus right
# alternatively, you can use the cursor keys: # alternatively, you can use the cursor keys:
bindsym $mod+Left focus left bindsym $mod+Left focus left
bindsym $mod+Down focus down bindsym $mod+Down focus down
@ -77,6 +71,10 @@ bindsym $mod+$mod2+e move down
bindsym $mod+$mod2+o move up bindsym $mod+$mod2+o move up
bindsym $mod+$mod2+i move right bindsym $mod+$mod2+i move right
bindsym $mod+$mod2+KP_Prior move left
bindsym $mod+$mod2+KP_Down move down
bindsym $mod+$mod2+KP_Up move up
bindsym $mod+$mod2+KP_Next move right
# split in horizontal orientation # split in horizontal orientation
bindsym $mod+h split v bindsym $mod+h split v
@ -85,11 +83,11 @@ bindsym $mod+h split v
bindsym $mod+v split h bindsym $mod+v split h
# enter fullscreen mode for the focused container # enter fullscreen mode for the focused container
bindsym $mod+Mod1+f fullscreen bindsym $mod+f fullscreen
# change container layout (stacked, tabbed, toggle split) # change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking bindsym $mod+s layout stacking
bindsym $mod+Mod1+w layout tabbed bindsym $mod+w layout tabbed
bindsym $mod+t layout toggle split bindsym $mod+t layout toggle split
# toggle tiling / floating # toggle tiling / floating
@ -108,13 +106,15 @@ bindsym $mod+a focus parent
workspace_layout tabbed workspace_layout tabbed
# program specific workspaces # program specific workspaces
assign [class="Steam"] number 10 assign [class="Steam"] number 2
#assign [class="Firefox"] 2 #assign [class="Firefox"] 2
#assign [class="Thunderbird"] 1 #assign [class="Thunderbird"] 1
assign [class="Pidgin"] number 2 assign [class="Pidgin"] number 2
assign [class="Mumble"] number 2 assign [class="Mumble"] number 2
set $left DVI-I-1
set $right DVI-D-0
# workspace to monitor mapping # workspace to monitor mapping
workspace 1 output $left workspace 1 output $left
@ -126,13 +126,11 @@ workspace 6 output $right
workspace 7 output $left workspace 7 output $left
workspace 8 output $right workspace 8 output $right
workspace 9 output $left workspace 9 output $left
workspace 10 output $lap workspace 10 output $right
# workspace cycling # workspace cycling
# bindsym $mod+Tab workspace next bindsym $mod+Tab workspace next
# bindsym $mod+$mod2+Tab workspace prev bindsym $mod+$mod2+Tab workspace prev
bindsym $mod+Tab [con_mark=_prevFocus0] focus
bindsym $mod+$mod2+Tab [con_mark=_prevFocus2] focus
# switch to workspace # switch to workspace
bindsym $mod+1 workspace number 1 bindsym $mod+1 workspace number 1
@ -145,27 +143,17 @@ bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8 bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9 bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10 bindsym $mod+0 workspace number 10
bindsym $mod+q workspace number 1
bindsym $mod+d workspace number 2
bindsym $mod+r workspace number 3
bindsym $mod+w workspace number 4
bindsym $mod+b workspace number 5
bindsym $mod+j workspace number 6
bindsym $mod+f workspace number 7
bindsym $mod+u workspace number 8
bindsym $mod+p workspace number 9
bindsym $mod+colon workspace number 10
bindsym $mod+KP_End workspace number 1 bindsym $mod+KP_1 workspace number 1
bindsym $mod+KP_Down workspace number 2 bindsym $mod+KP_2 workspace number 2
bindsym $mod+KP_Next workspace number 3 bindsym $mod+KP_3 workspace number 3
bindsym $mod+KP_Left workspace number 4 bindsym $mod+KP_4 workspace number 4
bindsym $mod+KP_Begin workspace number 5 bindsym $mod+KP_5 workspace number 5
bindsym $mod+KP_Right workspace number 6 bindsym $mod+KP_6 workspace number 6
bindsym $mod+KP_Home workspace number 7 bindsym $mod+KP_7 workspace number 7
bindsym $mod+KP_Up workspace number 8 bindsym $mod+KP_8 workspace number 8
bindsym $mod+KP_Prior workspace number 9 bindsym $mod+KP_9 workspace number 9
bindsym $mod+KP_Insert workspace number 10 bindsym $mod+KP_0 workspace number 10
workspace_auto_back_and_forth yes workspace_auto_back_and_forth yes
@ -180,35 +168,24 @@ bindsym $mod+$mod2+7 move container to workspace number 7
bindsym $mod+$mod2+8 move container to workspace number 8 bindsym $mod+$mod2+8 move container to workspace number 8
bindsym $mod+$mod2+9 move container to workspace number 9 bindsym $mod+$mod2+9 move container to workspace number 9
bindsym $mod+$mod2+0 move container to workspace number 10 bindsym $mod+$mod2+0 move container to workspace number 10
bindsym $mod+$mod2+q move container to workspace number 1
bindsym $mod+$mod2+d move container to workspace number 2
bindsym $mod+$mod2+r move container to workspace number 3
bindsym $mod+$mod2+w move container to workspace number 4
bindsym $mod+$mod2+b move container to workspace number 5
bindsym $mod+$mod2+j move container to workspace number 6
bindsym $mod+$mod2+f move container to workspace number 7
bindsym $mod+$mod2+u move container to workspace number 8
bindsym $mod+$mod2+p move container to workspace number 9
bindsym $mod+$mod2+colon move container to workspace number 10
bindsym $mod+$mod2+KP_End move container to workspace 1
bindsym $mod+$mod2+KP_Down move container to workspace 2
bindsym $mod+$mod2+KP_Next move container to workspace 3
bindsym $mod+$mod2+KP_Left move container to workspace 4
bindsym $mod+$mod2+KP_Begin move container to workspace 5
bindsym $mod+$mod2+KP_Right move container to workspace 6
bindsym $mod+$mod2+KP_Home move container to workspace 7
bindsym $mod+$mod2+KP_Up move container to workspace 8
bindsym $mod+$mod2+KP_Prior move container to workspace 9
bindsym $mod+$mod2+KP_Insert move container to workspace 10
bindsym $mod+$mod2+KP_1 move container to workspace number 1
bindsym $mod+$mod2+KP_2 move container to workspace number 2
bindsym $mod+$mod2+KP_3 move container to workspace number 3
bindsym $mod+$mod2+KP_4 move container to workspace number 4
bindsym $mod+$mod2+KP_5 move container to workspace number 5
bindsym $mod+$mod2+KP_6 move container to workspace number 6
bindsym $mod+$mod2+KP_7 move container to workspace number 7
bindsym $mod+$mod2+KP_8 move container to workspace number 8
bindsym $mod+$mod2+KP_9 move container to workspace number 9
bindsym $mod+$mod2+KP_0 move container to workspace number 10
# reload the configuration file # reload the configuration file
bindsym $mod+$mod2+c reload bindsym $mod+$mod2+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) # restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+$mod2+Shift+r restart bindsym $mod+$mod2+r restart
# exit i3 (logs you out of your X session) # exit i3 (logs you out of your X session)
# bindsym $mod+$mod2+x 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+$mod2+x 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'"
# programs # programs
#bindsym $mod+$mod2+f exec firefox #bindsym $mod+$mod2+f exec firefox
@ -216,16 +193,16 @@ bindsym $mod+$mod2+Shift+r restart
#bindsym $mod+$mod2+g exec gmusicbrowser #bindsym $mod+$mod2+g exec gmusicbrowser
#bindsym $mod+$mod2+p exec pidgin #bindsym $mod+$mod2+p exec pidgin
bindsym $mod+BackSpace exec spacefm bindsym $mod+BackSpace exec spacefm
bindsym $mod+equal exec ~/.local/bin/gvim bindsym $mod+plus exec gvim
# focus binding # focus binding
# bindsym $mod+$mod2+f [class="Torbrowser" instance="Navigator"] focus bindsym $mod+$mod2+f [class="Torbrowser" instance="Navigator"] focus
# bindsym $mod+$mod2+t [class="Thunderbird" instance="Mail"] focus bindsym $mod+$mod2+t [class="Thunderbird" instance="Mail"] focus
# bindsym $mod+$mod2+g [class="Gmusicbrowser"] focus bindsym $mod+$mod2+g [class="Gmusicbrowser"] focus
# bindsym $mod+$mod2+p [class="Pidgin" window_role="conversation"] focus bindsym $mod+$mod2+p [class="Pidgin" window_role="conversation"] focus
# bindsym $mod+$mod2+s [class="Terminator" instance="Terminator-root"] focus bindsym $mod+$mod2+s [class="Terminator" instance="Terminator-root"] focus
# bindsym $mod+$mod2+m [class="Mumble" instance="mumble"] focus bindsym $mod+$mod2+m [class="Mumble" instance="mumble"] focus
# bindcode 180 [class="Terminator" instance="Terminator-root"] focus bindcode 180 [class="Terminator" instance="Terminator-root"] focus
# sound # sound
#bindcode 122 exec --no-startup-id amixer sset Master 3- #bindcode 122 exec --no-startup-id amixer sset Master 3-
@ -243,8 +220,8 @@ bindsym $mod+equal exec ~/.local/bin/gvim
#bindcode 41 [class="Firefox" instance="Navigator"] focus #bindcode 41 [class="Firefox" instance="Navigator"] focus
# force floating for these # force floating for these
for_window [class="Xfrun4"] floating enable
for_window [class="Xfce4-appfinder"] floating enable for_window [class="Xfce4-appfinder"] floating enable
for_window [class="Xfrun4"] floating enable
for_window [class="Terminator" title="Terminator Preferences"] floating enable for_window [class="Terminator" title="Terminator Preferences"] floating enable
for_window [class="MPlayer"] floating enable for_window [class="MPlayer"] floating enable
for_window [class="Gtk-youtube-viewer"] floating enable for_window [class="Gtk-youtube-viewer"] floating enable
@ -321,7 +298,7 @@ mode "resize" {
bindsym Escape mode "default" bindsym Escape mode "default"
} }
bindsym $mod+Mod1+r mode "resize" bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status # Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available) # finds out, if available)
@ -339,9 +316,7 @@ mode "num" {
} }
#bindsym Num_Lock mode "num" #bindsym Num_Lock mode "num"
#exec_always --no-startup-id ~/.config/polybar/autoname_workspaces.py --norenumber_workspaces --icon_list_format mathematician exec_always --no-startup-id ~/.config/polybar/autoname_workspaces.py --norenumber_workspaces --icon_list_format mathematician
#exec_always --no-startup-id /home/hasufell/.cargo/bin/autoname_workspaces -i superscript exec_always --no-startup-id ~/.config/polybar/launch.sh
exec_always --no-startup-id ~/.config/polybar/launch.sh &> /tmp/out #exec xrandr --output DVI-D-0 --auto --right-of DVI-I-1
exec --no-startup-id ~/.config/i3/focus exec picom --config ~/.config/picom.config
# exec xrandr --output DVI-I-1 --auto --right-of DVI-D-0
# exec picom --config ~/.config/picom.config

81
focus
View File

@ -1,81 +0,0 @@
#!/bin/bash
export PATH="$HOME/.local/bin:$PATH"
# epochMillis: print the amount of millis since epoch time on the std output stream.
epochMillis(){
echo $(($(date +%s%N)/1000000))
}
# queue: array holding the focused window ids in order, the most recent focus is on index 0.
queue=( )
queueLimit=8
# pushOnQueue: insert a window id on index 0 of the queue. This function also removes the given id if was already present, the queue is an ordered set.
# arg 1: window id to insert.
pushOnQueue(){
if [ "$1" = "0x0" ]
then
return
fi
newQueue=( "$1" )
for i in "${queue[@]}"
do
if [ "$1" = "$i" ]
then
continue
fi
newQueue=( ${newQueue[@]:0} "$i" )
done
queue=( "${newQueue[@]:0:$queueLimit}" )
}
# markQueue: put i3 marks using the window ids stored on the queue. The windows are marked using "_prevFocusX" where X is a integer corresponding with the index of the element on the queue. The previously focused window (the most recent) is marked using "_prevFocus0". This function also cleans the queue from windows that can't be marked (e.g. windows that have been closed).
markQueue(){
queueCopy=( "${queue[@]}" )
queue=( )
j=0
for i in "${queueCopy[@]}"
do
i3-msg "unmark _prevFocus$j" 1>/dev/null 2>&1
if i3-msg "[id=$i] mark --add _prevFocus$j" 2>/dev/null | grep -i "\"success\":true" 1>/dev/null 2>&1
then
queue=( ${queue[@]:0} "$i" )
j=$(($j + 1))
fi
done
}
lastTime=$(epochMillis)
# permanence: period in millis used to determine if a window is worthy to be saved on the queue. This enables i3 window fast navigation without saving unworthy window ids.
permanence=1000
# main loop: read activated window ids continuously.
xprop -root -spy _NET_ACTIVE_WINDOW |
while read line
do
currentTime=$(epochMillis)
period=$(($currentTime-$lastTime))
lastTime=$currentTime
# previousFocus: window id of the previously focused (activated) window.
previousFocus=$currentFocus
# currentFocus: window id of the window that has just being activated.
currentFocus=$(echo "$line" | awk -F' ' '{printf $NF}')
# push the previousFocus id to the queue if the time spent on the previous window was greater than permanence. Check also to allow fast switching between two windows.
if [ $period -gt $permanence -o "$currentFocus" = "${queue[0]}" ]
then
pushOnQueue "$previousFocus"
fi
# if the currentFocus is marked as the previous window (_prevFocus0 or queue[0]) then swap the first two elements on the queue to allow switching.
if [ "${queue[0]}" = "$currentFocus" ]
then
queue=( ${queue[1]} ${queue[0]} ${queue[@]:2} )
fi
markQueue
done

View File

@ -1 +0,0 @@
]4;0;rgb:0000/0000/0000\]4;1;rgb:cdcd/0000/0000\]4;2;rgb:0000/cdcd/0000\]4;3;rgb:cdcd/cdcd/0000\]4;4;rgb:1e1d/9090/ffff\]4;5;rgb:cdcd/0000/cdcd\]4;6;rgb:0000/cdcd/cdcd\]4;7;rgb:e5e4/e5e4/e5e4\]4;8;rgb:4c4b/4c4b/4c4b\]4;9;rgb:ffff/0000/0000\]4;10;rgb:0000/ffff/0000\]4;11;rgb:ffff/ffff/0000\]4;12;rgb:4646/8282/b4b3\]4;13;rgb:ffff/0000/ffff\]4;14;rgb:0000/ffff/ffff\]4;15;rgb:ffff/ffff/ffff\]10;rgb:c0c0/c0c0/c0c0\]11;rgb:0000/0000/0000\]12;rgb:c0c0/c0c0/c0c0\]13;rgb:ffff/ffff/ffff\]17;rgb:c0c0/c0c0/c0c0\]19;rgb:0000/0000/0000\]4;232;rgb:0808/0808/0808\]4;256;rgb:c0c0/c0c0/c0c0\]708;rgb:ffff/ffff/ffff\

View File

@ -1 +0,0 @@
]4;0;#073642\]4;1;#dc322f\]4;2;#859900\]4;3;#b58900\]4;4;#268bd2\]4;5;#CB4B16\]4;6;#2aa198\]4;7;#eee8d5\]4;8;#6c7c80\]4;9;#dc322f\]4;10;#859900\]4;11;#b58900\]4;12;#268bd2\]4;13;#CB4B16\]4;14;#2aa198\]4;15;#eee8d5\]10;#839496\]11;#002B36\]12;#dc322f\]13;#839496\]17;#839496\]19;#073642\]4;232;#073642\]4;256;#839496\]708;#073642\