added i3 dotfiles

This commit is contained in:
Niklas 2020-06-11 16:12:10 +02:00
parent 78df635d9e
commit 9d9feafbfd
4 changed files with 221 additions and 0 deletions

169
.config/i3/config Executable file
View File

@ -0,0 +1,169 @@
###############
# #
# ██╗██████╗ #
# ██║╚════██╗ #
# ██║ █████╔╝ #
# ██║ ╚═══██╗ #
# ██║██████╔╝ #
# ╚═╝╚═════╝ #
# #
###############
### Basic stuff ###
for_window [class="^.*"] border pixel 4
for_window [instance="floatme"] floating enable
gaps inner 9
font pango:monospace 8
workspace_auto_back_and_forth yes
### Definitions ###
# Define workspace
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"
set $ws10 "10"
# Set mod key
set $mod Mod4
### Colors ###
#class border backgr. text indicator child_border
client.focused #ff9900 #ff9900 #ff9900 $indicator $border
#client.focused_inactive #333333 #5f676a #ffffff #484e50 #5f676a
#client.unfocused #333333 #222222 #888888 #292d2e #222222
#client.urgent #2f343a #900000 #ffffff #900000 #900000
#client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c
#client.background #ffffff
### i3 keybindings ###
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# change focus
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
# 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+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
bindsym $mod+b split h
bindsym $mod+v split v
bindsym $mod+f fullscreen toggle
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# switch to workspace
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws10
bindsym $mod+Tab workspace next
bindsym $mod+Shift+Tab workspace prev
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7
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
bindsym $mod+Shift+r restart
# resize window
mode "resize" {
bindsym h resize shrink width 5 px or 5 ppt
bindsym j resize grow height 5 px or 5 ppt
bindsym k resize shrink height 5 px or 5 ppt
bindsym l resize grow width 5 px or 5 ppt
bindsym Left resize shrink width 5 px or 5 ppt
bindsym Down resize grow height 5 px or 5 ppt
bindsym Up resize shrink height 5 px or 5 ppt
bindsym Right resize grow width 5 px or 5 ppt
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
bindsym $mod+p gaps inner current plus 5
bindsym $mod+Shift+p gaps inner current minus 5
bindsym $mod+Shift+q exec --no-startup-id ~/.config/i3/killScript.sh
### misc keybindings ###
# bindsym $mod+l exec i3lock -i /usr/share/backgrounds/gnome/RainDrops.jpg
bindsym $mod+Return exec --no-startup-id alacritty
bindsym $mod+d exec rofi -show drun -show-icons
bindsym $mod+i exec --no-startup-id i3lock -i ~/.config/i3/lockscreen
bindsym $mod+Shift+e exec rofi -show script -modi script:$HOME/.config/i3/pm.sh
bindsym $mod+s exec $HOME/.scripts/quickActionRofi.sh
bindsym $mod+a exec --no-startup-id rofi -show calc -modi calc -no-show-match -no-sort
bindsym XF86MonBrightnessUp exec --no-startup-id light -A 5
bindsym XF86MonBrightnessDown exec --no-startup-id light -U 5
#bindsym XF86AudioRaiseVolume exec --no-startup-id amixer sset Master 5+
#bindsym XF86AudioLowerVolume exec --no-startup-id amixer sset Master 5-
#bindsym XF86AudioMute exec --no-startup-id amixer sset Master toggle
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +10%
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -10%
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle
bindsym XF86TouchpadToggle exec --no-startup-id $HOME/.config/i3/touchpadToggle.sh
bindsym $mod+Shift+w exec --no-startup-id networkmanager_dmenu
### autostart ###
#exec_always --no-startup-id $HOME/.config/compton/launch.sh
exec --no-startup-id picom -b
exec --no-startup-id feh --bg-scale ~/.lastBg
exec_always --no-startup-id $HOME/.config/polybar/launch.sh
#exec --no-startup-id amixer sset Master mute
exec --no-startup-id pactl set-sink-mute 0 1
exec --no-startup-id xss-lock -- i3lock -i ~/.config/i3/lockscreen
exec --no-startup-id dunst

18
.config/i3/killScript.sh Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
# based on https://github.com/pastapojken/i3SteamOrKill
winID=$(xdotool getactivewindow)
winClass=$(xprop -id $winID WM_CLASS)
if [[ $winClass = *"Steam"* ]]; then
xdotool windowunmap $(xdotool getactivewindow)
exit
elif [[ $winClass = *"evolution"* ]]; then
i3-msg kill
systemctl --user stop evolution-source-registry.service
killall -e /usr/lib/evolution-data-server/evolution-alarm-notify
exit
else
i3-msg kill
exit
fi

26
.config/i3/pm.sh Executable file
View File

@ -0,0 +1,26 @@
#!/usr/bin/env bash
if [ "$@" ]
then
case "$@" in
"Shutdown")
shutdown now
;;
"Reboot")
reboot
;;
"Logout")
i3-msg exit
;;
"Hibernate")
systemctl hibernate
;;
esac
exit 0
else
echo -en "Shutdown\n"
echo -en "Reboot\n"
echo -en "Logout\n"
echo -en "Hibernate\n"
fi

8
.config/i3/touchpadToggle.sh Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env sh
# Get the id by running xinput and look for your touchpad
ID="15"
if [[ $(xinput list-props "$ID" | grep "Device Enabled" | cut -d ':' -f2 | tr -d '[:space:]') = "1" ]]; then
xinput set-prop "$ID" "Device Enabled" 0
else
xinput set-prop "$ID" "Device Enabled" 1
fi