Prettified i3 config file

master
Meliurwen 3 years ago
parent b5466e6ef5
commit 1b0589cb33
Signed by: meliurwen
GPG Key ID: 818A8B35E9F1CE10
  1. 165
      i3/.config/i3/config
  2. 0
      i3/.config/i3/scripts/dev-ctrl

@ -18,16 +18,13 @@ client.background #ffffff
# is used in the bar {} block below. # is used in the bar {} block below.
font pango:monospace 8 font pango:monospace 8
# This font is widely installed, provides lots of unicode glyphs, right-to-left # Polybar
# text rendering and scalability on retina/hidpi displays (thanks to pango). bar {
#font pango:DejaVu Sans Mono 8 i3bar_command $HOME/.config/polybar/launch.sh
}
# Before i3 v4.8, we used to recommend this one as the default: default_border pixel 1
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 default_floating_border normal
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesn’t scale on retina/hidpi displays.
# Use Mouse+$mod to drag floating windows to their wanted position # Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod floating_modifier $mod
@ -39,14 +36,8 @@ bindsym $mod+Return exec urxvt
bindsym $mod+Shift+q kill bindsym $mod+Shift+q kill
# start dmenu (a program launcher) # start dmenu (a program launcher)
#bindsym $mod+d exec dmenu_run
bindsym $mod+d exec rofi -show drun bindsym $mod+d exec rofi -show drun
# 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
# change focus # change focus
bindsym $mod+j focus left bindsym $mod+j focus left
bindsym $mod+k focus down bindsym $mod+k focus down
@ -71,10 +62,8 @@ bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right bindsym $mod+Shift+Right move right
# split in horizontal orientation # split in horizontal/veritcal orientation
bindsym $mod+h split h bindsym $mod+h split h
# split in vertical orientation
bindsym $mod+v split v bindsym $mod+v split v
# enter fullscreen mode for the focused container # enter fullscreen mode for the focused container
@ -85,20 +74,12 @@ bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split bindsym $mod+e layout toggle split
# toggle tiling / floating # actions between tiling/floating windows/containers
bindsym $mod+Shift+space floating toggle bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent bindsym $mod+a focus parent
# focus the child container # Define names for default workspaces for which we configure key bindings.
#bindsym $mod+d focus child
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1" set $ws1 "1"
set $ws2 "2" set $ws2 "2"
set $ws3 "3" set $ws3 "3"
@ -139,78 +120,72 @@ bindsym $mod+Shift+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+Shift+r restart bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session) # 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+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) # resize window (you can also use the mouse for that)
# These bindings trigger as soon as you enter the resize mode
mode "resize" { mode "resize" {
# These bindings trigger as soon as you enter the resize mode # vi keybindings
bindsym j resize shrink width 10 px or 10 ppt
# Pressing left will shrink the window’s width. bindsym k resize grow height 10 px or 10 ppt
# Pressing right will grow the window’s width. bindsym l resize shrink height 10 px or 10 ppt
# Pressing up will shrink the window’s height. bindsym ograve resize grow width 10 px or 10 ppt
# Pressing down will grow the window’s height.
bindsym j resize shrink width 10 px or 10 ppt # same bindings, but for the arrow keys
bindsym k resize grow height 10 px or 10 ppt bindsym Left resize shrink width 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt bindsym Down resize grow height 10 px or 10 ppt
bindsym ograve resize grow width 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
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt # back to normal: Enter or Escape or $mod+r
bindsym Down resize grow height 10 px or 10 ppt bindsym Return mode "default"
bindsym Up resize shrink height 10 px or 10 ppt bindsym Escape mode "default"
bindsym Right resize grow width 10 px or 10 ppt bindsym $mod+r mode "default"
# 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+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
#bar {
# status_command i3status
#}
#bar {
# status_command i3blocks
#}
bar {
i3bar_command $HOME/.config/polybar/launch.sh
}
default_border pixel 1
default_floating_border normal
# Status Control # Status Control
# `dm-tool` works with lightdm greeters only # `dm-tool` works with lightdm greeters only
bindsym XF86ScreenSaver exec "dm-tool lock" bindsym XF86ScreenSaver exec "dm-tool lock"
# Screenshot # Screenshot
# (it deletes the screenshot file in `/tmp/` right after copying it to the clipboard) # It deletes the screenshot file in `/tmp/` right after copying it to the
# Note1: `scrot` doesn't work well with `compton` # clipboard.
# Note2: `gnome-screenshot` has problems too when runs in CLI mode # Notes:
# Note3: `deepin-screenshot` ignores the `--no-notification` option # - `scrot` doesn't work well with `compton`
##bindsym Print --release exec "scrot -s /tmp/screenshot-$(date +%F_%T).png -zq 100 -e '$(xclip -selection c -t image/png < $f); rm $f'" # - `gnome-screenshot` has problems too when runs in CLI mode
##bindsym Print --release exec gnome-screenshot -ac -d 0 # - `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" 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 # Speakers and Mic Controls
bindsym XF86AudioRaiseVolume exec --no-startup-id ~/.config/i3/scripts/deviceControl.sh audio up set $scripts ~/.config/i3/scripts
bindsym XF86AudioLowerVolume exec --no-startup-id ~/.config/i3/scripts/deviceControl.sh audio down bindsym XF86AudioRaiseVolume exec --no-startup-id $scripts/dev-ctrl audio up
bindsym XF86AudioMute exec --no-startup-id ~/.config/i3/scripts/deviceControl.sh audio mute bindsym XF86AudioLowerVolume exec --no-startup-id $scripts/dev-ctrl audio down
bindsym XF86AudioMicMute exec --no-startup-id ~/.config/i3/scripts/deviceControl.sh mic mute 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 # Screen brightness controls
bindsym XF86MonBrightnessUp exec --no-startup-id ~/.config/i3/scripts/deviceControl.sh brightness up bindsym XF86MonBrightnessUp exec --no-startup-id $scripts/dev-ctrl brightness up
bindsym XF86MonBrightnessDown exec --no-startup-id ~/.config/i3/scripts/deviceControl.sh brightness down bindsym XF86MonBrightnessDown exec --no-startup-id $scripts/dev-ctrl brightness down
# Turn screen off # Turn screen off
bindsym XF86Launch1 exec --no-startup-id xset dpms force 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 # Webcam 1 dropdown
for_window [title="video0 - mpv"] floating enable for_window [title="video0 - mpv"] floating enable
for_window [title="video0 - mpv"] sticky enable for_window [title="video0 - mpv"] sticky enable
@ -224,25 +199,24 @@ exec_always --no-startup-id numlockx on
# Note: # Note:
# `exec` commands are executed in order, but asynchronously; # `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 other words the commands are launched in sequence without waiting the
# In case a syncronous behaviour is desired, chain the commands with `&&` or group them in a script to be # previous command to finish.
# launched an `exec` command. # In case a syncronous behaviour is desired, chain the commands with `&&` or
# group them in a script to be launched an `exec` command.
# Background # Background
exec --no-startup-id xwallpaper --daemon --output all --zoom "$(shuf -n1 -e $HOME/.local/share/backgrounds/*)" exec --no-startup-id xwallpaper --daemon \
--output all \
--zoom "$(shuf -n1 -e $HOME/.local/share/backgrounds/*)"
# Compositor # Compositor
exec --no-startup-id picom --config ~/.config/picom/config exec --no-startup-id picom --config ~/.config/picom/config
# Notification Manager (dunst) # Notification Manager (dunst)
exec --no-startup-id envsubst < ~/.config/dunst/dunstrc.template > ~/.config/dunst/dunstrc && dunst --config $HOME/.config/dunst/dunstrc exec --no-startup-id envsubst < \
~/.config/dunst/dunstrc.template > \
# Pulseaudio ~/.config/dunst/dunstrc && \
## Necessary if you have no DE (gnome, xfce, etc...) under i3. dunst --config $HOME/.config/dunst/dunstrc
#exec --no-startup-id pulseaudio --kill && sleep 1 && pulseaudio --start
# Nextcloud Desktop
#exec --no-startup-id nextcloud
## Use `xprop` to determine windows paramenters. Guide below: ## Use `xprop` to determine windows paramenters. Guide below:
## https://i3wm.org/docs/userguide.html#list_of_commands ## https://i3wm.org/docs/userguide.html#list_of_commands
@ -295,10 +269,3 @@ 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="Allow game launch?"] border normal
for_window [instance="Steam" title="Screenshot Uploader"] floating enable for_window [instance="Steam" title="Screenshot Uploader"] floating enable
for_window [instance="Steam" title="Screenshot Uploader"] border normal for_window [instance="Steam" title="Screenshot Uploader"] border normal
## Custom Keybindings
# Swap Two Windows Places
bindsym $mod+Mod1+x mark --add quickswap
bindsym $mod+x swap container with mark quickswap; [con_mark="quickswap"] focus

Loading…
Cancel
Save