old stuff removed

many files renamed, possible breakage
This commit is contained in:
Luke Smith 2020-11-16 18:06:41 -05:00
parent 3215e7b4bb
commit cba0fcc03d
No known key found for this signature in database
GPG key ID: 4C50B54A911F6252
33 changed files with 251 additions and 2682 deletions

View file

@ -1,40 +0,0 @@
#!/bin/sh
# If refreshing bspwm, remove all previous rules to prevent doubling up.
bspc rule -r "*"
xsetroot -cursor_name left_ptr
# We look for a non-laptop monitor to use for default, but use the laptop
# screen (LVDS) if there's nothing else. This is because I assume that if you
# have an extra screen attached to a laptop, you want to use that.
mainmonitor="$(bspc query --monitors --names | grep -v LVDS | head -n 1)"
# if ! echo "$mainmonitor" | grep LVDS >/dev/null 2>&1; then
# xrandr --output "$mainmonitor" --auto --output LVDS1 --off
# else
# mainmonitor="LVDS1"
# xrandr --output LVDS1 --auto
# fi
# Start workspaces on the main monitor.
bspc monitor "$mainmonitor" -d 1 2 3 4 5 6 7 8 9 10
bspc desktop -f 1
# If you want a multi-monitor display or something else, I leave that to you to
# arrange. I have this sensible default for most people's use cases.
bspc config border_width 3
bspc config window_gap 15
bspc config top_padding 24 # top_padding I set equal to polybar's height
bspc config focus_follows_pointer true
bspc rule -a Zathura state=tiled
dropdownname="dropdown"
bspc query -N -n .hidden >/dev/null || setsid -f "$TERMINAL" -n "$dropdownname" -e dropdown >/dev/null 2>&1
bspc rule -a St:$dropdownname hidden=on
bspc rule -a St:$dropdownname sticky=on
bspc rule -a St:$dropdownname state=floating
bspc config external_rules_command "$(which floaters)"

View file

@ -1,34 +0,0 @@
#!/bin/sh
# If refreshing bspwm, remove all previous rules to prevent doubling up.
bspc rule -r "*"
# We look for a non-laptop monitor to use for default, but use the laptop
# screen (LVDS) if there's nothing else. This is because I assume that if you
# have an extra screen attached to a laptop, you want to use that.
mainmonitor="$(bspc query --monitors --names | grep -v LVDS | head -n 1)"
if ! echo "$mainmonitor" | grep LVDS >/dev/null 2>&1; then
xrandr --output "$mainmonitor" --auto --output LVDS1 --off
fi
# Start workspaces on the main monitor.
bspc monitor "$mainmonitor" -d 1 2 3 4 5 6 7 8 9 10
bspc desktop -f 1
# If you want a multi-monitor display or something else, I leave that to you to
# arrange. I have this sensible default for most people's use cases.
bspc config border_width 3
bspc config window_gap 15
bspc config top_padding 24 # top_padding I set equal to polybar's height
bspc config focus_follows_pointer true
dropdownname="dropdown"
bspc query -N -n .hidden >/dev/null || setsid -f "$TERMINAL" -n "$dropdownname" -e dropdown >/dev/null 2>&1
bspc rule -a St:$dropdownname hidden=on
bspc rule -a St:$dropdownname sticky=on
bspc rule -a St:$dropdownname state=floating
bspc config external_rules_command "$(which floaters)"

View file

@ -1,17 +0,0 @@
bf ${XDG_CONFIG_HOME:-$HOME/.config}/files
bd ${XDG_CONFIG_HOME:-$HOME/.config}/directories
bw ${XDG_CONFIG_HOME:-$HOME/.config}/bookmarks
cfa ${XDG_CONFIG_HOME:-$HOME/.config}/aliasrc
cfz $ZDOTDIR/.zshrc
cfv ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/init.vim
cft ${XDG_CONFIG_HOME:-$HOME/.config}/tmux/.tmux.conf
cfm ${XDG_CONFIG_HOME:-$HOME/.config}/mutt/muttrc
cfx ${XDG_CONFIG_HOME:-$HOME/.config}/Xresources
cfu ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/urls
cfn ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/config
cfmb ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/bindings
cfmc ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/config
cfk ${XDG_CONFIG_HOME:-$HOME/.config}/sxhkd/sxhkdrc
cfi ${XDG_CONFIG_HOME:-$HOME/.config}/i3/config
cfb ${XDG_CONFIG_HOME:-$HOME/.config}/i3blocks/config
cff ${XDG_CONFIG_HOME:-$HOME/.config}/fontconfig/fonts.conf

View file

@ -1,359 +0,0 @@
# vim: filetype=i3
# File originally by Luke Smith <https://lukesmith.xyz>
# This config file will use environmental variables such as $BROWSER and $TERMINAL.
# You can set these variables in ~/.profile or ~/.bash_profile if you have it as below:
#
# export TERMINAL="st"
# #---Basic Definitions---# #
set $inner_gaps 15
set $outer_gaps 15
set $term --no-startup-id $TERMINAL
set $mod Mod4
set $stoprec --no-startup-id dmenurecord kill
set $shutdown sudo -A shutdown -h now
set $reboot sudo -A reboot
set $netrefresh --no-startup-id sudo -A systemctl restart NetworkManager
set $hibernate sudo -A systemctl suspend
# #---Gaps---# #
for_window [class="^.*"] border pixel 2
gaps inner $inner_gaps
gaps outer $outer_gaps
# #---Dropdown Windows---# #
# General dropdown window traits. The order can matter.
for_window [instance="dropdown_*"] floating enable
for_window [instance="dropdown_*"] move scratchpad
for_window [instance="dropdown_*"] sticky enable
for_window [instance="dropdown_*"] scratchpad show
for_window [instance="dropdown_tmuxdd"] resize set 625 450
for_window [instance="dropdown_dropdowncalc"] resize set 800 300
for_window [instance="dropdown_tmuxdd"] border pixel 3
for_window [instance="dropdown_dropdowncalc"] border pixel 2
for_window [instance="dropdown_*"] move position center
bar {
font pango:mono 10
status_command i3blocks
position top
mode dock
modifier None
}
# #---Basic Bindings---# #
bindsym $mod+Return exec $term
bindsym $mod+Shift+Return exec --no-startup-id samedir
bindsym $mod+Shift+space floating toggle
bindsym $mod+space focus mode_toggle
bindsym $mod+Escape workspace prev
bindsym $mod+Shift+Escape exec --no-startup-id prompt "Exit i3?" "i3 exit"
# bindsym $mod+BackSpace
bindsym $mod+Shift+BackSpace exec --no-startup-id prompt "Reboot computer?" "$reboot"
bindsym $mod+grave exec --no-startup-id dmenuunicode
##bindsym $mod+asciitilde
#STOP/HIDE EVERYTHING:
bindsym $mod+Shift+Delete exec --no-startup-id pulsemixer --mute ; exec --no-startup-id mpc pause && pkill -RTMIN+10 i3blocks ; exec --no-startup-id pauseallmpv; workspace 0; exec $term -e htop ; exec $term -e lf
# Show selection:
bindsym $mod+Insert exec --no-startup-id notify-send "📋 Clipboard contents:" "$(xclip -o -selection clipboard)"
##bindsym $mod+Pause
# #---Letter Key Bindings---# #
bindsym $mod+q [con_id="__focused__" instance="^(?!dropdown_).*$"] kill
bindsym $mod+Shift+q [con_id="__focused__" instance="^(?!dropdown_).*$"] exec --no-startup-id kill -9 `xdotool getwindowfocus getwindowpid`
bindsym $mod+w exec --no-startup-id $BROWSER
bindsym $mod+Shift+w exec $term -e nmtui
bindsym $mod+e exec $term -e neomutt && pkill -RTMIN+12 i3blocks
bindsym $mod+Shift+e exec --no-startup-id tutorialvids
bindsym $mod+r exec $term -e lf
bindsym $mod+Shift+r exec --no-startup-id winresize
bindsym $mod+t split toggle
bindsym $mod+Shift+t gaps inner current set $inner_gaps; gaps outer current set $outer_gaps
bindsym $mod+y exec $term -e calcurse
bindsym $mod+Shift+y exec --no-startup-id i3resize left
bindsym $mod+u exec --no-startup-id ddspawn tmuxdd
bindsym $mod+Shift+u exec --no-startup-id i3resize down
bindsym $mod+i exec $term -e htop
bindsym $mod+Shift+i exec --no-startup-id i3resize up
bindsym $mod+o sticky toggle
bindsym $mod+Shift+o exec --no-startup-id i3resize right
bindsym $mod+p exec --no-startup-id mpc toggle
bindsym $mod+Shift+p exec --no-startup-id mpc pause
bindsym $mod+a exec --no-startup-id ddspawn dropdowncalc -f mono:pixelsize=24
bindsym $mod+Shift+a exec $term -e pulsemixer
bindsym $mod+s gaps inner current plus 5
bindsym $mod+Shift+s gaps inner current minus 5
bindsym $mod+d exec --no-startup-id dmenu_run
bindsym $mod+Shift+d gaps inner current set 0; gaps outer current set 0
set $freeze Distraction-free mode (super+shift+f to reactivate bindings)
mode "$freeze" { bindsym $mod+Shift+f mode "default"
}
bindsym $mod+f fullscreen toggle
bindsym $mod+Shift+f mode "$freeze" ;; exec --no-startup-id notify-send "Distraction-free mode activated." "Press Super+Shift+f to return."
bindsym $mod+g workspace prev
bindsym $mod+Shift+g exec --no-startup-id gimp; workspace $ws5
bindsym $mod+h focus left
bindsym $mod+Shift+h move left 30
bindsym $mod+Ctrl+h move workspace to output left
bindsym $mod+j focus down
bindsym $mod+Shift+j move down 30
bindsym $mod+Ctrl+j move workspace to output down
bindsym $mod+k focus up
bindsym $mod+Shift+k move up 30
bindsym $mod+Ctrl+k move workspace to output up
bindsym $mod+l focus right
bindsym $mod+Shift+l move right 30
bindsym $mod+Ctrl+l move workspace to output right
bindsym $mod+z gaps outer current plus 5
bindsym $mod+Shift+z gaps outer current minus 5
bindsym $mod+x exec --no-startup-id xset dpms force off && mpc pause && pauseallmpv && slock &
bindsym $mod+Shift+x exec --no-startup-id prompt "Shutdown computer?" "$shutdown"
bindsym $mod+c exec --no-startup-id cabl
bindsym $mod+Shift+c exec --no-startup-id camtoggle
bindsym $mod+v exec --no-startup-id $term -e $EDITOR -c "VimwikiIndex"
#bindsym $mod+Shift+v
bindsym $mod+b bar mode toggle
bindsym $mod+Shift+b floating toggle; sticky toggle; exec --no-startup-id hover left
bindsym $mod+n exec $term -e newsboat && pkill -RTMIN+6 i3blocks
bindsym $mod+Shift+n floating toggle; sticky toggle; exec --no-startup-id hover right
bindsym $mod+m exec --no-startup-id $term -e ncmpcpp
bindsym $mod+Shift+m exec --no-startup-id pulsemixer --toggle-mute && pkill -RTMIN+10 i3blocks
# #---Workspace Bindings---# #
bindsym $mod+Home workspace $ws1
bindsym $mod+Shift+Home move container to workspace $ws1
bindsym $mod+End workspace $ws10
bindsym $mod+Shift+End move container to workspace $ws10
bindsym $mod+Prior workspace prev
bindsym $mod+Shift+Prior move container to workspace prev
bindsym $mod+Next workspace next
bindsym $mod+Shift+Next move container to workspace next
bindsym $mod+Tab workspace back_and_forth
bindsym $mod+XF86Back workspace prev
bindsym $mod+Shift+XF86Back move container to workspace prev
bindsym $mod+XF86Forward workspace next
bindsym $mod+Shift+XF86Forward move container to workspace next
bindsym $mod+semicolon workspace next
bindsym $mod+apostrophe split horizontal ;; exec $term
bindsym $mod+slash split vertical ;; exec $term
bindsym $mod+Shift+slash kill
bindsym $mod+backslash workspace back_and_forth
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
for_window [class="Pinentry"] sticky enable
for_window [class="sent"] border pixel 0px
for_window [title="GIMP Startup"] move workspace $ws5
for_window [class="Gimp"] move workspace $ws5
for_window [window_role="GtkFileChooserDialog"] resize set 800 600
for_window [window_role="GtkFileChooserDialog"] move position center
for_window [title="Default - Wine desktop"] floating enable
# Bindings to make the webcam float and stick.
for_window [title="mpvfloat"] floating enable
for_window [title="mpvfloat"] sticky enable
for_window [title="mpvfloat"] border pixel 0
no_focus [title="mpvfloat"]
# #---Function Buttons---# #
bindsym $mod+F1 exec --no-startup-id groff -mom ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/readme.mom -Tpdf | zathura -
bindsym $mod+F2 restart
bindsym $mod+F3 exec --no-startup-id displayselect
bindsym $mod+F4 exec --no-startup-id prompt "Hibernate computer?" "$hibernate"
bindsym $mod+F5 exec --no-startup-id $netrefresh
bindsym $mod+F6 exec --no-startup-id torwrap
bindsym $mod+F7 exec --no-startup-id td-toggle
bindsym $mod+F8 exec --no-startup-id mw sync
bindsym $mod+F9 exec --no-startup-id dmenumount
bindsym $mod+F10 exec --no-startup-id dmenuumount
bindsym $mod+F11 exec --no-startup-id ducksearch
bindsym $mod+F12 exec $term -e nmtui
bindsym $mod+Shift+F1 exec --no-startup-id toggle-welcome
# #---Arrow Keys---# #
bindsym $mod+Left focus left
bindsym $mod+Shift+Left move left
bindsym $mod+Ctrl+Left move workspace to output left
bindsym $mod+Down focus down
bindsym $mod+Shift+Down move down
bindsym $mod+Ctrl+Down move workspace to output down
bindsym $mod+Up focus up
bindsym $mod+Shift+Up move up
bindsym $mod+Ctrl+Up move workspace to output up
bindsym $mod+Right focus right
bindsym $mod+Shift+Right move right
bindsym $mod+Ctrl+Right move workspace to output right
# #---Media Keys---# #
# Volume keys
bindsym $mod+plus exec --no-startup-id pulsemixer --change-volume +5 && pkill -RTMIN+10 i3blocks
bindsym $mod+Shift+plus exec --no-startup-id pulsemixer --change-volume +15 && pkill -RTMIN+10 i3blocks
bindsym $mod+minus exec --no-startup-id pulsemixer --change-volume -5 && pkill -RTMIN+10 i3blocks
bindsym $mod+Shift+minus exec --no-startup-id pulsemixer --change-volume -15 && pkill -RTMIN+10 i3blocks
bindsym $mod+less exec --no-startup-id mpc prev
bindsym $mod+Shift+less exec --no-startup-id mpc seek 0%
bindsym $mod+greater exec --no-startup-id mpc next
bindsym $mod+Shift+greater exec --no-startup-id mpc next
# For advancing forward/backward in an mpd song
bindsym $mod+bracketleft exec --no-startup-id mpc seek -10
bindsym $mod+Shift+bracketleft exec --no-startup-id mpc seek -120
bindsym $mod+bracketright exec --no-startup-id mpc seek +10
bindsym $mod+Shift+bracketright exec --no-startup-id mpc seek +120
# For screenshots and recording
bindsym Print exec --no-startup-id maim pic-full-"$(date '+%y%m%d-%H%M-%S').png"
bindsym Shift+Print exec --no-startup-id maimpick
bindsym $mod+Print exec --no-startup-id dmenurecord
bindsym $mod+Scroll_Lock exec --no-startup-id "killall screenkey || screenkey"
bindsym $mod+Delete exec $stoprec
bindsym XF86Launch1 exec --no-startup-id xset dpms force off
# #---Extra XF86 Keys---# #
bindsym XF86AudioMute exec --no-startup-id pulsemixer --toggle-mute && pkill -RTMIN+10 i3blocks
bindsym XF86AudioLowerVolume exec --no-startup-id pulsemixer --change-volume -5 && pkill -RTMIN+10 i3blocks
bindsym Shift+XF86AudioLowerVolume exec --no-startup-id pulsemixer --change-volume -10 && pkill -RTMIN+10 i3blocks
bindsym Control+XF86AudioLowerVolume exec --no-startup-id pulsemixer --change-volume -1 && pkill -RTMIN+10 i3blocks
bindsym XF86AudioRaiseVolume exec --no-startup-id pulsemixer --change-volume +5 && pkill -RTMIN+10 i3blocks
bindsym Shift+XF86AudioRaiseVolume exec --no-startup-id pulsemixer --change-volume +10 && pkill -RTMIN+10 i3blocks
bindsym Control+XF86AudioRaiseVolume exec --no-startup-id pulsemixer --change-volume +1 && pkill -RTMIN+10 i3blocks
bindsym XF86PowerOff exec --no-startup-id prompt "Shutdown computer?" "$shutdown"
##bindsym XF86Copy exec
##bindsym XF86Open exec
##bindsym XF86Paste exec
##bindsym XF86Cut exec
##bindsym XF86MenuKB exec
bindsym XF86Calculator exec --no-startup-id ddspawn dropdowncalc -f mono:pixelsize=24
##bindsym XF86Sleep This binding is typically mapped by systemd automatically.
##bindsym XF86WakeUp exec
bindsym XF86Explorer exec $term -e lf
##bindsym XF86Send exec
##bindsym XF86Xfer exec
bindsym XF86WWW exec --no-startup-id $BROWSER
##bindsym XF86DOS exec
bindsym XF86ScreenSaver exec exec --no-startup-id lockscreen
##bindsym XF86RotateWindows exec
##bindsym XF86TaskPane exec
##bindsym XF86Favorites exec
bindsym XF86MyComputer exec $term -e lf
##bindsym XF86Back exec
##bindsym XF86Forward exec
bindsym XF86Eject exec --no-startup-id dmenuumount
bindsym XF86AudioNext exec --no-startup-id mpc next
bindsym XF86AudioPlay exec --no-startup-id mpc toggle
bindsym XF86AudioPrev exec --no-startup-id mpc prev
bindsym XF86AudioStop exec --no-startup-id mpc toggle
##bindsym XF86AudioRecord
bindsym XF86AudioRewind exec --no-startup-id mpc seek -10
bindsym XF86AudioForward exec --no-startup-id mpc seek +10
##bindsym XF86Phone exec
##bindsym XF86Tools exec
bindsym XF86HomePage exec $BROWSER https://lukesmith.xyz
bindsym XF86Reload restart
##bindsym XF86ScrollUp exec
##bindsym XF86ScrollDown exec
##bindsym XF86New exec
##bindsym XF86LaunchA exec
##bindsym XF86LaunchB exec
##bindsym XF86Launch2 exec
##bindsym XF86Launch3 exec
##bindsym XF86Launch4 exec
##bindsym XF86Launch5 exec
##bindsym XF86Launch6 exec
##bindsym XF86Launch7 exec
##bindsym XF86Launch8 exec
##bindsym XF86Launch9 exec
#bindsym XF86AudioMicMute exec $micmute
bindsym XF86TouchpadToggle exec --no-startup-id toggletouchpad
bindsym XF86TouchpadOn exec --no-startup-id synclient TouchpadOff=0
bindsym XF86TouchpadOff exec --no-startup-id synclient TouchpadOff=1
bindsym XF86Suspend exec --no-startup-id lockscreen
bindsym XF86Close kill
bindsym XF86WebCam exec --no-startup-id camtoggle
bindsym XF86Mail exec $term -e neomutt && pkill -RTMIN+12 i3blocks
bindsym XF86Messenger exec $term -e weechat
bindsym XF86Search exec $BROWSER https://duckduckgo.com
##bindsym XF86Go exec
##bindsym XF86Finance exec
##bindsym XF86Game exec
bindsym XF86Shop exec $BROWSER https://ebay.com
bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 15
bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 15
bindsym XF86AudioMedia exec --no-startup-id $term -e ncmpcpp
bindsym XF86Display exec --no-startup-id displayselect
#bindsym XF86KbdLightOnOff exec
#bindsym XF86KbdBrightnessDown exec
#bindsym XF86KbdBrightnessUp exec
##bindsym XF86Reply exec
##bindsym XF86MailForward exec
##bindsym XF86Save exec
bindsym XF86Documents exec $term -e lf ~/Documents
##bindsym XF86Battery exec
##bindsym XF86Bluetooth exec
bindsym XF86WLAN exec $netrefresh

View file

@ -1,68 +0,0 @@
command=~/.local/bin/statusbar/$BLOCK_NAME
separator_block_width=15
markup=pango
[record]
command=cat /tmp/recordingicon
interval=once
signal=9
[music]
label=🎼
interval=once
signal=11
[news]
interval=once
signal=6
#[iplocate]
#interval=30
[pacpackages]
interval=once
signal=8
[torrent]
interval=20
signal=7
[weather]
interval=18000
signal=5
[mailbox]
interval=180
signal=12
#[memory]
#interval=30
#[cpu]
#interval=15
[volume]
interval=once
signal=10
#[disk]
#interval=60
#command=disk /
#[disk]
#interval=60
#command=disk /home
[battery]
command=battery BAT0
interval=5
[clock]
label=📅
interval=30
[internet]
interval=10
[help-icon]
interval=once

View file

@ -11,13 +11,11 @@ call plug#begin(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/plugged"
Plug 'tpope/vim-surround'
Plug 'preservim/nerdtree'
Plug 'junegunn/goyo.vim'
Plug 'PotatoesMaster/i3-vim-syntax'
Plug 'jreybert/vimagit'
Plug 'lukesmithxyz/vimling'
Plug 'vimwiki/vimwiki'
Plug 'bling/vim-airline'
Plug 'tpope/vim-commentary'
Plug 'kovetskiy/sxhkd-vim'
Plug 'ap/vim-css-color'
call plug#end()
@ -114,11 +112,9 @@ set clipboard+=unnamedplus
autocmd BufWritepre * %s/\n\+\%$//e
" When shortcut files are updated, renew bash and ranger configs with new material:
autocmd BufWritePost files,directories !shortcuts
autocmd BufWritePost bm-files,bm-dirs !shortcuts
" Run xrdb whenever Xdefaults or Xresources are updated.
autocmd BufWritePost *Xresources,*Xdefaults !xrdb %
" Update binds when sxhkdrc is updated.
autocmd BufWritePost *sxhkdrc !pkill -USR1 sxhkd
autocmd BufWritePost *Xresources,*Xdefaults,*xresources,*xdefaults !xrdb %
" Turns off highlighting on the bits of code that are changed, so the line that is changed is highlighted but the actual text that has changed stands out on the line and is readable.
if &diff

View file

@ -1,413 +0,0 @@
; vim:ft=dosini
;=====================================================
;
; To learn more about how to configure Polybar
; go to https://github.com/jaagr/polybar
;
; The README contains alot of information
;
;=====================================================
[colors]
black = ${xrdb:color0:#1d2021}
darkred = ${xrdb:color1:#cc241d}
darkgreen = ${xrdb:color2:#98971a}
darkyellow = ${xrdb:color3:#d79921}
darkblue = ${xrdb:color4:#458588}
darkmagenta = ${xrdb:color5:#b16286}
darkcyan = ${xrdb:color6:#689d6a}
lightgray = ${xrdb:color7:#a89984}
gray = ${xrdb:color8:#928374}
red = ${xrdb:color9:#fb4934}
green = ${xrdb:color10:#b8bb26}
yellow = ${xrdb:color11:#fabd2f}
blue = ${xrdb:color12:#83a598}
magenta = ${xrdb:color13:#d3869b}
cyan = ${xrdb:color14:#8ec07c}
white = ${xrdb:color15:#ebdbb2}
background = ${xrdb:color256:#1d2021}
foreground = ${xrdb:color257:#ebdbb2}
[bar/default]
;monitor = ${env:MONITOR:LVDS-1}
;monitor = ${env:MONITOR:HDMI-1}
enable-ipc = true
width = 100%
height = 24
;offset-x = 1%
;offset-y = 1%
;radius = 6.0
fixed-center = false
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3
line-color = {$xrdb:red}
border-size = 0
border-color = ${colors.white}
padding-left = 0
padding-right = 0
module-margin-left = 1
module-margin-right = 1
font-0 = mono:pixelsize=9;1
font-1 = Inconsolata Nerd Font:size=8;1
font-2 = Noto Color Emoji:scale=10:style=Regular;2
font-3 = Symbola:pixelsize=9;1
; Other modules: xkeyboard filesystem xbacklight backlight-acpi cpu memory temperature powermenu weather
modules-left = bspwm xwindow
;modules-center =
modules-right = mpd volume mutt-wizard wlan eth battery date
tray-position = right
tray-padding = 0
wm-restack = bspwm
;override-redirect = true
scroll-up = bspwm-desknext
scroll-down = bspwm-deskprev
[module/mutt-wizard]
type = custom/script
exec = mailbox
interval = 5
format-prefix = " "
format-underline = ${colors.red}
click-left = $TERMINAL -e neomutt
[module/weather]
type = custom/script
exec = weather
interval = 5000
;format-underline =
[module/xwindow]
type = internal/xwindow
label = %title:0:45:...%
format-foreground = ${colors.blue}
[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock
format-prefix = " "
format-prefix-foreground = ${colors.gray}
format-prefix-underline = ${colors.darkmagenta}
label-layout = %layout%
label-layout-underline = ${colors.darkmagenta}
label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-background = ${colors.darkmagenta}
label-indicator-underline = ${colors.darkmagenta}
[module/filesystem]
type = internal/fs
interval = 25
mount-0 = /
mount-1 = /home
label-mounted-underline = ${colors.cyan}
label-mounted = /: %percentage_used%%
label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.gray}
[module/bspwm]
type = internal/bspwm
label-focused = %index%
label-focused-foreground = ${colors.black}
label-focused-background = ${colors.blue}
label-focused-underline= ${colors.yellow}
label-focused-padding = 1
label-occupied = %index%
label-occupied-underline = ${colors.blue}
label-occupied-padding = 1
label-urgent = %index%!
label-urgent-background = ${colors.red}
label-urgent-padding = 1
label-empty = %index%
label-empty-foreground = ${colors.lightgray}
label-empty-padding = 1
[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false
; Only show workspaces on the same output as the bar
;pin-workspaces = true
label-mode-padding = 2
label-mode-foreground = ${colors.white}
label-mode-background = ${colors.darkyellow}
; focused = Active workspace on focused monitor
label-focused = %index%
label-focused-background = ${colors:black}
;label-focused-background = ${module/bspwm.label-focused-background}
label-focused-underline = ${module/bspwm.label-focused-underline}
label-focused-padding = ${module/bspwm.label-focused-padding}
; unfocused = Inactive workspace on any monitor
label-unfocused = %index%
label-unfocused-padding = ${module/bspwm.label-occupied-padding}
; visible = Active workspace on unfocused monitor
label-visible = %index%
label-visible-background = ${self.label-focused-background}
label-visible-underline = ${self.label-focused-underline}
label-visible-padding = ${self.label-focused-padding}
; urgent = Workspace with urgency hint set
label-urgent = %index%
label-urgent-background = ${module/bspwm.label-urgent-background}
label-urgent-padding = ${module/bspwm.label-urgent-padding}
[module/mpd]
type = internal/mpd
format-online = <label-song> <label-time>
click-left = $TERMINAL -e ncmpcpp
click-right = mpc toggle
label-song = %artist% - %title%
label-song-maxlen = 70
label-song-ellipsis = true
format-paused-foreground = ${colors.gray}
[module/xbacklight]
type = internal/xbacklight
format = <label> <bar>
label = ﯧ
bar-width = 10
bar-indicator = |
bar-indicator-foreground = #ff
bar-indicator-font = 2
bar-fill = ─
bar-fill-font = 2
bar-fill-foreground = #9f78e1
bar-empty = ─
bar-empty-font = 2
bar-empty-foreground = ${colors.gray}
[module/backlight-acpi]
inherit = module/xbacklight
type = internal/backlight
card = intel_backlight
[module/cpu]
type = internal/cpu
interval = 2
format-prefix = "🌡 "
format-prefix-foreground = ${colors.gray}
format-underline = ${colors.red}
label = %percentage%%
[module/memory]
type = internal/memory
interval = 2
format-prefix = "🧠 "
format-prefix-foreground = ${colors.gray}
format-underline = ${colors.darkcyan}
label = %percentage_used%%
[module/wlan]
type = internal/network
interface = wlp2s0
interval = 3.0
format-connected = 直 <label-connected>
format-connected-underline = ${colors.darkmagenta}
label-connected = %essid%
;format-disconnected =
format-disconnected = <label-disconnected>
format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
label-disconnected = 睊no wifi
label-disconnected-foreground = ${colors.gray}
; <ramp-signal>
ramp-signal-0 = 
ramp-signal-1 = 
ramp-signal-2 = 
ramp-signal-3 = 
ramp-signal-4 = 
ramp-signal-foreground = ${colors.gray}
[module/eth]
type = internal/network
interface = enp0s25
interval = 3.0
format-connected-underline = ${colors.darkgreen}
;format-connected-underline = ${colors.green}
format-connected-prefix = " "
format-connected-prefix-foreground = ${colors.gray}
label-connected = %local_ip%
;format-disconnected =
format-disconnected = <label-disconnected>
format-disconnected-underline = ${self.format-connected-underline}
label-disconnected =  %ifname%
label-disconnected-foreground = ${colors.gray}
[module/date]
type = internal/date
interval = 60
date = "%Y %b %d (%a)"
time = "%I:%M%p"
# If you're not living in a country where AM and PM is used you can add -alt to the time above this line and comment it using ;, then you can remove the -alt to the time under this line and uncomment it.
;time-alt = " at %H:%M"
;time-alt = %H:%M:%S
;time-alt = %H:%M:%S
format-prefix = " "
format-prefix-foreground = ${colors.gray}
format-underline = ${colors.blue}
label = %date% %time%
[module/volume]
type = internal/alsa
format-volume = <label-volume> <bar-volume>
label-volume = 
label-volume-foreground = ${root.foreground}
format-muted-prefix = " "
format-muted-foreground = ${colors.gray}
label-muted = muted
bar-volume-width = 10
bar-volume-foreground-0 = ${colors.blue}
bar-volume-foreground-1 = ${colors.blue}
bar-volume-foreground-2 = ${colors.green}
bar-volume-foreground-3 = ${colors.green}
bar-volume-foreground-4 = ${colors.green}
bar-volume-foreground-5 = ${colors.yellow}
bar-volume-foreground-6 = ${colors.red}
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = =
bar-volume-fill-font = 2
bar-volume-empty = =
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.gray}
[module/battery]
type = internal/battery
battery = BAT0
adapter = ADP1
full-at = 98
;format-charging = Charging... <label-charging>
format-charging = <animation-charging> <label-charging>
format-charging-underline = ${colors.darkyellow}
;format-discharging = <label-discharging>
format-discharging = <ramp-capacity> <label-discharging>
format-discharging-underline = ${self.format-charging-underline}
format-full-prefix = " "
format-full-prefix-foreground = ${colors.gray}
format-full-underline = ${self.format-charging-underline}
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 
ramp-capacity-foreground = ${colors.gray}
animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-3 = 
animation-charging-4 = 
animation-charging-foreground = ${colors.gray}
animation-charging-framerate = 500
[module/temperature]
type = internal/temperature
thermal-zone = 0
warn-temperature = 60
format = <ramp> <label>
format-underline = ${colors.red}
format-warn = <ramp> <label-warn>
format-warn-underline = ${self.format-underline}
label = %temperature-c%
label-warn = %temperature-c%
label-warn-foreground = ${colors.darkmagenta}
ramp-0 = 
ramp-1 = 
ramp-2 = 
ramp-3 = 
ramp-4 = 
ramp-foreground = ${colors.gray}
[module/powermenu]
type = custom/menu
format-spacing = 1
label-open = 
label-open-foreground = ${colors.darkmagenta}
label-close =  cancel
label-close-foreground = ${colors.darkmagenta}
label-separator = |
label-separator-foreground = ${colors.gray}
menu-0-0 = reboot
menu-0-0-exec = menu-open-1
menu-0-1 = power off
menu-0-1-exec = menu-open-2
menu-1-0 = cancel
menu-1-0-exec = menu-open-0
menu-1-1 = reboot
menu-1-1-exec = sudo reboot
menu-2-0 = power off
menu-2-0-exec = sudo poweroff
menu-2-1 = cancel
menu-2-1-exec = menu-open-0
[settings]
screenchange-reload = true
;compositing-background = xor
;compositing-background = screen
;compositing-foreground = source
;compositing-border = over
[global/wm]
margin-top = 5
margin-bottom = 5

View file

@ -1,85 +0,0 @@
# Luke's ranger setup
## Basic Ranger shortcuts
These are the basic key binds in ranger, even outside of my configs. Note that they are mostly vim-based.
+ h/j/k/l -- Move left/down/up/right (where left moves up in the directory structure, right moves into a folder)
+ Space -- select/highlight file
+ dd -- cut selected files
+ yy -- copy/yank selected files
+ pp -- paste/move cut/copied files
+ / -- search, when (n/N) next/previous result
+ zh or CTRL-h -- show hidden files
+ Renaming files:
+ cw -- rename file from scratch
+ A -- rename file adding to the end
+ aa -- rename file appending before the extension
+ I -- rename file adding at the beginning
## Shortcuts
As I say in the main readme, there are shortcut commands generated for ranger
based on what bookmarked directories and files you give it. For directory
shortcuts, here are the "verbs":
+ g -- "go or cd"
+ t -- "new tab"
+ m -- "move file"
+ Y -- "yank or copy file"
These "verbs" take "nouns" or "arguments," like these:
+ d -- "~/Documents"
+ D -- "~/Downloads"
+ cf -- "~/.config"
+ And many others, including those you add to `~/.bmdirs`.
Press any "verb" followed by any "argument" to perform a folder operation. "gd" will cd to ~/Documents, for example. "mD" will move the selected file(s) to ~/Downloads. "tcf" will create a new tab in ~/.config, etc. etc.
## Many little additions!
+ Basic additions:
+ V -- Make a new file and edit it in vim
+ cW -- rename *all* selected files, editing in your text editor
+ mkd -- Make a directory/folder
+ sc -- Makes a link/shortcut (ln -sT)
+ D -- delete selected file
+ X -- Extract a zip/rar/tar.gz, whatever. Runs a script that picks the right command for the right archive.
+ Z -- zips a folder up into a .tar.gz archive.
+ CTRL-f -- Fuzzy find a file
+ CTRL-l -- Fuzzy locate a file
+ Document manipulation:
+ p1s -- print this file on the default printer, one-sided (lpr)
+ p2s -- print this file on the default printer, double-sided (lpr)
+ MP -- convert to a .pdf with pandoc (I use this to convert markdown, etc.)
+ MX -- compile selected document in XeLaTeX
+ ML -- compile selected document in LaTeX
+ TC -- clear all non-visible TeX build files in this directory
+ Txa -- copy article template to new file
+ Txs -- copy slideshow/beamer template to new file
+ Txh -- copy handout template to new file
+ Image commands:
+ bg -- makes an image your background (assuming i3 is looking at ~/.local/share/bg for your background)
+ bw -- runs Pywal on the selected image, making it your background and generating a color scheme based off of it.
+ C -- rotates an image (requires imagemagick)
+ F -- flips an image (requires imagemagick)
+ TR -- add transparency to image file
+ mpd/mpc shortcuts
+ MS -- Start mpd
+ MK -- kill mpd
+ MN -- Start playing selected song/folder now
+ Ma -- Enqueue selected song/folder
+ Mp -- Pause
+ Mn -- Next track
+ Mb -- Previous track
+ Mo -- Restart track
+ Audio tagging with eye3D:
+ Ta -- change artist name
+ TA -- change album name
+ Tb -- change album artist
+ Tt -- change title
+ Tn -- change track number
+ Downloading:
+ ytv -- Download online video (paste in url) (requires youtube-dl)
+ yta -- Download audio of online video (paste in url) (requires youtube-dl)

View file

@ -1,208 +0,0 @@
# This is a sample commands.py. You can add your own commands here.
#
# Please refer to commands_full.py for all the default commands and a complete
# documentation. Do NOT add them all here, or you may end up with defunct
# commands when upgrading ranger.
# You always need to import ranger.api.commands here to get the Command class:
from ranger.api.commands import *
from ranger.core.loader import CommandLoader
# A simple command for demonstration purposes follows.
#------------------------------------------------------------------------------
# You can import any python module as needed.
import os
# Any class that is a subclass of "Command" will be integrated into ranger as a
# command. Try typing ":my_edit<ENTER>" in ranger!
class my_edit(Command):
# The so-called doc-string of the class will be visible in the built-in
# help that is accessible by typing "?c" inside ranger.
""":my_edit <filename>
A sample command for demonstration purposes that opens a file in an editor.
"""
# The execute method is called when you run this command in ranger.
def execute(self):
# self.arg(1) is the first (space-separated) argument to the function.
# This way you can write ":my_edit somefilename<ENTER>".
if self.arg(1):
# self.rest(1) contains self.arg(1) and everything that follows
target_filename = self.rest(1)
else:
# self.fm is a ranger.core.filemanager.FileManager object and gives
# you access to internals of ranger.
# self.fm.thisfile is a ranger.container.file.File object and is a
# reference to the currently selected file.
target_filename = self.fm.thisfile.path
# This is a generic function to print text in ranger.
self.fm.notify("Let's edit the file " + target_filename + "!")
# Using bad=True in fm.notify allows you to print error messages:
if not os.path.exists(target_filename):
self.fm.notify("The given file does not exist!", bad=True)
return
# This executes a function from ranger.core.acitons, a module with a
# variety of subroutines that can help you construct commands.
# Check out the source, or run "pydoc ranger.core.actions" for a list.
self.fm.edit_file(target_filename)
# The tab method is called when you press tab, and should return a list of
# suggestions that the user will tab through.
def tab(self):
# This is a generic tab-completion function that iterates through the
# content of the current directory.
return self._tab_directory_content()
# https://github.com/ranger/ranger/wiki/Integrating-File-Search-with-fzf
# Now, simply bind this function to a key, by adding this to your ~/.config/ranger/rc.conf: map <C-f> fzf_select
class fzf_select(Command):
"""
:fzf_select
Find a file using fzf.
With a prefix argument select only directories.
See: https://github.com/junegunn/fzf
"""
def execute(self):
import subprocess
if self.quantifier:
# match only directories
command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
-o -type d -print 2> /dev/null | sed 1d | cut -b3- | fzf +m"
else:
# match files and directories
command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
-o -print 2> /dev/null | sed 1d | cut -b3- | fzf +m"
fzf = self.fm.execute_command(command, stdout=subprocess.PIPE)
stdout, stderr = fzf.communicate()
if fzf.returncode == 0:
fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n'))
if os.path.isdir(fzf_file):
self.fm.cd(fzf_file)
else:
self.fm.select_file(fzf_file)
# fzf_locate
class fzf_locate(Command):
"""
:fzf_locate
Find a file using fzf.
With a prefix argument select only directories.
See: https://github.com/junegunn/fzf
"""
def execute(self):
import subprocess
if self.quantifier:
command="locate home media | fzf -e -i"
else:
command="locate home media | fzf -e -i"
fzf = self.fm.execute_command(command, stdout=subprocess.PIPE)
stdout, stderr = fzf.communicate()
if fzf.returncode == 0:
fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n'))
if os.path.isdir(fzf_file):
self.fm.cd(fzf_file)
else:
self.fm.select_file(fzf_file)
class fzf_bring(Command):
"""
:fzf_bring
Find a file using fzf and bring it to the current directory.
See: https://github.com/junegunn/fzf
"""
def execute(self):
import subprocess
import shutil
if self.quantifier:
# match only directories
command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
-o -type d -print 2> /dev/null | sed 1d | cut -b3- | fzf +m"
else:
# match files and directories
command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
-o -print 2> /dev/null | sed 1d | cut -b3- | fzf +m"
fzf = self.fm.execute_command(command, stdout=subprocess.PIPE)
stdout, stderr = fzf.communicate()
if fzf.returncode == 0:
fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n'))
shutil.move(fzf_file, self.fm.thisdir.path)
class compress(Command):
def execute(self):
""" Compress marked files to current directory """
cwd = self.fm.thisdir
marked_files = cwd.get_selection()
if not marked_files:
return
def refresh(_):
cwd = self.fm.get_directory(original_path)
cwd.load_content()
original_path = cwd.path
parts = self.line.split()
au_flags = parts[1:]
descr = "compressing files in: " + os.path.basename(parts[1])
obj = CommandLoader(args=['apack'] + au_flags + \
[os.path.relpath(f.path, cwd.path) for f in marked_files], descr=descr)
obj.signal_bind('after', refresh)
self.fm.loader.add(obj)
def tab(self):
""" Complete with current folder name """
extension = ['.zip', '.tar.gz', '.rar', '.7z']
return ['compress ' + os.path.basename(self.fm.thisdir.path) + ext for ext in extension]
class extracthere(Command):
def execute(self):
""" Extract copied files to current directory """
copied_files = tuple(self.fm.copy_buffer)
if not copied_files:
return
def refresh(_):
cwd = self.fm.get_directory(original_path)
cwd.load_content()
one_file = copied_files[0]
cwd = self.fm.thisdir
original_path = cwd.path
au_flags = ['-X', cwd.path]
au_flags += self.line.split()[1:]
au_flags += ['-e']
self.fm.copy_buffer.clear()
self.fm.cut_buffer = False
if len(copied_files) == 1:
descr = "extracting: " + os.path.basename(one_file.path)
else:
descr = "extracting files from: " + os.path.basename(one_file.dirname)
obj = CommandLoader(args=['aunpack'] + au_flags \
+ [f.path for f in copied_files], descr=descr)
obj.signal_bind('after', refresh)
self.fm.loader.add(obj)

View file

@ -1,508 +0,0 @@
###SETTINGS###
set column_ratios 1,3,4
#set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$
set hidden_filter ^\.|\.(?:pyc|vrb|pyo|lof|bak|swp|aux|log|nav|out|snm|toc|bcf|run\.xml|synctex\.gz|blg|bbl)$|^lost\+found$|^__(py)?cache__$
set show_hidden false
set confirm_on_delete multiple
set use_preview_script true
set automatically_count_files true
set open_all_images true
set vcs_aware false
set vcs_backend_git enabled
set vcs_backend_hg disabled
set vcs_backend_bzr disabled
set preview_images true
set preview_images_method ueberzug
set unicode_ellipsis false
set show_hidden_bookmarks false
set colorscheme default
set preview_files true
set preview_directories true
set collapse_preview true
set save_console_history false
set status_bar_on_top false
set draw_progress_bar_in_status_bar true
set draw_borders true
set dirname_in_tabs true
set mouse_enabled true
set display_size_in_main_column true
set display_size_in_status_bar true
set display_tags_in_all_columns true
set update_title false
set update_tmux_title true
set shorten_title 3
set tilde_in_titlebar true
set max_history_size 20
set max_console_history_size 50
set scroll_offset 8
set flushinput true
set padding_right true
set autosave_bookmarks false
set autoupdate_cumulative_size false
set show_cursor false
set sort natural
set sort_reverse false
set sort_case_insensitive true
set sort_directories_first true
set sort_unicode false
set xterm_alt_key false
set cd_bookmarks false
set preview_max_size 0
set show_selection_in_titlebar true
set idle_delay 2000
set metadata_deep_search false
###ALIASES###
alias e edit
alias q quit
alias q! quitall
alias qa quitall
alias qall quitall
alias setl setlocal
alias filter scout -prt
alias find scout -aeit
alias mark scout -mr
alias unmark scout -Mr
alias search scout -rs
alias search_inc scout -rts
alias travel scout -aefiklst
###BASIC KEYS###
#BASIC
map Q quit!
map q quit
copymap q ZZ ZQ
#map R reload_cwd
map <C-r> reset
#map <C-l> redraw_window
map <C-c> abort
map <esc> change_mode normal
map i display_file
map ? help
#map W display_log
map w taskview_open
map S shell $SHELL
map : console
map ; console
map ! console shell%space
map @ console -p6 shell %s
map # console shell -p%space
#map s console shell%space
map r chain draw_possible_programs; console open_with%%space
map f console find%space
map cd console cd%space
# Change the line mode
#map Mf linemode filename
#map Mi linemode fileinfo
#map Mp linemode permissions
#map Mt linemode metatitle
#moc
#map Mc shell mocp -c
#map Ma shell mocp -a %s
#map Ms shell mocp -p
#map MS shell mocp -S
#map Mp shell mocp -G
#map Mn shell mocp -f
#map Mb shell mocp -r
#map MN shell mocp -s && mocp -c && mocp -a %s && mocp -p
#map Mo shell mocp -j 0%%
#map MK shell killall mocp
# Tagging / Marking
map at tag_toggle
map ut tag_remove
map "<any> tag_toggle tag=%any
map <Space> mark_files toggle=True
map va mark_files all=True toggle=True
map uv mark_files all=True val=False
map vs toggle_visual_mode
map uV toggle_visual_mode reverse=True
# For the nostalgics: Midnight Commander bindings
map <F1> help
map <F3> display_file
map <F4> edit
map <F5> copy
map <F5> console shell echo "require(rmarkdown); render_site()" | R --vanilla
map <F6> cut
map <F7> console mkdir%space
map <F8> console delete
map <F10> exit
# In case you work on a keyboard with dvorak layout
map <UP> move up=1
map <DOWN> move down=1
map <LEFT> move left=1
map <RIGHT> move right=1
map <HOME> move to=0
map <END> move to=-1
map <PAGEDOWN> move down=1 pages=True
map <PAGEUP> move up=1 pages=True
map <CR> move right=1
map <DELETE> console delete
map <INSERT> console touch%space
# VIM-like
copymap <UP> k
copymap <DOWN> j
copymap <LEFT> h
copymap <RIGHT> l
copymap <HOME> gg
copymap <END> G
copymap <PAGEDOWN> <C-F>
copymap <PAGEUP> <C-B>
map J move down=0.5 pages=True
map K move up=0.5 pages=True
copymap J <C-D>
copymap K <C-U>
# Jumping around
map H history_go -1
map L history_go 1
map ] move_parent 1
map [ move_parent -1
map } traverse
#DEFAULT MOVEMENT
map ge cd /etc
map gu cd /usr
#map gl cd -r .
map gL cd -r %f
#map gv cd /var
map gM cd /mnt
map gr cd /
map gR eval fm.cd(ranger.RANGERDIR)
map g? cd /usr/share/doc/ranger
# Tabs
map <C-n> tab_new ~
map <C-w> tab_close
map <TAB> tab_move 1
map <S-TAB> tab_move -1
map <A-Right> tab_move 1
map <A-Left> tab_move -1
#map gt tab_move 1
#map gT tab_move -1
map gn tab_new ~
#map gc tab_close
map tt tab_close
map uq tab_restore
map <a-1> tab_open 1
map <a-2> tab_open 2
map <a-3> tab_open 3
map <a-4> tab_open 4
map <a-5> tab_open 5
map <a-6> tab_open 6
map <a-7> tab_open 7
map <a-8> tab_open 8
map <a-9> tab_open 9
# External Programs
map E edit
map du shell -p du --max-depth=1 -h --apparent-size
map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh
map yp shell -f echo -n %%d/%%f | xsel -i; xsel -o | xsel -i -b
map yd shell -f echo -n %%d | xsel -i; xsel -o | xsel -i -b
map yn shell -f echo -n %%f | xsel -i; xsel -o | xsel -i -b
# Filesystem Operations
map = chmod
map cw console rename%space
map aa rename_append
map A eval fm.open_console('rename ' + fm.thisfile.relative_path)
map I eval fm.open_console('rename ' + fm.thisfile.relative_path, position=7)
map pp paste
map po paste overwrite=True
map pP paste append=True
map pO paste overwrite=True append=True
map pl paste_symlink relative=False
map pL paste_symlink relative=True
map phl paste_hardlink
map pht paste_hardlinked_subtree
map dD console delete
map dd cut
map ud uncut
map da cut mode=add
map dr cut mode=remove
map yy copy
map uy uncut
map ya copy mode=add
map yr copy mode=remove
# Temporary workarounds
map dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier)
map dG eval fm.cut(dirarg=dict(to=-1), narg=quantifier)
map dj eval fm.cut(dirarg=dict(down=1), narg=quantifier)
map dk eval fm.cut(dirarg=dict(up=1), narg=quantifier)
map ygg eval fm.copy(dirarg=dict(to=0), narg=quantifier)
map yG eval fm.copy(dirarg=dict(to=-1), narg=quantifier)
map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier)
map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier)
# Searching
map / console search%space
map n search_next
map N search_next forward=False
map ct search_next order=tag
map cs search_next order=size
map ci search_next order=mimetype
map cc search_next order=ctime
map cm search_next order=mtime
map ca search_next order=atime
# Sorting
map or toggle_option sort_reverse
map oz set sort=random
map os chain set sort=size; set sort_reverse=False
map ob chain set sort=basename; set sort_reverse=False
map on chain set sort=natural; set sort_reverse=False
map om chain set sort=mtime; set sort_reverse=False
map oc chain set sort=ctime; set sort_reverse=False
map oa chain set sort=atime; set sort_reverse=False
map ot chain set sort=type; set sort_reverse=False
map oe chain set sort=extension; set sort_reverse=False
map oS chain set sort=size; set sort_reverse=True
map oB chain set sort=basename; set sort_reverse=True
map oN chain set sort=natural; set sort_reverse=True
map oM chain set sort=mtime; set sort_reverse=True
map oC chain set sort=ctime; set sort_reverse=True
map oA chain set sort=atime; set sort_reverse=True
map oT chain set sort=type; set sort_reverse=True
map oE chain set sort=extension; set sort_reverse=True
map dc get_cumulative_size
# Settings
map zc toggle_option collapse_preview
map zd toggle_option sort_directories_first
map zh toggle_option show_hidden
map <C-h> toggle_option show_hidden
map zi toggle_option flushinput
map zm toggle_option mouse_enabled
map zp toggle_option preview_files
map zP toggle_option preview_directories
map zs toggle_option sort_case_insensitive
map zu toggle_option autoupdate_cumulative_size
map zv toggle_option use_preview_script
map zf console filter%space
# Bookmarks
#map `<any> enter_bookmark %any
#map '<any> enter_bookmark %any
#map mm<any> set_bookmark %any
#map um<any> unset_bookmark %any
#map m<bg> draw_bookmarks
#copymap m<bg> um<bg> `<bg> '<bg>
# Generate all the chmod bindings with some python help:
eval for arg in "rwxXst": cmd("map +u{0} shell -f chmod u+{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map +g{0} shell -f chmod g+{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map +o{0} shell -f chmod o+{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map +a{0} shell -f chmod a+{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map +{0} shell -f chmod u+{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map -u{0} shell -f chmod u-{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map -g{0} shell -f chmod g-{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map -o{0} shell -f chmod o-{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map -a{0} shell -f chmod a-{0} %s".format(arg))
eval for arg in "rwxXst": cmd("map -{0} shell -f chmod u-{0} %s".format(arg))
###CONSOLE KEYS###
# Basic
cmap <tab> eval fm.ui.console.tab()
cmap <s-tab> eval fm.ui.console.tab(-1)
cmap <ESC> eval fm.ui.console.close()
cmap <CR> eval fm.ui.console.execute()
#cmap <C-l> redraw_window
copycmap <ESC> <C-c>
copycmap <CR> <C-j>
# Move around
cmap <up> eval fm.ui.console.history_move(-1)
cmap <down> eval fm.ui.console.history_move(1)
cmap <left> eval fm.ui.console.move(left=1)
cmap <right> eval fm.ui.console.move(right=1)
cmap <home> eval fm.ui.console.move(right=0, absolute=True)
cmap <end> eval fm.ui.console.move(right=-1, absolute=True)
# Line Editing
cmap <backspace> eval fm.ui.console.delete(-1)
cmap <delete> eval fm.ui.console.delete(0)
cmap <C-w> eval fm.ui.console.delete_word()
cmap <A-d> eval fm.ui.console.delete_word(backward=False)
cmap <C-k> eval fm.ui.console.delete_rest(1)
cmap <C-u> eval fm.ui.console.delete_rest(-1)
cmap <C-y> eval fm.ui.console.paste()
# And of course the emacs way
#copycmap <up> <C-p>
#copycmap <down> <C-n>
#copycmap <left> <C-b>
#copycmap <right> <C-f>
#copycmap <home> <C-a>
#copycmap <end> <C-e>
#copycmap <delete> <C-d>
#copycmap <backspace> <C-h>
# Note: There are multiple ways to express backspaces. <backspace> (code 263)
# and <backspace2> (code 127). To be sure, use both.
copycmap <backspace> <backspace2>
# This special expression allows typing in numerals:
cmap <allow_quantifiers> false
###PAGER KEYS###
# Movement
pmap <down> pager_move down=1
pmap <up> pager_move up=1
pmap <left> pager_move left=4
pmap <right> pager_move right=4
pmap <home> pager_move to=0
pmap <end> pager_move to=-1
pmap <pagedown> pager_move down=1.0 pages=True
pmap <pageup> pager_move up=1.0 pages=True
pmap <C-d> pager_move down=0.5 pages=True
pmap <C-u> pager_move up=0.5 pages=True
copypmap <UP> k <C-p>
copypmap <DOWN> j <C-n> <CR>
copypmap <LEFT> h
copypmap <RIGHT> l
copypmap <HOME> g
copypmap <END> G
copypmap <C-d> d
copypmap <C-u> u
copypmap <PAGEDOWN> n f <C-F> <Space>
copypmap <PAGEUP> p b <C-B>
# Basic
#pmap <C-l> redraw_window
pmap <ESC> pager_close
copypmap <ESC> q Q i <F3>
pmap E edit_file
# ===================================================================
# == Taskview Keybindings
# ===================================================================
# Movement
tmap <up> taskview_move up=1
tmap <down> taskview_move down=1
tmap <home> taskview_move to=0
tmap <end> taskview_move to=-1
tmap <pagedown> taskview_move down=1.0 pages=True
tmap <pageup> taskview_move up=1.0 pages=True
tmap <C-d> taskview_move down=0.5 pages=True
tmap <C-u> taskview_move up=0.5 pages=True
copytmap <UP> k <C-p>
copytmap <DOWN> j <C-n> <CR>
copytmap <HOME> g
copytmap <END> G
copytmap <C-u> u
copytmap <PAGEDOWN> n f <C-F> <Space>
copytmap <PAGEUP> p b <C-B>
# Changing priority and deleting tasks
tmap J eval -q fm.ui.taskview.task_move(-1)
tmap K eval -q fm.ui.taskview.task_move(0)
tmap dd eval -q fm.ui.taskview.task_remove()
tmap <pagedown> eval -q fm.ui.taskview.task_move(-1)
tmap <pageup> eval -q fm.ui.taskview.task_move(0)
tmap <delete> eval -q fm.ui.taskview.task_remove()
# Basic
#tmap <C-l> redraw_window
tmap <ESC> taskview_close
copytmap <ESC> q Q w <C-c>
map sp console shell bash speedvid.sh %f%space
map x shell chmod -x %s
#General
map V console shell vim%space
map cW bulkrename %s
map mkd console mkdir%space
map sc console shell ln -sT%space
map D console delete
map X shell atool -x %f
map Z shell tar -cvzf %f.tar.gz %s
map <C-f> fzf_select
map <C-l> fzf_locate
#Document Manipulation
map p1s shell lpr -o sides=one-sided %f
map p2s shell lpr -o sides=two-sided-long-edge %f
map MP shell pandoc %f -o %f.pdf
map MX shell xelatex %f
map ML shell latex %f
map TC shell texclear
map Txa console shell cp ~/Documents/LaTeX/article.tex%space
map Txs console shell cp ~/Documents/LaTeX/beamer.tex%space
map Txh console shell cp ~/Documents/LaTeX/handout.tex%space
#Image commands
map bg shell setbg %f
map bw shell wal -i %f && setbg %f
map C shell killall w3mimgdisplay && convert -rotate 90 %s %s
map F shell killall w3mimgdisplay && convert -flop %s %s
map bl shell killall w3mimgdisplay && convert %s -resize 1440x1080\> bl_%s
map TR shell convert %s -transparent white %s
#Music (mpd) shortcuts
map MS shell mpd
map MK shell killall mpd
map Ma shell mpc add "%s"
map Ms shell mpc play
map Mp shell mpc toggle
map Mn shell mpc next
map Mb shell mpc prev
map MN shell mpc stop && mpc clear && mpc add "%s"
map Mo shell mpc seek 0%
#Audio tagging (Requires eyeD3)
map Ta eval fm.open_console('shell eyeD3 -a ' + fm.thisfile.relative_path, position=15)
#Artist
map TA eval fm.open_console('shell eyeD3 -A ' + fm.thisfile.relative_path, position=15)
#Album
map Tb eval fm.open_console('shell eyeD3 -b ' + fm.thisfile.relative_path, position=15)
#Album artist
map Tt eval fm.open_console('shell eyeD3 -t "" ' + fm.thisfile.relative_path, position=16)
map Tn eval fm.open_console('shell eyeD3 -n "" ' + fm.thisfile.relative_path, position=16)
#Downloading
map ytv console shell youtube-dl -ic%space
map yta console shell youtube-dl -xic%space
eval cmd('source ' + fm.confpath('shortcuts.conf'))

View file

@ -1,236 +0,0 @@
# vim: ft=cfg
#
# This is the configuration file of "rifle", ranger's file executor/opener.
# Each line consists of conditions and a command. For each line the conditions
# are checked and if they are met, the respective command is run.
#
# Syntax:
# <condition1> , <condition2> , ... = command
#
# The command can contain these environment variables:
# $1-$9 | The n-th selected file
# $@ | All selected files
#
# If you use the special command "ask", rifle will ask you what program to run.
#
# Prefixing a condition with "!" will negate its result.
# These conditions are currently supported:
# match <regexp> | The regexp matches $1
# ext <regexp> | The regexp matches the extension of $1
# mime <regexp> | The regexp matches the mime type of $1
# name <regexp> | The regexp matches the basename of $1
# path <regexp> | The regexp matches the absolute path of $1
# has <program> | The program is installed (i.e. located in $PATH)
# env <variable> | The environment variable "variable" is non-empty
# file | $1 is a file
# directory | $1 is a directory
# number <n> | change the number of this command to n
# terminal | stdin, stderr and stdout are connected to a terminal
# X | $DISPLAY is not empty (i.e. Xorg runs)
#
# There are also pseudo-conditions which have a "side effect":
# flag <flags> | Change how the program is run. See below.
# label <label> | Assign a label or name to the command so it can
# | be started with :open_with <label> in ranger
# | or `rifle -p <label>` in the standalone executable.
# else | Always true.
#
# Flags are single characters which slightly transform the command:
# f | Fork the program, make it run in the background.
# | New command = setsid -f $command >& /dev/null
# r | Execute the command with root permissions
# | New command = sudo $command
# t | Run the program in a new terminal. If $TERMCMD is not defined,
# | rifle will attempt to extract it from $TERM.
# | New command = $TERMCMD -e $command
# Note: The "New command" serves only as an illustration, the exact
# implementation may differ.
# Note: When using rifle in ranger, there is an additional flag "c" for
# only running the current file even if you have marked multiple files.
#-------------------------------------------
# Websites
#-------------------------------------------
# Rarely installed browsers get higher priority; It is assumed that if you
# install a rare browser, you probably use it. Firefox/konqueror/w3m on the
# other hand are often only installed as fallback browsers.
ext x?html?, has waterfox, X, flag f = waterfox -- "$@"
ext x?html?, has surf, X, flag f = surf -- file://"$1"
ext x?html?, has vimprobable, X, flag f = vimprobable -- "$@"
ext x?html?, has vimprobable2, X, flag f = vimprobable2 -- "$@"
ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@"
ext x?html?, has dwb, X, flag f = dwb -- "$@"
ext x?html?, has jumanji, X, flag f = jumanji -- "$@"
ext x?html?, has luakit, X, flag f = luakit -- "$@"
ext x?html?, has uzbl, X, flag f = uzbl -- "$@"
ext x?html?, has uzbl-tabbed, X, flag f = uzbl-tabbed -- "$@"
ext x?html?, has uzbl-browser, X, flag f = uzbl-browser -- "$@"
ext x?html?, has uzbl-core, X, flag f = uzbl-core -- "$@"
ext x?html?, has midori, X, flag f = midori -- "$@"
ext x?html?, has chromium, X, flag f = chromium -- "$@"
ext x?html?, has opera, X, flag f = opera -- "$@"
ext x?html?, has firefox, X, flag f = firefox -- "$@"
ext x?html?, has dillo, X, flag f = dillo -- "$@"
ext x?html?, has seamonkey, X, flag f = seamonkey -- "$@"
ext x?html?, has iceweasel, X, flag f = iceweasel -- "$@"
ext x?html?, has epiphany, X, flag f = epiphany -- "$@"
ext x?html?, has konqueror, X, flag f = konqueror -- "$@"
ext x?html?, has elinks, terminal = elinks "$@"
ext x?html?, has links2, terminal = links2 "$@"
ext x?html?, has links, terminal = links "$@"
ext x?html?, has lynx, terminal = lynx -- "$@"
ext x?html?, has w3m, terminal = w3m "$@"
#Spreadsheets for scim
ext sc|csv|sxc|xlsx?|xlt|xlw|gnm|gnumeric, = sc-im -- "$@"
#-------------------------------------------
# Misc
#-------------------------------------------
# Define the "editor" for text files as first action
mime ^text, label editor = $EDITOR -- "$@"
mime ^text, label pager = "$PAGER" -- "$@"
!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = $EDITOR -- "$@"
!mime ^text, label pager, ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
ext 1 = man "$1"
ext s[wmf]c, has zsnes, X = zsnes "$1"
ext s[wmf]c, has snes9x-gtk,X = snes9x-gtk "$1"
ext nes, has fceux, X = fceux "$1"
ext exe = wine "$1"
name ^[mM]akefile$ = make
ext asf, has mpv, X, flag f = mpv -- "$@"
#--------------------------------------------
# Code
#-------------------------------------------
ext py = python -- "$1"
ext pl = perl -- "$1"
ext rb = ruby -- "$1"
ext js = node -- "$1"
ext sh = sh -- "$1"
ext php = php -- "$1"
#--------------------------------------------
# Video/Audio with a GUI
#-------------------------------------------
mime ^video|audio, has gmplayer, X, flag f = gmplayer -- "$@"
mime ^video|audio, has smplayer, X, flag f = smplayer "$@"
mime ^video, has mpv, X, flag f = mpv -- "$@"
mime ^video, has mpv, X, flag f = mpv --no-video -- "$@"
mime ^video, has mpv, X, flag f = mpv --fs -- "$@"
mime ^video, has mpv, X, flag f = mpv --loop -- "$@"
mime ^video, has mpv, X, flag f = mpv --title="obs" --autofit=1050x700 -- "$@"
mime ^video, has mplayer2, X, flag f = mplayer2 -- "$@"
mime ^video, has mplayer2, X, flag f = mplayer2 -fs -- "$@"
mime ^video, has mplayer, X, flag f = mplayer -- "$@"
mime ^video, has mplayer, X, flag f = mplayer -fs -- "$@"
# mime ^video|audio, has vlc, X, flag f = vlc -- "$@"
mime ^video|audio, has totem, X, flag f = totem -- "$@"
mime ^video|audio, has totem, X, flag f = totem --fullscreen -- "$@"
#--------------------------------------------
# Audio without X
#-------------------------------------------
mime ^audio|ogg$, terminal, has mplayer = mplayer -- "$@"
mime ^audio|ogg$, terminal, has mplayer2 = mplayer2 -- "$@"
mime ^audio|ogg$, terminal, has mpv = mpv --no-audio-display -- "$@"
mime ^audio|ogg$ = tag "$@"
mime ^audio|ogg$, terminal, has mpv = mpv -- "$@"
ext midi?, terminal, has wildmidi = wildmidi -- "$@"
#--------------------------------------------
# Video without X:
#-------------------------------------------
mime ^video, terminal, !X, has mpv = mpv -- "$@"
mime ^video, terminal, !X, has mplayer2 = mplayer2 -- "$@"
mime ^video, terminal, !X, has mplayer = mplayer -- "$@"
#-------------------------------------------
# Documents
#-------------------------------------------
ext pdf, has llpp, X, flag f = llpp "$@"
ext pdf, has zathura, X, flag f = zathura -- "$@"
ext pdf, has mupdf, X, flag f = mupdf "$@"
ext pdf, has mupdf, X, flag f = mupdf -I "$@"
ext pdf, has mupdf-x11,X, flag f = mupdf-x11 "$@"
ext pdf, has apvlv, X, flag f = apvlv -- "$@"
ext pdf, has xpdf, X, flag f = xpdf -- "$@"
ext pdf, has evince, X, flag f = evince -- "$@"
ext pdf, has atril, X, flag f = atril -- "$@"
ext pdf, has okular, X, flag f = okular -- "$@"
ext pdf, has epdfview, X, flag f = epdfview -- "$@"
ext pdf, has qpdfview, X, flag f = qpdfview "$@"
ext epub, has zathura, X, flag f = zathura -- "$@"
ext epub, has mupdf, X, flag f = mupdf "$@"
ext ps, has zathura, X, flag f = zathura -- "$@"
ext docx, has abiword, X, flag f = abiword "$@"
ext docx?, has catdoc, terminal = catdoc -- "$@" | "$PAGER"
ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has gnumeric, X, flag f = gnumeric -- "$@"
ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has kspread, X, flag f = kspread -- "$@"
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has libreoffice, X, flag f = libreoffice "$@"
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has soffice, X, flag f = soffice "$@"
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has ooffice, X, flag f = ooffice "$@"
ext djvu, has zathura,X, flag f = zathura -- "$@"
ext djvu, has evince, X, flag f = evince -- "$@"
ext djvu, has atril, X, flag f = atril -- "$@"
#-------------------------------------------
# Image Viewing:
#-------------------------------------------
mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@"
mime ^image/svg, has display, X, flag f = display -- "$@"
mime ^image/gif, has viewnior, X, flag f = viewnior -- "$@"
mime ^image/gif, has qutebrowser, X, flag f = qutebrowser -- "$@"
ext xcf, X, flag f = gimp -- "$@"
mime ^image, has sxiv, X, flag f = sxiv -a -- "$@"
mime ^image, has feh, X, flag f = feh --scale-down --auto-zoom --image-bg black -- "$@"
mime ^image, has feh, X, flag f = feh --scale-down --auto-zoom -- "$@"
mime ^image, has mirage, X, flag f = mirage -- "$@"
mime ^image, has ristretto, X, flag f = ristretto "$@"
mime ^image, has eog, X, flag f = eog -- "$@"
mime ^image, has eom, X, flag f = eom -- "$@"
mime ^image, has gimp, X, flag f = gimp -- "$@"
mime ^image, has pinta, X, flag f = pinta -- "$@"
mime ^image, has mypaint, X, flag f = mypaint -- "$@"
mime ^image, has kolourpaint, X, flag f = kolourpaint -- "$@"
#-------------------------------------------
# Archives
#-------------------------------------------
# This requires atool
ext jar = java -jar "$@"
ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has als = als -- "$@" | "$PAGER"
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has als = als -- "$@" | "$PAGER"
ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has aunpack = aunpack -- "$@"
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has aunpack = aunpack -- "$@"
# Fallback:
ext tar|gz, has tar = tar vvtf "$@" | "$PAGER"
ext tar|gz, has tar = tar vvxf "$@"
#-------------------------------------------
# Misc
#-------------------------------------------
label wallpaper, number 11, mime ^image, has feh, X = feh --bg-scale "$1"
label wallpaper, number 12, mime ^image, has feh, X = feh --bg-tile "$1"
label wallpaper, number 13, mime ^image, has feh, X = feh --bg-center "$1"
label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1"
# Define the editor for non-text files + pager as last action
!mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php|ms = ask
label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php|ms = $EDITOR -- "$@"
label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php|ms = "$PAGER" -- "$@"
ext blend, has blender, X, flag f = blender -- "$@"
ext ms = $EDITOR -- "$@"

View file

@ -1,120 +0,0 @@
#!/usr/bin/env bash
# ranger supports enhanced previews. If the option "use_preview_script"
# is set to True and this file exists, this script will be called and its
# output is displayed in ranger. ANSI color codes are supported.
# NOTES: This script is considered a configuration file. If you upgrade
# ranger, it will be left untouched. (You must update it yourself.)
# Also, ranger disables STDIN here, so interactive scripts won't work properly
# Meanings of exit codes:
# code | meaning | action of ranger
# -----+------------+-------------------------------------------
# 0 | success | success. display stdout as preview
# 1 | no preview | failure. display no preview at all
# 2 | plain text | display the plain content of the file
# 3 | fix width | success. Don't reload when width changes
# 4 | fix height | success. Don't reload when height changes
# 5 | fix both | success. Don't ever reload
# 6 | image | success. display the image $cached points to as an image preview
# 7 | image | success. display the file directly as an image
# Meaningful aliases for arguments:
path="$1" # Full path of the selected file
width="$2" # Width of the preview pane (number of fitting characters)
height="$3" # Height of the preview pane (number of fitting characters)
cached="$4" # Path that should be used to cache image previews
preview_images="$5" # "True" if image previews are enabled, "False" otherwise.
maxln=200 # Stop after $maxln lines. Can be used like ls | head -n $maxln
# Find out something about the file:
mimetype=$(file --mime-type -Lb "$path")
extension=$(/bin/echo "${path##*.}" | awk '{print tolower($0)}')
# Functions:
# runs a command and saves its output into $output. Useful if you need
# the return value AND want to use the output in a pipe
try() { output=$(eval '"$@"'); }
# writes the output of the previously used "try" command
dump() { /bin/echo "$output"; }
# a common post-processing function used after most commands
trim() { head -n "$maxln"; }
# wraps highlight to treat exit code 141 (killed by SIGPIPE) as success
safepipe() { "$@"; test $? = 0 -o $? = 141; }
# Image previews, if enabled in ranger.
if [ "$preview_images" = "True" ]; then
case "$mimetype" in
image/svg+xml)
convert "$path" "$cached" && exit 6 || exit 1;;
image/*)
exit 7;;
# Image preview for video, disabled by default.:
###video/*)
### ffmpegthumbnailer -i "$path" -o "$cached" -s 0 && exit 6 || exit 1;;
esac
fi
case "$extension" in
# Archive extensions:
a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\
rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)
try als "$path" && { dump | trim; exit 0; }
try acat "$path" && { dump | trim; exit 3; }
try bsdtar -lf "$path" && { dump | trim; exit 0; }
exit 1;;
csv)
sed "s/\(.*\".*\),\(.*\".*\)/\1~\2/;s/,/\t/g;s/~/,/g;s/\t\"/\t/g;s/\"\t/\t/g" "$path" && { dump| trim; exit 0; } || exit 1;;
rar)
# avoid password prompt by providing empty password
try unrar -p- lt "$path" && { dump | trim; exit 0; } || exit 1;;
7z)
# avoid password prompt by providing empty password
try 7z -p l "$path" && { dump | trim; exit 0; } || exit 1;;
# PDF documents:
pdf)
try pdftoppm -jpeg -singlefile "$path" "${cached//.jpg}" && exit 6 || exit 1;;
#try pdftotext -l 10 -nopgbrk -q "$path" - && \
#{ dump | trim | fmt -s -w $width; exit 0; } || exit 1;;
# BitTorrent Files
torrent)
try transmission-show "$path" && { dump | trim; exit 5; } || exit 1;;
# ODT Files
odt|ods|odp|sxw)
try odt2txt "$path" && { dump | trim; exit 5; } || exit 1;;
# HTML Pages:
htm|html|xhtml)
try w3m -dump "$path" && { dump | trim | fmt -s -w "$width"; exit 4; }
try lynx -dump "$path" && { dump | trim | fmt -s -w "$width"; exit 4; }
try elinks -dump "$path" && { dump | trim | fmt -s -w "$width"; exit 4; }
;; # fall back to highlight/cat if the text browsers fail
esac
case "$mimetype" in
# Syntax highlight for text files:
text/* | */xml)
if [ "$(tput colors)" -ge 256 ]; then
pygmentize_format=terminal256
highlight_format=ansi
else
pygmentize_format=terminal
highlight_format=ansi
fi
try safepipe highlight --out-format=${highlight_format} "$path" && { dump | trim; exit 5; }
try safepipe pygmentize -f ${pygmentize_format} "$path" && { dump | trim; exit 5; }
exit 2;;
# Ascii-previews of images:
image/*)
img2txt --gamma=0.6 --width="$width" "$path" && exit 4 || exit 1;;
# Display information about media files:
video/* | audio/*)
exiftool "$path" && exit 5
# Use sed to remove spaces so the output fits into the narrow window
try mediainfo "$path" && { dump | trim | sed 's/ \+:/: /;'; exit 5; } || exit 1;;
esac
exit 1

23
.config/shell/files Normal file
View file

@ -0,0 +1,23 @@
# These files automatically update when edited/saved in vim:
# keys filename description
bf ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-files # This file, a list of bookmarked files
bd ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs # A list of bookmarked directories similar to this file
cfx ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources # Colors, themes and variables for X11
cfb ~/.local/src/dwmblocks/config.h # dwmblocks: the status bar for dwm
# These do not update automatically, but on the next new instance of a program:
cfv ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/init.vim # vim/neovim config
cfz $ZDOTDIR/.zshrc # zsh (shell) config
cfa ${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc # aliases used by zsh (and potentially other shells)
cfp ${XDG_CONFIG_HOME:-$HOME/.config}/shell/profile # profile file for login settings for zsh
cfm ${XDG_CONFIG_HOME:-$HOME/.config}/mutt/muttrc # mutt (email client) config
cfn ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/config # newsboat (RSS reader)
cfu ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/urls # RSS urls for newsboat
cfmb ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/bindings # ncmpcpp (music player) keybinds file
cfmc ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/config # ncmpcpp (music player) config
cfl ${XDG_CONFIG_HOME:-$HOME/.config}/lf/lfrc # lf (file browser) config
cfL ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope # lf's scope/preview file
cfX ${XDG_CONFIG_HOME:-$HOME/.config}/sxiv/exec/key-handler # sxiv (image viewer) key/script handler

19
.config/shell/inputrc Normal file
View file

@ -0,0 +1,19 @@
$include /etc/inputrc
set editing-mode vi
$if mode=vi
set show-mode-in-prompt on
set vi-ins-mode-string \1\e[6 q\2
set vi-cmd-mode-string \1\e[2 q\2
set keymap vi-command
# these are for vi-command mode
Control-l: clear-screen
Control-a: beginning-of-line
set keymap vi-insert
# these are for vi-insert mode
Control-l: clear-screen
Control-a: beginning-of-line
$endif

145
.config/shell/profile Normal file
View file

@ -0,0 +1,145 @@
#!/bin/zsh
# profile file. Runs on login. Environmental variables are set here.
# If you don't plan on reverting to bash, you can remove the link in ~/.profile
# to clean up.
# Adds `~/.local/bin` to $PATH
export PATH="$PATH:$(du "$HOME/.local/bin" | cut -f2 | paste -sd ':')"
# Default programs:
export EDITOR="nvim"
export TERMINAL="st"
export BROWSER="brave"
export READER="zathura"
# ~/ Clean-up:
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"
#export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # This line will break some DMs.
export NOTMUCH_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/notmuch-config"
export GTK2_RC_FILES="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-2.0/gtkrc-2.0"
export LESSHISTFILE="-"
export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc"
export INPUTRC="${XDG_CONFIG_HOME:-$HOME/.config}/shell/inputrc"
export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh"
#export GNUPGHOME="$XDG_DATA_HOME/gnupg"
export WINEPREFIX="${XDG_DATA_HOME:-$HOME/.local/share}/wineprefixes/default"
export KODI_DATA="${XDG_DATA_HOME:-$HOME/.local/share}/kodi"
export PASSWORD_STORE_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/password-store"
export TMUX_TMPDIR="$XDG_RUNTIME_DIR"
export ANDROID_SDK_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/android"
export CARGO_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/cargo"
export GOPATH="${XDG_DATA_HOME:-$HOME/.local/share}/go"
export ANSIBLE_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/ansible/ansible.cfg"
export UNISON="${XDG_DATA_HOME:-$HOME/.local/share}/unison"
export HISTFILE="${XDG_DATA_HOME:-$HOME/.local/share}/history"
export WEECHAT_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/weechat"
# Other program settings:
export DICS="/usr/share/stardict/dic/"
export SUDO_ASKPASS="$HOME/.local/bin/dmenupass"
export FZF_DEFAULT_OPTS="--layout=reverse --height 40%"
export LESS=-R
export LESS_TERMCAP_mb="$(printf '%b' '')"
export LESS_TERMCAP_md="$(printf '%b' '')"
export LESS_TERMCAP_me="$(printf '%b' '')"
export LESS_TERMCAP_so="$(printf '%b' '')"
export LESS_TERMCAP_se="$(printf '%b' '')"
export LESS_TERMCAP_us="$(printf '%b' '')"
export LESS_TERMCAP_ue="$(printf '%b' '')"
export LESSOPEN="| /usr/bin/highlight -O ansi %s 2>/dev/null"
export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme.
export MOZ_USE_XINPUT2="1" # Mozilla smooth scrolling/touchpads.
export AWT_TOOLKIT="MToolkit wmname LG3D" #May have to install wmname
export _JAVA_AWT_WM_NONREPARENTING=1 # Fix for Java applications in dwm
# This is the list for lf icons:
export LF_ICONS="di=📁:\
fi=📃:\
tw=🤝:\
ow=📂:\
ln=⛓:\
or=❌:\
ex=🎯:\
*.txt=✍:\
*.mom=✍:\
*.me=✍:\
*.ms=✍:\
*.png=🖼:\
*.webp=🖼:\
*.ico=🖼:\
*.jpg=📸:\
*.jpe=📸:\
*.jpeg=📸:\
*.gif=🖼:\
*.svg=🗺:\
*.tif=🖼:\
*.tiff=🖼:\
*.xcf=🖌:\
*.html=🌎:\
*.xml=📰:\
*.gpg=🔒:\
*.css=🎨:\
*.pdf=📚:\
*.djvu=📚:\
*.epub=📚:\
*.csv=📓:\
*.xlsx=📓:\
*.tex=📜:\
*.md=📘:\
*.r=📊:\
*.R=📊:\
*.rmd=📊:\
*.Rmd=📊:\
*.m=📊:\
*.mp3=🎵:\
*.opus=🎵:\
*.ogg=🎵:\
*.m4a=🎵:\
*.flac=🎼:\
*.mkv=🎥:\
*.mp4=🎥:\
*.webm=🎥:\
*.mpeg=🎥:\
*.avi=🎥:\
*.zip=📦:\
*.rar=📦:\
*.7z=📦:\
*.tar.gz=📦:\
*.z64=🎮:\
*.v64=🎮:\
*.n64=🎮:\
*.gba=🎮:\
*.nes=🎮:\
*.gdi=🎮:\
*.1=:\
*.nfo=:\
*.info=:\
*.log=📙:\
*.iso=📀:\
*.img=📀:\
*.bib=🎓:\
*.ged=👪:\
*.part=💔:\
*.torrent=🔽:\
*.jar=♨:\
*.java=♨:\
"
[ ! -f ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ] && shortcuts >/dev/null 2>&1 &
if pacman -Qs libxft-bgra >/dev/null 2>&1; then
# Start graphical server on user's current tty if not already running.
[ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startx
else
echo "\033[31mIMPORTANT\033[0m: Note that \033[32m\`libxft-bgra\`\033[0m must be installed for this build of dwm.
Please run:
\033[32myay -S libxft-bgra-git\033[0m
and replace \`libxft\`. Afterwards, you may start the graphical server by running \`startx\`."
fi
# Switch escape and caps if tty and no passwd required:
sudo -n loadkeys ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/ttymaps.kmap 2>/dev/null

View file

@ -1,270 +0,0 @@
# The Simple X Hotkey Daemon is the program used by LARBS to map most of the
# dwm-independent commands. This file is pretty readable, so I'll let you read
# it.
# The keys NOT bound here by sxhkd, but by dwm or i3 are:
# The t thru p keys on the top row
# The f thru ; keys on the home row
# The b key on the bottom row (hides the bar in either case)
# Basic binds
super + Return
$TERMINAL
super + d
dmenu_run
super + r
$TERMINAL -e $FILE
super + e
$TERMINAL -e neomutt; pkill -RTMIN+12 blocks
super + m
$TERMINAL -e ncmpcpp
super + n
$TERMINAL -e newsboat
super + c
$TERMINAL -e calcurse
super + v
$TERMINAL -e nvim -c VimwikiIndex
super + shift + a
$TERMINAL -e pulsemixer
super + shift + c
camtoggle
super + shift + e
tutorialvids
super + w
$TERMINAL -e sudo nmtui
super + shift + w
$BROWSER
# Et cetera...
super + grave
dmenuunicode
super + Scroll_Lock
killall screenkey || screenkey
super + Insert
showclip
super + shift + x
prompt "Shutdown computer?" "sudo -A shutdown -h now"
super + shift + BackSpace
prompt "Reboot computer?" "sudo -A reboot"
super + shift + Escape
prompt 'Leave Xorg?' 'killall Xorg'
super + x
ifinstalled slock && ( slock & xset dpms force off ; mpc pause ; pauseallmpv )
XF86Launch1
xset dpms force off
XF86TouchpadToggle
(synclient | grep "TouchpadOff.*1" && synclient TouchpadOff=0) || synclient TouchpadOff=1
XF86Touchpad{Off,On}
synclient TouchpadOff={1,0}
XF86MonBrightnessDown
xbacklight -dec 15
XF86MonBrightnessUp
xbacklight -inc 15
# Recording
# Take screenshot
Print
maim pic-full-$(date '+%y%m%d-%H%M-%S').png
# Pick screenshot type
shift + Print
maimpick
# Print: Record audio or video; Del: kill recording
super + Print
dmenurecord
super + Delete
dmenurecord kill
# Pause audio
super + p
mpc toggle
super + shift + p
mpc pause; pauseallmpv
# Changes to next/previous tracks
super + {comma,period}
mpc {prev,next}
# Restart track
super + shift + less
mpc seek 0%
# Seek foward in song
super + {_,shift +} bracketright
mpc seek +{10,120}
# Seek backward in song
super + {_,shift +} bracketleft
mpc seek -{10,120}
# Increase volume
super + {equal,plus}
amixer sset Master {5,15}%+; pkill -RTMIN+10 blocks
# Decrease volume
super {_,shift +} + minus
amixer sset Master {5,15}%-; pkill -RTMIN+10 blocks
super + shift + m
amixer sset Master toggle; pkill -RTMIN+10 blocks
# Audiokeys
XF86AudioMute
amixer sset Master toggle; pkill -RTMIN+10 blocks
XF86Audio{Raise,Lower}Volume
amixer sset Master 5%{+,-}; pkill -RTMIN+10 blocks
XF86Audio{Next,Prev}
mpc {next,prev}
XF86Audio{Pause,Play,Stop}
mpc {pause,play,stop}
XF86Audio{Rewind,Forward}
mpc seek {-,+}10
XF86AudioRecord
dmenurecord
XF86AudioMedia
$TERMINAL -e ncmpcpp
XF86PowerOff
prompt "Shutdown computer?" "sudo -A shutdown -h now"
XF86Calculator
$TERMINAL -e bc
XF86Sleep
prompt 'Hibernate computer?' 'sudo -A zzz'
XF86WWW
$BROWSER
XF86DOS
$TERMINAL
XF86ScreenSaver
mpc pause; pauseallmpv; i3lock -e -f -c 1d2021; xset dpms force off
XF86TaskPane
$TERMINAL -e htop
XF86Mail
$TERMINAL -e neomutt
XF86MyComputer
$TERMINAL -e $FILE /
# Function keys
super + shift + F1
grep LARBSWELCOME ~/.xprofile && ( sed -i "/LARBSWELCOME/d" ~/.xprofile && notify-send "LARBS welcome message" "Welcome message disabled. Press Super+Shift+F1 again to reverse." ) || ( echo "notify-send -i "${XDG_DATA_HOME:-$HOME/.local/share}/larbs/larbs.png" \"Welcome to LARBS\" \"Press super+F1 for the help menu.\" # LARBSWELCOME" >> ~/.xprofile && notify-send "LARBS welcome message" "Welcome message re-enabled." )
# Show readme
super + F1
groff -mom ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/readme.mom -Tpdf | zathura -
# F2 restarts either dwm or i3 and is bound in each.
# Change display
super + F3
displayselect
# Hibernate
super + F4
prompt 'Hibernate computer?' 'sudo -A zzz -Z'
super + F5 is unbound.
# Start torrent daemon/open interface
super + F6
torwrap
# toggle torrent daemon
super + F7
td-toggle
# sync email
super + F8
mw sync
# Mount a USB drive or Android device
super + {F9,F10}
{dmenumount,dmenuumount}
# close and kill
super + {_,shift + }q
bspc node -{c,k}
# alternate between the tiled and monocle layout
super + {_,shift + }f
bspc {desktop -l next,node -t ~fullscreen}
# rotate current node 90 degrees
super + y
bspc node @focused:/ -R 90
# swap the current node and the biggest local node
super + space
bspc node -s biggest.local || bspc node -s next.local
#
# state/flags
#
# set the window state
#super + {t,shift + t,s}
#bspc node -t {tiled,pseudo_tiled,floating}
super + shift + space
bspc node focused -t \~floating
# focus/swap
# focus the node in the given direction
super + {_,shift + }{h,j,k,l}
bspc node -{f,s} {west,south,north,east}
# focus the node for the given path jump
super + {p,b,comma,period}
bspc node -f @{parent,brother,first,second}
super + {g,semicolon}
bspc desktop {prev,next}.occupied --focus
super + {Prior,Next}
bspc desktop {prev,next}.occupied --focus
super + {Tab,backslash}
bspc desktop last --focus
# focus or swap the next node
super + {_,shift + }c
bspc node -{f,s} next.local
# focus the older or newer node in the focus history
# focus or send to the given desktop
super + {_,shift + }{1-9,0}
bspc {desktop -f,node -d} ^{1-9,10}
# preselect the direction
#super + {u,o}
#bspc node -p {south,east}
# preselect the ratio
super + ctrl + {1-9}
bspc node -o 0.{1-9}
# cancel the preselection for the focused node
super + ctrl + space
bspc node -p cancel
# cancel the preselection for the focused desktop
#super + space
#bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
# expand a window by moving one of its side outward
super + shift + {y,u,i,o}
bspc node -z {right -20 0,bottom 0 20,bottom 0 -20,right 20 0}
# contract a window by moving one of its side inward
# move a floating window
super + {Left,Down,Up,Right}
bspc node -v {-20 0,0 20,0 -20,20 0}
# Toggle gaps
super + shift + d
bspc config window_gap {0,15}
# Increase/descrease gap size
super { ,+ shift }+ z
bspc config window_gap $(($(bspc config window_gap) {+,-} 3))
super + u
cat /tmp/dropdown | xargs -I win bspc node win --flag hidden;bspc node -f win
# Make a windoww sticky/non-sticky
super + o
bspc node -g sticky={on,off}
# remove and restore polybar
#super + b
#\{ pgrep polybar && \{ killall polybar ; bspc config top_padding 0 \} \} || \{ launch_polybar ; bspc config top_padding 24 \}
super + {i,o}
bspc node -f {prev,next}.local
super + shift + n
bspc node focused -t \~floating ; hover right
super + shift + b
bspc node focused -t \~floating ; hover left

View file

@ -1,33 +0,0 @@
highlight clear
highlight Win cterm=none ctermfg=white ctermbg=black
highlight Directory cterm=bold ctermfg=cyan ctermbg=default
highlight Link cterm=bold ctermfg=blue ctermbg=default
highlight BrokenLink cterm=bold ctermfg=red ctermbg=default
highlight Socket cterm=bold ctermfg=magenta ctermbg=default
highlight Device cterm=bold ctermfg=red ctermbg=default
highlight Fifo cterm=bold ctermfg=cyan ctermbg=default
highlight Executable cterm=bold ctermfg=green ctermbg=default
highlight Selected cterm=bold ctermfg=magenta ctermbg=default
highlight CurrLine cterm=bold,reverse ctermfg=default ctermbg=default
highlight TopLine cterm=none ctermfg=black ctermbg=white
highlight TopLineSel cterm=bold ctermfg=black ctermbg=default
highlight StatusLine cterm=bold ctermfg=black ctermbg=blue
highlight WildMenu cterm=underline,reverse ctermfg=white ctermbg=black
highlight CmdLine cterm=none ctermfg=white ctermbg=black
highlight ErrorMsg cterm=none ctermfg=red ctermbg=black
highlight Border cterm=none ctermfg=white ctermbg=black
highlight JobLine cterm=bold,reverse ctermfg=black ctermbg=white
highlight SuggestBox cterm=bold ctermfg=default ctermbg=default
highlight CmpMismatch cterm=bold ctermfg=white ctermbg=red
highlight AuxWin cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight TabLine cterm=none ctermfg=white ctermbg=black
highlight TabLineSel cterm=bold,reverse ctermfg=default ctermbg=default
highlight User1 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User2 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User3 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User4 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User5 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User6 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User7 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User8 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User9 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default

View file

@ -1,78 +0,0 @@
" vim: filetype=vifm
source ${XDG_CONFIG_HOME:-$HOME/.config}/vifm/vifmshortcuts
set vicmd=$EDITOR
set syscalls
set nofollowlinks
set sortnumbers
set undolevels=100
set wildmenu
set wildstyle=popup
set scrolloff=4
set ignorecase
set smartcase
set nohlsearch
set incsearch
set suggestoptions=normal,visual,view,otherpane,keys,marks,registers
colorscheme luke
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
map <C-o> <C-w>o
map <C-s> <C-w>s
map <C-v> <C-w>v
map R :restart<CR>
map x :!sxiv -ft * 2>/dev/null &<CR>
nnoremap o :file &<cr>
map E :!$EDITOR %f<CR>
map mkd :mkdir<space>
map bg :!setbg %f &<CR>
map X :!ext %f &<CR>
nnoremap s :shell<cr>
nnoremap w :view<cr>
vnoremap w :view<cr>gv
nnoremap yd :!echo %d | xclip %i<cr>
nnoremap yf :!echo %c:p | xclip %i<cr>
nnoremap I cw<c-a>
nnoremap cc cw<c-u>
nnoremap A cw
nnoremap ,w :set wrap!<cr>
nmap <space> tj
nmap q ZQ
fileview */ tree %c -L 1 --dirsfirst
fileview ../ tree %c -L 1 --dirsfirst
fileviewer *.html w3m -dump %c
filextype *.html,*.htm firefox %f 2>/dev/null &
fileviewer *.docx docx2txt %c -
fileviewer *.odt odt2txt %c -
filetype *.csv,*.xlsx sc-im %c
fileviewer *.csv sed "s/,,,,/,,-,,/g;s/,,/ /g" %c | column -t | sed "s/ - / /g" | cut -c -%pw
filetype *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus mpv --no-audio-display %c
filextype *.pdf,*.ps,*.eps,*.ps.gz,*.djvu,*.epub,*.cbz,*.cbr,*.cb7 zathura %f 2>/dev/null &,
fileviewer *.pdf pdftotext -l 1 -nopgbrk %c -
fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.qt,*.divx,*.as[fx],*mp3,*.flac file
filextype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,*.as[fx] mpv %f 2>/dev/null &,
fileview *.tar.gz atool -l --format=tar %f 2>/dev/null | awk '{$1=$2=$3=$4=$5=""; print $0}'
fileview *.zip,*.cbz atool -l --format=zip %f 2>/dev/null | tail +4 | awk '{$1=$2=$3=""; print $0}'
fileview *.rar,*.cbr atool -l --format=rar %f 2>/dev/null | tail +9 | awk '{$1=$2=$3=$4=""; print $0}'
fileview *.7z,*.cb7 atool -l --format=7z %f 2>/dev/null | tail +20 | awk '{$1=$2=$3=$4=$5=""; print $0}'
filetype *.zip,*.7z,*.rar,*.tar.gz,*.tar.xz ext %f
fileviewer *.[1-8] man ./%c | col -b
filetype *.[1-8] man ./%c
fileviewer *.jpg,*.jpeg,*.png,*.ico,*.gif vifmimg draw %px %py %pw %ph %c %pc vifmimg clear
filextype *.bmp,*.jpg,*.jpeg,*.png,*.ico,*.gif,*.xpm rotdir %f 2>/dev/null | sxiv -ia 2>/dev/null &
filextype *.svg inkscape %f 2>/dev/null &
filextype *.xcf gimp %f 2>/dev/null &
set vifminfo=dhistory,chistory,tui,shistory,phistory,fhistory,dirstack,registers,bookmarks,bmarks

17
.config/x11/xinitrc Executable file
View file

@ -0,0 +1,17 @@
#!/bin/sh
# xinitrc runs automatically when you run startx.
# There are some small but important commands that need to be run when we start
# the graphical environment. There is a link to this file in ~/.xprofile
# because that file is run automatically if someone uses a display manager
# (login screen) and so they are needed there. To prevent doubling up commands,
# I source them here with the line below.
if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/x11/xprofile" ]; then
. "${XDG_CONFIG_HOME:-$HOME/.config}/x11/xprofile"
else
. "$HOME/.xprofile"
fi
ssh-agent dwm

13
.config/x11/xprofile Executable file
View file

@ -0,0 +1,13 @@
#!/bin/sh
# This file runs when a DM logs you into a graphical session.
# If you use startx/xinit like a Chad, this file will also be sourced.
mpd & # music player daemon-you might prefer it as a service though
remaps & # run the remaps script, switching caps/esc and more; check it for more info
setbg & # set the background with the `setbg` script
#xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources & # Uncomment to use Xresources colors/settings on startup
xcompmgr & # xcompmgr for transparency
dunst & # dunst for notifications
xset r rate 300 50 & # Speed xrate up
unclutter & # Remove mouse when idle

View file

@ -1,21 +0,0 @@
#!/bin/sh
# xinitrc runs automatically when you run startx.
# There are some small but important commands that need to be run when we start
# the graphical environment. I keep those commands in ~/config/xprofile because
# that file is run automatically if someone uses a display manager (login
# screen) and so they are needed there. To prevent doubling up commands, I
# source them here with the line below.
# export STATUSBAR="i3blocks" # Uncomment this line when using i3.
. ~/.xprofile
# Your default LARBS WM is determined in your `~/.profile` on login. Here we
# run the proper command to run when the graphical environment starts.
# Comment/uncomment these lines depending on what wm you want to use. Also
# check the i3blocks line above.
ssh-agent dwm
# ssh-agent i3

View file

@ -12,9 +12,9 @@ SAVEHIST=10000
HISTFILE=~/.cache/zsh/history
# Load aliases and shortcuts if existent.
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc"
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/aliasrc"
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/zshnameddirrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/zshnameddirrc"
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc"
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"
# Basic auto/tab complete:
autoload -U compinit
@ -67,7 +67,7 @@ lfcd () {
}
bindkey -s '^o' 'lfcd\n'
bindkey -s '^a' 'bc -l\n'
bindkey -s '^a' 'bc -lq\n'
bindkey -s '^f' 'cd "$(dirname "$(fzf)")"\n'

View file

@ -1,9 +1,12 @@
#!/bin/sh
bmdirs="${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs"
bmfiles="${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-files"
# Output locations. Unactivated progs should go to /dev/null.
shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc"
zsh_named_dirs="${XDG_CONFIG_HOME:-$HOME/.config}/zshnameddirrc"
ranger_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/ranger/shortcuts.conf"
shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
zsh_named_dirs="${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"
ranger_shortcuts="/dev/null"
qute_shortcuts="/dev/null"
fish_shortcuts="/dev/null"
vifm_shortcuts="/dev/null"
@ -15,7 +18,7 @@ printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts"
printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts"
# Format the `directories` file in the correct syntax and sent it to all three configs.
eval "echo \"$(cat "${XDG_CONFIG_HOME:-$HOME/.config}/directories")\"" | \
eval "echo \"$(cat "$bmdirs")\"" | \
awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
printf(\"%s=\42cd %s && ls -a\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ;
printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ;
@ -25,7 +28,7 @@ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
printf(\"map g%s cd %s\nmap t%s tab_new %s\nmap m%s shell mv -v %%s %s\nmap Y%s shell cp -rv %%s %s \n\",\$1,\$2,\$1,\$2, \$1, \$2, \$1, \$2) >> \"$ranger_shortcuts\" }"
# Format the `files` file in the correct syntax and sent it to both configs.
eval "echo \"$(cat "${XDG_CONFIG_HOME:-$HOME/.config}/files")\"" | \
eval "echo \"$(cat "$bmfiles")\"" | \
awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
printf(\"%s=\42\$EDITOR %s\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ;
printf(\"abbr %s \42\$EDITOR %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ;

View file

@ -1 +1 @@
.zprofile
.config/shell/profile

View file

@ -1 +1 @@
.config/xinitrc
.config/x11/xinitrc

View file

@ -1,17 +0,0 @@
#!/bin/sh
# This file runs when a DM logs you into a graphical session.
# If you use startx/xinit like a Chad, this file will also be sourced.
# Fix Gnome Apps Slow Start due to failing services
# Add this when you include flatpak in your system
dbus-update-activation-environment --systemd DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY
mpd & # music player daemon-you might prefer it as a service though
remaps & # run the remaps script, switching caps/esc and more; check it for more info
setbg & # set the background with the `setbg` script
#xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/Xresources & # Uncomment to use Xresources colors/settings on startup
xcompmgr & # xcompmgr for transparency
dunst & # dunst for notifications
xset r rate 300 50 & # Speed xrate up
unclutter & # Remove mouse when idle

1
.xprofile Symbolic link
View file

@ -0,0 +1 @@
.config/x11/xprofile

145
.zprofile
View file

@ -1,145 +0,0 @@
#!/bin/zsh
# zsh profile file. Runs on login. Environmental variables are set here.
# If you don't plan on reverting to bash, you can remove the link in ~/.profile
# to clean up.
# Adds `~/.local/bin` to $PATH
export PATH="$PATH:$(du "$HOME/.local/bin" | cut -f2 | paste -sd ':')"
# Default programs:
export EDITOR="nvim"
export TERMINAL="st"
export BROWSER="brave"
export READER="zathura"
# ~/ Clean-up:
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"
#export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # This line will break some DMs.
export NOTMUCH_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/notmuch-config"
export GTK2_RC_FILES="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-2.0/gtkrc-2.0"
export LESSHISTFILE="-"
export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc"
export INPUTRC="${XDG_CONFIG_HOME:-$HOME/.config}/inputrc"
export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh"
#export GNUPGHOME="$XDG_DATA_HOME/gnupg"
export WINEPREFIX="${XDG_DATA_HOME:-$HOME/.local/share}/wineprefixes/default"
export KODI_DATA="${XDG_DATA_HOME:-$HOME/.local/share}/kodi"
export PASSWORD_STORE_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/password-store"
export TMUX_TMPDIR="$XDG_RUNTIME_DIR"
export ANDROID_SDK_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/android"
export CARGO_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/cargo"
export GOPATH="${XDG_DATA_HOME:-$HOME/.local/share}/go"
export ANSIBLE_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/ansible/ansible.cfg"
export UNISON="${XDG_DATA_HOME:-$HOME/.local/share}/unison"
export HISTFILE="${XDG_DATA_HOME:-$HOME/.local/share}/history"
export WEECHAT_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/weechat"
# Other program settings:
export DICS="/usr/share/stardict/dic/"
export SUDO_ASKPASS="$HOME/.local/bin/dmenupass"
export FZF_DEFAULT_OPTS="--layout=reverse --height 40%"
export LESS=-R
export LESS_TERMCAP_mb="$(printf '%b' '')"
export LESS_TERMCAP_md="$(printf '%b' '')"
export LESS_TERMCAP_me="$(printf '%b' '')"
export LESS_TERMCAP_so="$(printf '%b' '')"
export LESS_TERMCAP_se="$(printf '%b' '')"
export LESS_TERMCAP_us="$(printf '%b' '')"
export LESS_TERMCAP_ue="$(printf '%b' '')"
export LESSOPEN="| /usr/bin/highlight -O ansi %s 2>/dev/null"
export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme.
export MOZ_USE_XINPUT2="1" # Mozilla smooth scrolling/touchpads.
export AWT_TOOLKIT="MToolkit wmname LG3D" #May have to install wmname
export _JAVA_AWT_WM_NONREPARENTING=1 # Fix for Java applications in dwm
# This is the list for lf icons:
export LF_ICONS="di=📁:\
fi=📃:\
tw=🤝:\
ow=📂:\
ln=⛓:\
or=❌:\
ex=🎯:\
*.txt=✍:\
*.mom=✍:\
*.me=✍:\
*.ms=✍:\
*.png=🖼:\
*.webp=🖼:\
*.ico=🖼:\
*.jpg=📸:\
*.jpe=📸:\
*.jpeg=📸:\
*.gif=🖼:\
*.svg=🗺:\
*.tif=🖼:\
*.tiff=🖼:\
*.xcf=🖌:\
*.html=🌎:\
*.xml=📰:\
*.gpg=🔒:\
*.css=🎨:\
*.pdf=📚:\
*.djvu=📚:\
*.epub=📚:\
*.csv=📓:\
*.xlsx=📓:\
*.tex=📜:\
*.md=📘:\
*.r=📊:\
*.R=📊:\
*.rmd=📊:\
*.Rmd=📊:\
*.m=📊:\
*.mp3=🎵:\
*.opus=🎵:\
*.ogg=🎵:\
*.m4a=🎵:\
*.flac=🎼:\
*.mkv=🎥:\
*.mp4=🎥:\
*.webm=🎥:\
*.mpeg=🎥:\
*.avi=🎥:\
*.zip=📦:\
*.rar=📦:\
*.7z=📦:\
*.tar.gz=📦:\
*.z64=🎮:\
*.v64=🎮:\
*.n64=🎮:\
*.gba=🎮:\
*.nes=🎮:\
*.gdi=🎮:\
*.1=:\
*.nfo=:\
*.info=:\
*.log=📙:\
*.iso=📀:\
*.img=📀:\
*.bib=🎓:\
*.ged=👪:\
*.part=💔:\
*.torrent=🔽:\
*.jar=♨:\
*.java=♨:\
"
[ ! -f ${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc ] && shortcuts >/dev/null 2>&1 &
if pacman -Qs libxft-bgra >/dev/null 2>&1; then
# Start graphical server on user's current tty if not already running.
[[ -n "$(tty)" && -z $(pgrep -u $USER "\bXorg$") ]] && exec startx
else
echo "\033[31mIMPORTANT\033[0m: Note that \033[32m\`libxft-bgra\`\033[0m must be installed for this build of dwm.
Please run:
\033[32myay -S libxft-bgra-git\033[0m
and replace \`libxft\`"
fi
# Switch escape and caps if tty and no passwd required:
sudo -n loadkeys ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/ttymaps.kmap 2>/dev/null

1
.zprofile Symbolic link
View file

@ -0,0 +1 @@
.config/shell/profile

View file

@ -1,15 +1,13 @@
# The Voidrice (Luke Smith <https://lukesmith.xyz>'s dotfiles)
These are the dotfiles deployed by [LARBS](https://larbs.xyz) and as seen on [my YouTube channel](https://youtube.com/c/lukesmithxyz).
These are the dotfiles deployed by [LARBS](https://larbs.xyz) and as seen on
[my YouTube channel](https://youtube.com/c/lukesmithxyz).
- Very useful scripts are in `~/.local/bin/`
- Settings for:
- vim/nvim (text editor)
- zsh (shell)
- i3wm/i3-gaps (window manager)
- i3blocks (status bar)
- sxhkd (general key binder)
- ranger (file manager)
- lf (file manager)
- mpd/ncmpcpp (music)
- sxiv (image/gif viewer)
@ -24,17 +22,21 @@ These are the dotfiles deployed by [LARBS](https://larbs.xyz) and as seen on [my
- File bookmarks in `~/.config/files`
- Directory bookmarks in `~/.config/directories`
## Want even more?
## Usage
My setup is pretty modular nowadays.
I use several suckless programs that are meant to be configured and compiled by the user and I also have separate repos for some other things.
Check out their links:
These dotfiles are intended to go with numerous suckless programs I use:
- [dwm](https://github.com/lukesmithxyz/dwm) (the window manager I usually use now which is fully compatible with this repo)
- [st](https://github.com/lukesmithxyz/st) (the terminal emulator assumed to be used by these dotfiles)
- [mutt-wizard (`mw`)](https://github.com/lukesmithxyz/mutt-wizard) - (a terminal-based email system that can store your mail offline without effort)
- [dwm](https://github.com/lukesmithxyz/dwm) (window manager)
- [dwmblocks](https://github.com/lukesmithxyz/dwmblocks) (statusbar)
- [st](https://github.com/lukesmithxyz/st) (terminal emulator)
## Install these dotfiles
I also recommend trying out
[mutt-wizard](https://github.com/lukesmithxyz/mutt-wizard), which additionally
works with this setup. It gives you an easy-to-install terminal-based email
client regardless of your email provider. It is integrated into these dotfiles
as well.
## Install these dotfiles and all dependencies
Use [LARBS](https://larbs.xyz) to autoinstall everything:
@ -42,4 +44,5 @@ Use [LARBS](https://larbs.xyz) to autoinstall everything:
curl -LO larbs.xyz/larbs.sh
```
or clone the repo files directly to your home directory and install [the prerequisite programs](https://github.com/LukeSmithxyz/LARBS/blob/master/progs.csv).
or clone the repo files directly to your home directory and install the
[dependencies](https://github.com/LukeSmithxyz/LARBS/blob/master/progs.csv).