You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
dotfiles/i3/.config/i3/config

272 lines
9.6 KiB

#!/bin/i3 -c
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
## i3 Colors
# class border backgr. text indicator child_border
client.focused #c5457b #9e1553 #ffffff #ff3888 #9e1553
client.focused_inactive #333333 #6a6469 #ffffff #504c50 #6a6469
client.unfocused #333333 #222222 #888888 #2e2c2e #222222
client.urgent #3a3132 #900000 #ffffff #900000 #900000
client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c
client.background #ffffff
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:monospace 8
# Polybar
bar {
i3bar_command $HOME/.config/polybar/launch.sh
}
default_border pixel 1
default_floating_border normal
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec urxvt
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+d exec rofi -show drun
# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+ograve focus right
# alternatively, you can use the cursor keys:
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+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+ograve 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
# split in horizontal/veritcal orientation
bindsym $mod+h split h
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# actions between tiling/floating windows/containers
bindsym $mod+Shift+space floating toggle
bindsym $mod+space focus mode_toggle
bindsym $mod+a focus parent
# Define names for default workspaces for which we configure key bindings.
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"
# 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
# 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
# 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'"
# resize window (you can also use the mouse for that)
# These bindings trigger as soon as you enter the resize mode
mode "resize" {
# vi keybindings
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym ograve resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 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"
# Status Control
# `dm-tool` works with lightdm greeters only
bindsym XF86ScreenSaver exec "dm-tool lock"
# Screenshot
# It deletes the screenshot file in `/tmp/` right after copying it to the
# clipboard.
# Notes:
# - `scrot` doesn't work well with `compton`
# - `gnome-screenshot` has problems too when runs in CLI mode
# - `deepin-screenshot` ignores the `--no-notification` option
bindsym Print --release exec "screenshot_image=$(date +%F_%T).png && \
deepin-screenshot --no-notification \
-s /tmp/$screenshot_image && \
xclip -selection c \
-t image/png < /tmp/$screenshot_image && \
rm /tmp/$screenshot_image && \
unset screenshot_image"
# Speakers and Mic Controls
set $scripts ~/.config/i3/scripts
bindsym XF86AudioRaiseVolume exec --no-startup-id $scripts/dev-ctrl audio up
bindsym XF86AudioLowerVolume exec --no-startup-id $scripts/dev-ctrl audio down
bindsym XF86AudioMute exec --no-startup-id $scripts/dev-ctrl audio mute
bindsym XF86AudioMicMute exec --no-startup-id $scripts/dev-ctrl mic mute
# Screen brightness controls
bindsym XF86MonBrightnessUp exec --no-startup-id $scripts/dev-ctrl brightness up
bindsym XF86MonBrightnessDown exec --no-startup-id $scripts/dev-ctrl brightness down
# Turn screen off
bindsym XF86Launch1 exec --no-startup-id xset dpms force off
# swap two windows places
bindsym $mod+Mod1+x mark --add quickswap
bindsym $mod+x swap container with mark quickswap; [con_mark="quickswap"] focus
# Webcam 1 dropdown
for_window [title="mpv-floating-window"] floating enable
for_window [title="mpv-floating-window"] sticky enable
for_window [title="mpv-floating-window"] border none
# WebCam Toggle
bindsym XF86WebCam exec ~/.config/i3/scripts/webcam-toggle.sh
# Numlock
exec_always --no-startup-id numlockx on
# Note:
# `exec` commands are executed in order, but asynchronously;
# In other words the commands are launched in sequence without waiting the
# previous command to finish.
# In case a syncronous behaviour is desired, chain the commands with `&&` or
# group them in a script to be launched an `exec` command.
# Background
exec --no-startup-id xwallpaper --daemon \
--output all \
--zoom "$(shuf -n1 -e $HOME/.local/share/backgrounds/*)"
# Compositor
exec --no-startup-id picom --config ~/.config/picom/config
# Notification Manager (dunst)
exec --no-startup-id envsubst < \
~/.config/dunst/dunstrc.template > \
~/.config/dunst/dunstrc && \
dunst --config $HOME/.config/dunst/dunstrc
## Use `xprop` to determine windows paramenters. Guide below:
## https://i3wm.org/docs/userguide.html#list_of_commands
# Calculators
for_window [instance=qalc] floating enable
for_window [instance=qalc] border normal
for_window [instance=gnome-calculator] floating enable
for_window [instance=gnome-calculator] border normal
# Firefox
for_window [class=Firefox window_role="page-info"] floating enable
for_window [class=Firefox window_role="page-info"] border normal
for_window [class=Firefox window_role="About"] floating enable
for_window [class=Firefox window_role="About"] border normal
for_window [class=Firefox window_role="Organizer"] floating enable
for_window [class=Firefox window_role="Organizer"] border normal
# Teamspeak 3
for_window [class="TeamSpeak 3" title="File Transfers"] floating enable
for_window [class="TeamSpeak 3" title="File Transfers"] border normal
for_window [class="TeamSpeak 3" title="File Browser -"] floating enable
for_window [class="TeamSpeak 3" title="File Browser -"] border normal
for_window [class="TeamSpeak 3" title="Bookmarks"] floating enable
for_window [class="TeamSpeak 3" title="Bookmarks"] border normal
# Blueberry
for_window [class="Blueberry.py"] floating enable
for_window [class="Blueberry.py"] border normal
# Pavucontrol (PulseAudio Volume Control)
for_window [class="Pavucontrol"] floating enable
for_window [class="Pavucontrol"] border normal
# Gnome System Monitor
for_window [instance="gnome-system-monitor"] floating enable
for_window [instance="gnome-system-monitor"] border normal
# Mate System Monitor
for_window [instance="mate-system-monitor"] floating enable
for_window [instance="mate-system-monitor"] border normal
# Steam
for_window [instance="Steam" title="Steam Guard - Computer Authorization Required"] floating enable
for_window [instance="Steam" title="Steam Guard - Computer Authorization Required"] border normal
for_window [instance="Steam" title="Friends List"] floating enable
for_window [instance="Steam" title="Friends List"] border normal
for_window [instance="Steam" title="Trade offer with"] floating enable
for_window [instance="Steam" title="Trade offer with"] border normal
for_window [instance="Steam" title="Allow game launch?"] floating enable
for_window [instance="Steam" title="Allow game launch?"] border normal
for_window [instance="Steam" title="Screenshot Uploader"] floating enable
for_window [instance="Steam" title="Screenshot Uploader"] border normal