Improve config of i3 and ranger

This commit is contained in:
foo-dogsquared 2019-08-11 17:07:25 +08:00
parent 21db98eaaa
commit cdeb944849
3 changed files with 36 additions and 28 deletions

View File

@ -14,8 +14,9 @@ set_from_resource $color_6 color6 #aea0c7
set_from_resource $color_16 color16 #ffffff set_from_resource $color_16 color16 #ffffff
set $pictures_directory '~/Pictures' set $pictures_directory '~/Pictures'
set $screenshot_filename '%F-%H-%M-%S-$wx$h.png'
exec_always feh --bg-scale ~/wallpapers/nebula.jpg exec_always feh --bg-scale ~/wallpapers/sand.jpg
# Startup applications # Startup applications
exec firefox exec firefox
@ -37,7 +38,7 @@ font pango:monospace 10
font pango:Fira Code 10 font pango:Fira Code 10
# Setting up borders for windows of different states # Setting up borders for windows of different states
default_border pixel 10 default_border pixel 6
# Before i3 v4.8, we used to recommend this one as the default: # Before i3 v4.8, we used to recommend this one as the default:
# 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
@ -116,9 +117,9 @@ bindsym $mod+space focus mode_toggle
#bindsym $mod+d focus child #bindsym $mod+d focus child
# Volume keyboard control # Volume keyboard control
bindsym XF86AudioRaiseVolume exec amixer -q sset Master 1+ unmute bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +1% ; exec pactl set-sink-mute @DEFAULT_SINK@ 0
bindsym XF86AudioLowerVolume exec amixer -q sset Master 1- unmute bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -1% ; exec pactl set-sink-mute @DEFAULT_SINK@ 0
bindsym XF86AudioMute exec amixer -q sset Master mute bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
# Moving between workspaces # Moving between workspaces
bindsym XF86Back workspace prev bindsym XF86Back workspace prev
@ -130,14 +131,20 @@ bindsym Shift+$mod+Tab workspace prev
bindsym $mod+z move window to workspace next bindsym $mod+z move window to workspace next
bindsym Shift+$mod+z move window to workspace prev bindsym Shift+$mod+z move window to workspace prev
# Alt + ` (backtick) # $mod + ` (backtick)
bindsym $mod+grave workspace back_and_forth bindsym $mod+grave workspace back_and_forth
bindsym $mod+slash workspace back_and_forth
# Moving windows between workspaces
# $mod + Shift + ` (backtick)
bindsym Shift+$mod+grave move window to workspace back_and_forth bindsym Shift+$mod+grave move window to workspace back_and_forth
bindsym Shift+$mod+slash move window to workspace back_and_forth
# Application bound shortcuts # Application bound shortcuts
bindsym XF86HomePage exec kitty --class "ranger" ranger bindsym XF86HomePage exec alacritty --class "ranger" --command ranger
bindsym XF86Mail exec thunderbird bindsym XF86Mail exec thunderbird
bindsym Print exec scrot '%F-%H-%M-%S-$wx$h.png' -e 'mv $f ~/Pictures' bindsym Print exec scrot $screenshot_filename -e 'mv $f ~/Pictures'
bindsym Shift+Print exec scrot $screenshot_filename -d 3 -e 'mv $f ~/Pictures'
# Define names for default workspaces for which we configure key bindings later on. # Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places. # We use variables to avoid repeating the names in multiple places.
@ -155,14 +162,17 @@ set $ws10 "10"
# automatic back-and-forth switching with $mod+<num> # automatic back-and-forth switching with $mod+<num>
workspace_auto_back_and_forth yes workspace_auto_back_and_forth yes
assign [class="^(?i)code-oss$"] $code_ws assign [instance="^(?i)vim$"] $vim_ws
assign [class="^(?i)vim$"] $vim_ws assign [class="^(?i)vim$"] $vim_ws
assign [class="^(?i)ranger"] $file_ws
assign [class="^(?i)thunar"] $file_ws assign [instance="^(?i)ranger$"] $file_ws
assign [class="^(?i)ranger$"] $file_ws
assign [class="^(?i)code-oss$"] $code_ws
assign [class="^(?i)thunar$"] $file_ws
assign [class="^(?i)firefox$"] $web_ws assign [class="^(?i)firefox$"] $web_ws
assign [class="^(?i)inkscape$"] $graphics_ws assign [class="^(?i)inkscape$"] $graphics_ws
assign [class="^(?i)thunderbird$"] $mail_ws assign [class="^(?i)thunderbird$"] $mail_ws
assign [class="^(?i)zathura$"] $w7
# switch to workspace # switch to workspace
bindsym $mod+1 workspace $web_ws bindsym $mod+1 workspace $web_ws
@ -197,20 +207,17 @@ bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcu
# resize window (you can also use the mouse for that) # resize window (you can also use the mouse for that)
mode "resize" { mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym h resize shrink width 10 px or 10 ppt bindsym h resize shrink width 10 px or 10 ppt
bindsym j resize grow height 10 px or 10 ppt bindsym j resize grow height 10 px or 10 ppt
bindsym k resize shrink height 10 px or 10 ppt bindsym k resize shrink height 10 px or 10 ppt
bindsym l resize grow width 10 px or 10 ppt bindsym l resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys # same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 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 Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape or $mod+r # back to normal: Enter or Escape or $mod+r
bindsym Return mode "default" bindsym Return mode "default"
bindsym Escape mode "default" bindsym Escape mode "default"
@ -231,10 +238,10 @@ mode "applications" {
bindsym c exec code bindsym c exec code
bindsym f exec firefox bindsym f exec firefox
bindsym v exec inkscape bindsym v exec inkscape
bindsym r exec kitty --class "ranger" ranger bindsym r exec alacritty --class "ranger" --command ranger
bindsym t exec thunderbird bindsym t exec thunderbird
bindsym a exec thunar bindsym a exec thunar
bindsym x exec kitty --class "vim" vim bindsym x exec alacritty --class "vim" --command vim
bindsym z exec zathura bindsym z exec zathura
# Ways to exit the mode # Ways to exit the mode
@ -266,6 +273,6 @@ bar {
} }
# Setting the gaps # Setting the gaps
gaps inner 10 gaps inner 6
smart_gaps on smart_gaps on
smart_borders on smart_borders on

View File

@ -41,7 +41,7 @@ disk "/home" {
volume master { volume master {
format = "<span background='#3e517a'> VOL: %volume </span>" format = "<span background='#3e517a'> VOL: %volume </span>"
format_muted = "VOL: muted (%volume)" format_muted = "<span background='#3e517a'> VOL: muted (%volume) </span>"
device = "default" device = "default"
mixer = "Master" mixer = "Master"
mixer_idx = 0 mixer_idx = 0

View File

@ -50,14 +50,14 @@ set confirm_on_delete multiple
set use_preview_script true set use_preview_script true
# Automatically count files in the directory, even before entering them? # Automatically count files in the directory, even before entering them?
set automatically_count_files true set automatically_count_files false
# Open all images in this directory when running certain image viewers # Open all images in this directory when running certain image viewers
# like feh or sxiv? You can still open selected files by marking them. # like feh or sxiv? You can still open selected files by marking them.
set open_all_images true set open_all_images true
# Be aware of version control systems and display information. # Be aware of version control systems and display information.
set vcs_aware false set vcs_aware true
# State of the four backends git, hg, bzr, svn. The possible states are # State of the four backends git, hg, bzr, svn. The possible states are
# disabled, local (only show local info), enabled (show local and remote # disabled, local (only show local info), enabled (show local and remote
@ -132,7 +132,7 @@ set colorscheme default
# Preview files on the rightmost column? # Preview files on the rightmost column?
# And collapse (shrink) the last column if there is nothing to preview? # And collapse (shrink) the last column if there is nothing to preview?
set preview_files true set preview_files false
set preview_directories true set preview_directories true
set collapse_preview true set collapse_preview true
@ -140,7 +140,7 @@ set collapse_preview true
set save_console_history true set save_console_history true
# Draw the status bar on top of the browser window (default: bottom) # Draw the status bar on top of the browser window (default: bottom)
set status_bar_on_top false set status_bar_on_top true
# Draw a progress bar in the status bar which displays the average state of all # Draw a progress bar in the status bar which displays the average state of all
# currently running tasks which support progress bars? # currently running tasks which support progress bars?
@ -150,10 +150,10 @@ set draw_progress_bar_in_status_bar true
# Separators are vertical lines between columns. # Separators are vertical lines between columns.
# Outline draws a box around all the columns. # Outline draws a box around all the columns.
# Both combines the two. # Both combines the two.
set draw_borders none set draw_borders both
# Display the directory name in tabs? # Display the directory name in tabs?
set dirname_in_tabs false set dirname_in_tabs true
# Enable the mouse support? # Enable the mouse support?
set mouse_enabled true set mouse_enabled true
@ -728,3 +728,4 @@ copytmap <ESC> q Q w <C-c>
# opening VS Code easily # opening VS Code easily
map Oc shell code %s map Oc shell code %s
map Ov shell vim %s map Ov shell vim %s
map Oz shell %s