Compare commits

...

6 Commits

Author SHA1 Message Date
Julian Ospald 77fcdd926b
Update 2022-07-28 00:13:51 +08:00
Julian Ospald a9a3ecce2c
Update 2020-08-22 20:40:55 +02:00
Julian Ospald 57fd0f46e1
Add keepmenu 2020-06-19 21:01:15 +02:00
Julian Ospald 1faf2abc38
Update 2020-06-19 21:01:12 +02:00
Julian Ospald 3c2d3dd85d
Update 2020-05-07 01:40:09 +02:00
Julian Ospald 3b72aabbff More rofi and suspend/lock 2020-02-05 17:26:43 +01:00
4 changed files with 201 additions and 68 deletions

186
config
View File

@ -10,11 +10,17 @@
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
set $mod2 Control
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
# 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 pango:DejaVu Sans Mono 10
# font pango:DejaVu Sans Mono 12
# 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
# right-to-left text rendering, you should instead use pango for rendering and
@ -25,15 +31,22 @@ font pango:DejaVu Sans Mono 10
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec sakura
# bindsym $mod+Return exec i3-sensible-terminal
bindsym $mod+Return exec alacritty
# keepassxc
bindsym $mod+k exec /home/hasufell/.local/bin/keepmenu
# kill focused window
bindsym $mod+Shift+q kill
bindsym $mod+$mod2+x kill
# start dmenu (a program launcher)
bindsym $mod+Shift+w exec --no-startup-id rofi -show window
bindsym $mod+d exec --no-startup-id rofi -show run
# bindsym $mod+Shift+d exec dmenu_run
bindsym $mod+$mod2+t exec --no-startup-id rofi -show window
bindsym $mod+Mod1+s 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+d exec --no-startup-id i3-dmenu-desktop
# bindsym $mod+d exec --no-startup-id xfce4-popup-whiskermenu
# There also is the (new) i3-dmenu-desktop which only displays applications
@ -42,10 +55,10 @@ bindsym $mod+d exec --no-startup-id rofi -show run
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+odiaeresis focus right
bindsym $mod+n focus left
bindsym $mod+e focus down
bindsym $mod+o focus up
bindsym $mod+i focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
@ -53,17 +66,17 @@ bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+odiaeresis move right
# alternatively, you can use the cursor keys:
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+$mod2+Left move left
bindsym $mod+$mod2+Down move down
bindsym $mod+$mod2+Up move up
bindsym $mod+$mod2+Right move right
bindsym $mod+$mod2+n move left
bindsym $mod+$mod2+e move down
bindsym $mod+$mod2+o move up
bindsym $mod+$mod2+i move right
# split in horizontal orientation
bindsym $mod+h split v
@ -72,15 +85,15 @@ bindsym $mod+h split v
bindsym $mod+v split h
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen
bindsym $mod+Mod1+f fullscreen
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
bindsym $mod+Mod1+w layout tabbed
bindsym $mod+t layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
bindsym $mod+$mod2+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
@ -95,15 +108,13 @@ bindsym $mod+a focus parent
workspace_layout tabbed
# program specific workspaces
assign [class="Steam"] number 2
assign [class="Steam"] number 10
#assign [class="Firefox"] 2
#assign [class="Thunderbird"] 1
assign [class="Pidgin"] number 2
assign [class="Mumble"] number 2
set $left eDP1
set $right HDMI2
# workspace to monitor mapping
workspace 1 output $left
@ -115,11 +126,13 @@ workspace 6 output $right
workspace 7 output $left
workspace 8 output $right
workspace 9 output $left
workspace 10 output $right
workspace 10 output $lap
# workspace cycling
bindsym $mod+Tab workspace next
bindsym $mod+Shift+Tab workspace prev
# bindsym $mod+Tab workspace next
# bindsym $mod+$mod2+Tab workspace prev
bindsym $mod+Tab [con_mark=_prevFocus0] focus
bindsym $mod+$mod2+Tab [con_mark=_prevFocus2] focus
# switch to workspace
bindsym $mod+1 workspace number 1
@ -132,6 +145,16 @@ bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
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_Down workspace number 2
@ -147,50 +170,74 @@ bindsym $mod+KP_Insert workspace number 10
workspace_auto_back_and_forth yes
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
bindsym $mod+$mod2+1 move container to workspace number 1
bindsym $mod+$mod2+2 move container to workspace number 2
bindsym $mod+$mod2+3 move container to workspace number 3
bindsym $mod+$mod2+4 move container to workspace number 4
bindsym $mod+$mod2+5 move container to workspace number 5
bindsym $mod+$mod2+6 move container to workspace number 6
bindsym $mod+$mod2+7 move container to workspace number 7
bindsym $mod+$mod2+8 move container to workspace number 8
bindsym $mod+$mod2+9 move container to workspace number 9
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+Shift+KP_1 move container to workspace number 1
bindsym $mod+Shift+KP_2 move container to workspace number 2
bindsym $mod+Shift+KP_3 move container to workspace number 3
bindsym $mod+Shift+KP_4 move container to workspace number 4
bindsym $mod+Shift+KP_5 move container to workspace number 5
bindsym $mod+Shift+KP_6 move container to workspace number 6
bindsym $mod+Shift+KP_7 move container to workspace number 7
bindsym $mod+Shift+KP_8 move container to workspace number 8
bindsym $mod+Shift+KP_9 move container to workspace number 9
bindsym $mod+Shift+KP_0 move container to workspace number 10
# reload the configuration file
bindsym $mod+Shift+c reload
bindsym $mod+$mod2+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
bindsym $mod+$mod2+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+$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
#bindsym $mod+Shift+f exec firefox
#bindsym $mod+Shift+t exec thunderbird
#bindsym $mod+Shift+g exec gmusicbrowser
#bindsym $mod+Shift+p exec pidgin
#bindsym $mod+$mod2+f exec firefox
#bindsym $mod+$mod2+t exec thunderbird
#bindsym $mod+$mod2+g exec gmusicbrowser
#bindsym $mod+$mod2+p exec pidgin
bindsym $mod+BackSpace exec spacefm
bindsym $mod+plus exec gvim
bindsym $mod+equal exec ~/.local/bin/gvim
# focus binding
bindsym $mod+Shift+f [class="Torbrowser" instance="Navigator"] focus
bindsym $mod+Shift+t [class="Thunderbird" instance="Mail"] focus
bindsym $mod+Shift+g [class="Gmusicbrowser"] focus
bindsym $mod+Shift+p [class="Pidgin" window_role="conversation"] focus
bindsym $mod+Shift+s [class="Terminator" instance="Terminator-root"] focus
bindsym $mod+Shift+m [class="Mumble" instance="mumble"] focus
# bindsym $mod+$mod2+f [class="Torbrowser" instance="Navigator"] focus
# bindsym $mod+$mod2+t [class="Thunderbird" instance="Mail"] focus
# bindsym $mod+$mod2+g [class="Gmusicbrowser"] focus
# bindsym $mod+$mod2+p [class="Pidgin" window_role="conversation"] focus
# bindsym $mod+$mod2+s [class="Terminator" instance="Terminator-root"] focus
# bindsym $mod+$mod2+m [class="Mumble" instance="mumble"] focus
# bindcode 180 [class="Terminator" instance="Terminator-root"] focus
# sound
#bindcode 122 exec --no-startup-id amixer sset Master 3-
#bindcode 123 exec --no-startup-id amixer sset Master 3+
#bindcode 121 exec --no-startup-id amixer sset Master toggle
#bindsym $mod+$mod2+KP_Begin [class="Firefox"] focus
#bindsym $mod+$mod2+KP_Home [class="Thunderbird"] focus
#bindsym $mod+$mod2+KP_Prior [class="Gmusicbrowser"] focus
#bindsym $mod+$mod2+KP_Right [class="Pidgin" window_role="conversation"] focus
#bindsym $mod+$mod2+KP_Insert [class="Terminator" instance="Terminator-root"] focus
#bindcode 41 [class="Firefox" instance="Navigator"] focus
@ -239,7 +286,7 @@ for_window [class="keepassxc"] floating enable
# scratchpad
# Make the currently focused window a scratchpad
bindsym $mod+Shift+minus move scratchpad
bindsym $mod+$mod2+minus move scratchpad
# Show the first scratchpad window
bindsym $mod+minus scratchpad show
@ -274,7 +321,7 @@ mode "resize" {
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
bindsym $mod+Mod1+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
@ -292,6 +339,9 @@ 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/launch.sh
exec picom --config ~/.config/picom.config
#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 &> /tmp/out
exec --no-startup-id ~/.config/i3/focus
# exec xrandr --output DVI-I-1 --auto --right-of DVI-D-0
# exec picom --config ~/.config/picom.config

81
focus Executable file
View File

@ -0,0 +1,81 @@
#!/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

1
sequence.default Normal file
View File

@ -0,0 +1 @@
]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\

1
sequence.solarized Normal file
View File

@ -0,0 +1 @@
]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\