Initial chezmoi commit
This commit is contained in:
518
dot_config/i3/config
Normal file
518
dot_config/i3/config
Normal file
@@ -0,0 +1,518 @@
|
||||
# startup {{{ #
|
||||
# vim: fdm=marker
|
||||
set $browser "firefox"
|
||||
# set $browser "chromium"
|
||||
set $def_term "urxvt"
|
||||
set $scripts_path "/home/kevin/linux-config/scripts"
|
||||
exec redshift -O 2000
|
||||
# exec redshift -O 3000
|
||||
# random bg
|
||||
exec compton
|
||||
exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/dim/non-editing")
|
||||
exec imwheel
|
||||
exec xmodmap ~/.Xmodmap
|
||||
exec xset r rate $XSET_DELAY $XSET_RATE
|
||||
exec xrdb ~/.Xresources
|
||||
exec --no-startup-id dunst
|
||||
exec --no-startup-id start-pulseaudio-x11
|
||||
exec --no-startup-id i3-msg 'workspace $ws2; exec $def_term'
|
||||
exec --no-startup-id i3-msg 'workspace $ws3; exec $browser'
|
||||
# exec --no-startup-id i3-msg 'workspace $ws11; exec $swex'
|
||||
exec_always --no-startup-id numlockx on
|
||||
# }}} startup #
|
||||
|
||||
# applications {{{ #
|
||||
|
||||
set $mod Mod1
|
||||
set $sch_dir "$HOME/Documents/School"
|
||||
|
||||
# app shortcuts {{{ #
|
||||
|
||||
# bindsym $mod+control+Return exec i3-sensible-terminal
|
||||
# bindsym $mod+control+Return exec $def_term
|
||||
bindsym control+Return exec $def_term
|
||||
# bindsym Mod4+1 exec xdotool click --repeat 5 --delay 100 1
|
||||
# bindsym Mod4+2 exec xdotool click --repeat 10 --delay 100 1
|
||||
# bindsym Mod4+3 exec xdotool click --repeat 20 --delay 100 1
|
||||
bindsym Mod4+a exec studio
|
||||
bindsym Mod4+b layout tabbed; exec zathura
|
||||
bindsym Mod4+c exec $browser
|
||||
bindsym Mod4+e exec notify-send "HPS Word Count" "$(pdftotext /home/kevin/school/latex-notes/hps/essay.pdf - | wc -w)"
|
||||
bindsym Mod4+f exec firefox
|
||||
bindsym Mod4+$mod+f exec echo 'Kevin@fosstodon.org' | xclip -selection clipboard
|
||||
bindsym Mod4+h exec echo 'kevin.mok@live.ca' | xclip -selection clipboard
|
||||
bindsym Mod4+$mod+m exec pass -c uoft/markus
|
||||
bindsym Mod4+n exec urxvt -e nvim
|
||||
bindsym Mod4+o exec xclip -selection clipboard ~/.password-store/social/gmail
|
||||
bindsym Mod4+$mod+o exec xset dpms force off
|
||||
# bindsym Mod4+p workspace $ws4; exec pgadmin3
|
||||
# bindsym Mod4+p exec pycharm
|
||||
bindsym Mod4+p exec passmenu
|
||||
# bindsym Mod4+$mod+p exec notify-send "ping" "$(ping -c 3 -W 1 8.8.8.8)"
|
||||
bindsym Mod4+q exec qdirstat
|
||||
bindsym Mod4+r exec urxvt -e ranger
|
||||
bindsym Mod4+$mod+r exec notify-send "watson restart" "$(watson restart)"
|
||||
bindsym control+$mod+s exec systemctl suspend
|
||||
# bindsym Mod4+t exec st
|
||||
bindsym Mod4+$mod+t exec xclip -selection clipboard ~/.password-store/social/trapbot
|
||||
bindsym Mod4+u exec echo 'kevin.mok@mail.utoronto.ca' | xclip -selection clipboard
|
||||
bindsym Mod4+$mod+u exec pass -c uoft/acorn
|
||||
bindsym Mod4+w exec notify-send "watson status" "$(watson status)"
|
||||
bindsym Mod4+$mod+w exec notify-send "watson stop" "$(watson status && watson stop)"
|
||||
bindsym control+$mod+w exec urxvt -e nvim /home/kevin/.config/watson/state.tmp
|
||||
# bindsym Mod4+x exec $swex
|
||||
bindsym Mod4+x exec xmodmap ~/.Xmodmap && xset r rate $XSET_DELAY $XSET_RATE
|
||||
bindsym Mod4+z exec cliqz
|
||||
# bindsym Print exec gscreenshot
|
||||
bindsym Print --release exec "scrot -s /tmp/screenshot-$(date +%F_%T).png -e 'xclip -selection c -t image/png < $f'"
|
||||
bindsym control+Print --release exec "scrot -u /tmp/screenshot-$(date +%F_%T).png -e 'xclip -selection c -t image/png < $f'"
|
||||
# }}} app shortcuts #
|
||||
|
||||
# redshift {{{ #
|
||||
|
||||
bindsym $mod+Mod4+1 exec redshift -x && redshift -O 1100
|
||||
bindsym $mod+Mod4+2 exec redshift -x && redshift -O 2000
|
||||
bindsym $mod+Mod4+3 exec redshift -x && redshift -O 3000
|
||||
bindsym $mod+Mod4+4 exec redshift -x && redshift -O 4000
|
||||
bindsym $mod+Mod4+5 exec redshift -x && redshift -O 5000
|
||||
bindsym $mod+Mod4+grave exec redshift -x
|
||||
|
||||
# old
|
||||
# bindsym $mod+Mod4+1 exec redshift -x && redshift -O 1000
|
||||
# bindsym $mod+Mod4+3 exec redshift -x && redshift -O 1500
|
||||
# bindsym $mod+Mod4+3 exec redshift -x && redshift -O 2500
|
||||
|
||||
# }}} redshift #
|
||||
|
||||
# backlight {{{ #
|
||||
|
||||
bindsym Shift+F1 exec xbacklight -set 10
|
||||
bindsym Shift+F2 exec xbacklight -set 20
|
||||
bindsym Shift+F3 exec xbacklight -set 30
|
||||
bindsym Shift+F4 exec xbacklight -set 40
|
||||
bindsym Shift+F5 exec xbacklight -set 50
|
||||
bindsym Shift+F6 exec xbacklight -set 60
|
||||
bindsym Shift+F7 exec xbacklight -set 70
|
||||
bindsym Shift+F8 exec xbacklight -set 80
|
||||
bindsym Shift+F9 exec xbacklight -set 90
|
||||
bindsym Shift+F0 exec xbacklight -set 100
|
||||
|
||||
# }}} backlight #
|
||||
|
||||
# menu {{{ #
|
||||
# start dmenu (a program launcher)
|
||||
# bindsym Mod4+Return exec dmenu_run
|
||||
# There also is the (new) i3-dmenu-desktop which only displays applications
|
||||
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
|
||||
# installed.
|
||||
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
|
||||
# }}} menu #
|
||||
# Use Mouse+$mod to drag floating windows to their wanted position
|
||||
floating_modifier $mod
|
||||
|
||||
for_window [class="Peek"] floating enable
|
||||
|
||||
# }}} applications #
|
||||
|
||||
# changing/focusing/moving windows {{{ #
|
||||
# change focus
|
||||
bindsym control+h focus left
|
||||
bindsym control+j focus down
|
||||
bindsym control+k focus up
|
||||
bindsym control+l focus right
|
||||
|
||||
# move workspace to other monitor
|
||||
bindsym $mod+minus move workspace to output left
|
||||
bindsym $mod+plus move workspace to output right
|
||||
|
||||
# alternatively, you can use the cursor keys:
|
||||
bindsym $mod+Left focus left
|
||||
bindsym $mod+Down focus down
|
||||
bindsym $mod+Up focus up
|
||||
bindsym $mod+Right focus right
|
||||
|
||||
# move focused window
|
||||
bindsym control+Shift+h move left
|
||||
bindsym control+Shift+j move down
|
||||
bindsym control+Shift+k move up
|
||||
bindsym control+Shift+l move right
|
||||
|
||||
# alternatively, you can use the cursor keys:
|
||||
bindsym $mod+Shift+Left move left
|
||||
bindsym $mod+Shift+Down move down
|
||||
bindsym $mod+Shift+Up move up
|
||||
bindsym $mod+Shift+Right move right
|
||||
|
||||
# split in horizontal orientation
|
||||
bindsym $mod+b split h
|
||||
bindsym Mod4+$mod+b split h; exec $def_term
|
||||
|
||||
# split in vertical orientation
|
||||
bindsym $mod+v split v
|
||||
bindsym Mod4+$mod+v split v; exec $def_term
|
||||
|
||||
# bindsym control+Shift+x kill
|
||||
bindsym shift+x kill
|
||||
# }}} changing/focusing/moving windows #
|
||||
|
||||
# container display {{{ #
|
||||
# backgrounds
|
||||
# set $colors_sh "~/.cache/wal/colors.sh"
|
||||
bindsym $mod+q exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/bright/editing")
|
||||
bindsym $mod+w exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/dim/non-editing")
|
||||
# bindsym $mod+w exec ~/linux-config/scripts/bg-chooser
|
||||
bindsym $mod+r exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/dim/editing")
|
||||
bindsym $mod+y exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/bright/non-editing")
|
||||
|
||||
# enter fullscreen mode for the focused container
|
||||
bindsym $mod+f fullscreen toggle
|
||||
|
||||
# change container layout (stacked, tabbed, toggle split)
|
||||
bindsym $mod+s layout stacking
|
||||
bindsym $mod+t layout tabbed
|
||||
bindsym $mod+e layout toggle split
|
||||
|
||||
# toggle tiling /floating
|
||||
bindsym $mod+Shift+space floating toggle
|
||||
|
||||
# change focus between tiling / floating windows
|
||||
bindsym $mod+space focus mode_toggle
|
||||
|
||||
# focus the parent container
|
||||
bindsym $mod+a focus parent
|
||||
|
||||
# focus the child container
|
||||
#bindsym $mod+d focus child
|
||||
|
||||
# change container colors from pywal {{{ #
|
||||
|
||||
# Set colors from Xresources
|
||||
# Change 'color7' and 'color2' to whatever colors you want i3 to use
|
||||
# from the generated scheme.
|
||||
# NOTE: The '#f0f0f0' in the lines below is the color i3 will use if
|
||||
# it fails to get colors from Xresources.
|
||||
set_from_resource $fg i3wm.color7 #f0f0f0
|
||||
set_from_resource $bg i3wm.color2 #f0f0f0
|
||||
|
||||
# class border backgr. text indicator child_border
|
||||
client.focused $bg $bg $fg $bg $bg
|
||||
# client.unfocused $fg $bg $fg $bg $fg
|
||||
# client.urgent $bg $bg $fg $bg $bg
|
||||
# client.placeholder $bg $bg $fg $bg $bg
|
||||
# client.background $bg
|
||||
|
||||
# PROTIP: You can also dynamically set dmenu's colors this way:
|
||||
bindsym Mod4+Return exec dmenu_run -nb "$fg" -nf "$bg" -sb "$bg" -sf "$fg"
|
||||
|
||||
# }}} change container colors from pywal #
|
||||
|
||||
# }}} container display #
|
||||
|
||||
# workspace {{{ #
|
||||
# ws names {{{ #
|
||||
set $samsung "DVI-I-1"
|
||||
set $benq "HDMI-0"
|
||||
|
||||
set $ws1 "1 "
|
||||
workspace $ws1 output $benq
|
||||
bindsym $mod+F1 workspace $ws1; exec $def_term
|
||||
|
||||
set $ws2 "2 "
|
||||
workspace $ws2 output $samsung
|
||||
bindsym $mod+F2 workspace $ws2; exec $def_term
|
||||
|
||||
set $ws3 "3 "
|
||||
# set $ws3 "3 "
|
||||
workspace $ws3 output $benq
|
||||
bindsym $mod+F3 workspace $ws3; exec $browser
|
||||
|
||||
set $ws4 "4 "
|
||||
workspace $ws4 output $samsung
|
||||
bindsym $mod+F4 workspace $ws4; exec $def_term
|
||||
|
||||
set $ws5 "5 "
|
||||
# set $ws5 "5 🎥"
|
||||
workspace $ws5 output $samsung
|
||||
assign [class="Steam"] $ws5
|
||||
bindsym $mod+F5 workspace $ws5; exec $browser
|
||||
bindsym Mod4+g workspace $ws5; layout stacking; exec urxvt -e steam
|
||||
bindsym Mod4+t workspace $ws5; exec thunderbird
|
||||
|
||||
set $ws6 "6 "
|
||||
workspace $ws6 output $samsung
|
||||
assign [class="Slack"] $ws6
|
||||
bindsym Mod4+d workspace $ws6; exec discord
|
||||
bindsym Mod4+i workspace $ws6; exec firefox -new-window https://riot.im/app/#/home
|
||||
# bindsym Mod4+k workspace $ws6; exec slack
|
||||
|
||||
set $ws7 "7 "
|
||||
# set $ws7 "7 📤"
|
||||
workspace $ws7 output $samsung
|
||||
bindsym $mod+F7 workspace $ws7; exec $def_term
|
||||
# bindsym Mod4+v workspace $ws7; exec VBoxManage startvm "369-a1"
|
||||
|
||||
set $ws8 "8 "
|
||||
# set $ws8 "8 📊"
|
||||
# assign [class="jetbrains-"] $ws8
|
||||
workspace $ws8 output $samsung
|
||||
bindsym $mod+F8 workspace $ws8; exec $def_term
|
||||
|
||||
set $ws9 "9 "
|
||||
# set $ws9 "9 🔧"
|
||||
workspace $ws9 output $samsung
|
||||
bindsym $mod+F9 workspace $ws9; exec $def_term
|
||||
|
||||
set $ws10 "10 "
|
||||
# set $ws10 "10 🎵"
|
||||
assign [class="spotify"] $ws10
|
||||
workspace $ws10 output $samsung
|
||||
set $hp 2
|
||||
# bindsym Mod4+v workspace $ws10; exec urxvt -e alsamixer -c 0
|
||||
bindsym Mod4+v workspace $ws10; exec urxvt -e cava
|
||||
# bindsym Mod4+h workspace $ws10; exec urxvt -e alsamixer -c $hp
|
||||
bindsym Mod4+s workspace $ws10; exec spotify
|
||||
|
||||
set $ws11 "11 "
|
||||
# set $ws11 "11 📊"
|
||||
# assign [class="Summoners War Exporter"] $ws11
|
||||
workspace $ws11 output $samsung
|
||||
bindsym $mod+F11 workspace $ws11; exec urxvt -e htop -s PERCENT_CPU
|
||||
|
||||
set $ws12 "12 "
|
||||
bindsym $mod+F12 workspace $ws12; exec $def_term
|
||||
|
||||
set $ws13 "13 "
|
||||
bindsym Mod4+F3 workspace $ws13; exec $def_term
|
||||
|
||||
set $ws14 "14"
|
||||
set $ws15 "15"
|
||||
|
||||
# }}} ws names #
|
||||
|
||||
# ws bindings {{{ #
|
||||
# switch to workspace
|
||||
bindsym $mod+h workspace prev
|
||||
bindsym $mod+l workspace next
|
||||
|
||||
bindsym $mod+1 workspace $ws1
|
||||
bindsym $mod+2 workspace $ws2
|
||||
bindsym $mod+3 workspace $ws3
|
||||
bindsym $mod+4 workspace $ws4
|
||||
bindsym $mod+5 workspace $ws5
|
||||
bindsym $mod+6 workspace $ws6
|
||||
bindsym $mod+7 workspace $ws7
|
||||
bindsym $mod+8 workspace $ws8
|
||||
bindsym $mod+9 workspace $ws9
|
||||
bindsym $mod+0 workspace $ws10
|
||||
bindsym Mod4+1 workspace $ws11
|
||||
bindsym Mod4+2 workspace $ws12
|
||||
bindsym Mod4+3 workspace $ws13
|
||||
bindsym Mod4+4 workspace $ws14
|
||||
bindsym Mod4+5 workspace $ws15
|
||||
# }}} ws bindings #
|
||||
|
||||
# move container to ws {{{ #
|
||||
# move focused container to workspace
|
||||
# bindsym $mod+control+1 move container to workspace $ws1
|
||||
bindsym $mod+control+1 move container to workspace $ws1; workspace $ws1
|
||||
bindsym $mod+control+2 move container to workspace $ws2; workspace $ws2
|
||||
bindsym $mod+control+3 move container to workspace $ws3; workspace $ws3
|
||||
bindsym $mod+control+4 move container to workspace $ws4; workspace $ws4
|
||||
bindsym $mod+control+5 move container to workspace $ws5; workspace $ws5
|
||||
bindsym $mod+control+6 move container to workspace $ws6; workspace $ws6
|
||||
bindsym $mod+control+7 move container to workspace $ws7; workspace $ws7
|
||||
bindsym $mod+control+8 move container to workspace $ws8; workspace $ws8
|
||||
bindsym $mod+control+9 move container to workspace $ws9; workspace $ws9
|
||||
bindsym $mod+control+0 move container to workspace $ws10; workspace $ws10
|
||||
bindsym $mod+Shift+1 move container to workspace $ws11; workspace $ws11
|
||||
bindsym $mod+Shift+2 move container to workspace $ws12; workspace $ws12
|
||||
bindsym $mod+Shift+3 move container to workspace $ws13; workspace $ws13
|
||||
bindsym $mod+Shift+4 move container to workspace $ws14; workspace $ws14
|
||||
bindsym $mod+Shift+5 move container to workspace $ws15; workspace $ws15
|
||||
# }}} move container to ws #
|
||||
# }}} workspace #
|
||||
|
||||
# reload config/computer {{{ #
|
||||
|
||||
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
|
||||
# bindsym $mod+control+r exec ~/.cache/wal/colors.sh; restart
|
||||
bindsym $mod+control+r exec i3-msg restart
|
||||
# bindsym $mod+control+r exec $colors_sh && i3-msg restart
|
||||
|
||||
# reload the configuration file
|
||||
bindsym $mod+Shift+c reload
|
||||
# bindsym $mod+control+r reload
|
||||
bindsym $mod+control+u exec xrdb ~/.Xresources
|
||||
|
||||
# exit i3 (logs you out of your X session)
|
||||
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
|
||||
|
||||
# }}} reload config #
|
||||
|
||||
# resizing windows {{{ #
|
||||
bindsym $mod+control+h resize grow width 5 px or 5 ppt
|
||||
bindsym $mod+control+k resize grow height 5 px or 5 ppt
|
||||
bindsym $mod+control+j resize shrink height 5 px or 5 ppt
|
||||
bindsym $mod+control+l resize shrink width 5 px or 5 ppt
|
||||
# }}} resizing windows #
|
||||
|
||||
# gaps {{{ #
|
||||
|
||||
# remove window titlebars
|
||||
for_window [class="^.*"] border pixel 3
|
||||
# for_window [class="^.*"] border pixel 1
|
||||
set $inner_gaps 40
|
||||
set $outer_gaps 0
|
||||
|
||||
# gaps inner $inner_gaps
|
||||
# gaps outer $outer_gaps
|
||||
# gaps bottom 0
|
||||
gaps inner 0
|
||||
gaps outer 0
|
||||
|
||||
# other gaps {{{ #
|
||||
|
||||
# gaps horizontal 20
|
||||
# gaps vertical 10
|
||||
# gaps top
|
||||
# gaps left 20
|
||||
# gaps right 20
|
||||
# gaps bottom
|
||||
|
||||
# }}} other gaps #
|
||||
|
||||
bindsym control+shift+plus gaps inner all set $inner_gaps;gaps outer all set $outer_gaps
|
||||
bindsym control+shift+0 gaps inner all set 0;gaps outer all set 0
|
||||
|
||||
# }}} gaps #
|
||||
|
||||
# status bar {{{ #
|
||||
# Start i3bar to display a workspace bar (plus the system information i3status
|
||||
# finds out, if available)
|
||||
set $sb_font DejaVuSansMono Nerd Font Mono Bold
|
||||
# set $sb_font Hack NF Bold
|
||||
# set $sb_font EmojiOne
|
||||
set $black #000000
|
||||
set $white #ffffff
|
||||
for_window [class="Yad"] floating enable
|
||||
|
||||
# inactive vars {{{ #
|
||||
|
||||
# set $inactive_ws_bg $white
|
||||
set $inactive_ws_bg #444c52
|
||||
|
||||
# set $inactive_ws_trans 96
|
||||
set $inactive_ws_trans 00
|
||||
|
||||
# }}} inactive #
|
||||
|
||||
# set $active_ws_trans 91
|
||||
set $active_ws_trans 4b
|
||||
|
||||
set $focused_ws_text #ffffff
|
||||
|
||||
# benq bar {{{ #
|
||||
|
||||
# set $bar_trans 64
|
||||
set $bar_trans 00
|
||||
set $benq_ws_trans aa
|
||||
bar {
|
||||
i3bar_command i3bar -t
|
||||
font pango:$sb_font 21
|
||||
# font pango:$sb_font 14
|
||||
colors {
|
||||
# 0 (transparent) -> 255 (opaque) in hex
|
||||
background $black$bar_trans
|
||||
# border, bg, text color
|
||||
# focused_workspace $inactive_ws_bg $bg $focused_ws_text
|
||||
focused_workspace $inactive_ws_bg $bg $fg
|
||||
# active = focused on other screen
|
||||
active_workspace $inactive_ws_bg $fg$active_ws_trans $fg
|
||||
inactive_workspace $inactive_ws_bg $inactive_ws_bg$inactive_ws_trans $fg
|
||||
}
|
||||
tray_output none
|
||||
# status_command i3blocks -c ~/.config/i3blocks/i3blocks.conf
|
||||
status_command 2>/tmp/i3blocks.err i3blocks -vvv -c ~/.config/i3blocks/i3blocks.conf | tee /tmp/i3blocks.out
|
||||
output $benq
|
||||
wheel_up_cmd nop
|
||||
wheel_down_cmd nop
|
||||
}
|
||||
|
||||
# }}} benq bar #
|
||||
|
||||
# sam bar {{{ #
|
||||
|
||||
bar {
|
||||
output $samsung
|
||||
font pango:$sb_font 25
|
||||
# font pango:$sb_font 15
|
||||
# output $benq
|
||||
i3bar_command i3bar -t
|
||||
colors {
|
||||
background $black$bar_trans
|
||||
# border, bg, text color
|
||||
# focused_workspace $inactive_ws_bg $bg $focused_ws_text
|
||||
focused_workspace $inactive_ws_bg $bg $fg
|
||||
active_workspace $inactive_ws_bg $fg$active_ws_trans $fg
|
||||
inactive_workspace $inactive_ws_bg $inactive_ws_bg$inactive_ws_trans $fg
|
||||
}
|
||||
# status_command i3blocks -c ~/.config/sam-i3blocks/sam-i3blocks.conf
|
||||
status_command 2>/tmp/i3blocks-sam.err i3blocks -vvv -c ~/.config/i3blocks/sam-i3blocks.conf | tee /tmp/i3blocks-sam.out
|
||||
tray_output none
|
||||
wheel_up_cmd nop
|
||||
wheel_down_cmd nop
|
||||
}
|
||||
|
||||
# }}} samsung bar #
|
||||
|
||||
# # # display {{{ #
|
||||
|
||||
# bar {
|
||||
# i3bar_command i3bar -t
|
||||
# font pango:$sb_font 23
|
||||
# tray_output none
|
||||
# status_command i3blocks -c ~/.config/i3blocks/i3blocks-display.conf
|
||||
# output $samsung
|
||||
# wheel_up_cmd nop
|
||||
# wheel_down_cmd nop
|
||||
# }
|
||||
|
||||
# # }}} display #
|
||||
|
||||
# }}} status bar #
|
||||
|
||||
# mod key/font {{{ #
|
||||
set $mod Mod1
|
||||
|
||||
# Font for window titles. Will also be used by the bar unless a different font
|
||||
# is used in the bar {} block below.
|
||||
# font pango:Hack 11
|
||||
# font pango:$sb_font 8
|
||||
font pango:$sb_font 11
|
||||
# This font is widely installed, provides lots of unicode glyphs, right-to-left
|
||||
# text rendering and scalability on retina/hidpi displays (thanks to pango).
|
||||
#font pango:DejaVu Sans Mono 8
|
||||
|
||||
# Before i3 v4.8, we used to recommend this one as the default:
|
||||
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
|
||||
# The font above is very space-efficient, that is, it looks good, sharp and
|
||||
# clear in small sizes. However, its unicode glyph coverage is limited, the old
|
||||
# X core fonts rendering does not support right-to-left and this being a bitmap
|
||||
# font, it doesn’t scale on retina/hidpi displays.
|
||||
# }}} mod key/font #
|
||||
|
||||
# media keys {{{ #
|
||||
bindsym control+d exec ~/linux-config/scripts/change-sink dac
|
||||
# bindsym control+shift+d exec ~/linux-config/scripts/change-sink dac2
|
||||
bindsym control+o exec ~/linux-config/scripts/change-sink line-out
|
||||
|
||||
bindsym XF86AudioRaiseVolume exec amixer -q -D pulse sset Master 5%+ && pkill -RTMIN+1 i3blocks
|
||||
bindsym XF86AudioLowerVolume exec amixer -q -D pulse sset Master 5%- && pkill -RTMIN+1 i3blocks
|
||||
bindsym XF86AudioMute exec amixer -q -D pulse sset Master toggle && pkill -RTMIN+1 i3blocks
|
||||
|
||||
# Media player controls
|
||||
bindsym XF86AudioPlay exec "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause"
|
||||
bindsym XF86AudioStop exec "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop"
|
||||
bindsym XF86AudioPrev exec "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous"
|
||||
bindsym XF86AudioNext exec "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next"
|
||||
# }}} media keys #
|
||||
167
dot_config/i3blocks/i3blocks-display.conf
Normal file
167
dot_config/i3blocks/i3blocks-display.conf
Normal file
@@ -0,0 +1,167 @@
|
||||
# properties {{{ #
|
||||
# i3blocks config file
|
||||
#
|
||||
# Please see man i3blocks for a complete reference!
|
||||
# The man page is also hosted at http://vivien.github.io/i3blocks
|
||||
#
|
||||
# List of valid properties:
|
||||
#
|
||||
# align
|
||||
# color
|
||||
# command
|
||||
# full_text
|
||||
# instance
|
||||
# interval
|
||||
# label
|
||||
# min_width
|
||||
# name
|
||||
# separator
|
||||
# separator_block_width
|
||||
# short_text
|
||||
# signal
|
||||
# urgent
|
||||
# }}} properties #
|
||||
|
||||
# Global properties {{{ #
|
||||
# The top properties below are applied to every block, but can be overridden.
|
||||
# Each block command defaults to the script name to avoid boilerplate.
|
||||
align=center
|
||||
# command=/usr/share/i3blocks/$BLOCK_NAME
|
||||
command=~/linux-config/configs/i3blocks-scripts/$BLOCK_NAME
|
||||
separator=true
|
||||
separator_block_width=25
|
||||
markup=pango
|
||||
# }}} Global properties #
|
||||
|
||||
[time]
|
||||
label=
|
||||
command=date '+%H:%M.%a-%m-%d'
|
||||
interval=30
|
||||
color=#acc0cd
|
||||
|
||||
[spotify]
|
||||
command=python ~/linux-config/configs/i3blocks-scripts/spotify.py
|
||||
label=
|
||||
color=#999999
|
||||
interval=5
|
||||
|
||||
# [wifi]
|
||||
# label=
|
||||
# instance=wlp4s0
|
||||
# interval=10
|
||||
|
||||
# unbold this?
|
||||
# [load_average]
|
||||
# label=
|
||||
# interval=5
|
||||
# color=#990000
|
||||
|
||||
# [cpu_usage -w 50 -c 80]
|
||||
[cpu_usage]
|
||||
label=
|
||||
color=#990000
|
||||
interval=5
|
||||
|
||||
[memory]
|
||||
label=
|
||||
color=#3da061
|
||||
interval=5
|
||||
|
||||
[name]
|
||||
label=
|
||||
color=#1e5b99
|
||||
interval=6000
|
||||
|
||||
# unused blocks {{{ #
|
||||
# Volume indicator
|
||||
#
|
||||
# The first parameter sets the step (and units to display)
|
||||
# The second parameter overrides the mixer selection
|
||||
# See the script for details.
|
||||
# [volume]
|
||||
# label=VOL
|
||||
# #label=♪
|
||||
# instance=Master
|
||||
# #instance=PCM
|
||||
# interval=once
|
||||
# signal=10
|
||||
|
||||
# [memory]
|
||||
# label=SWAP
|
||||
# instance=swap
|
||||
# separator=false
|
||||
# interval=30
|
||||
|
||||
# Disk usage
|
||||
#
|
||||
# The directory defaults to $HOME if the instance is not specified.
|
||||
# The script may be called with a optional argument to set the alert
|
||||
# (defaults to 10 for 10%).
|
||||
# [disk]
|
||||
# label=HOME
|
||||
# #instance=/mnt/data
|
||||
# interval=30
|
||||
|
||||
# Network interface monitoring
|
||||
#
|
||||
# If the instance is not specified, use the interface used for default route.
|
||||
# The address can be forced to IPv4 or IPv6 with -4 or -6 switches.
|
||||
# [iface]
|
||||
# #instance=wlan0
|
||||
# color=#00FF00
|
||||
# interval=10
|
||||
# separator=false
|
||||
|
||||
# [bandwidth]
|
||||
# #instance=eth0
|
||||
# interval=5
|
||||
|
||||
# Battery indicator
|
||||
#
|
||||
# The battery instance defaults to 0.
|
||||
# [battery]
|
||||
# label=BAT
|
||||
# #label=⚡
|
||||
# #instance=1
|
||||
# interval=30
|
||||
|
||||
# Generic media player support
|
||||
#
|
||||
# This displays "ARTIST - SONG" if a music is playing.
|
||||
# Supported players are: spotify, vlc, audacious, xmms2, mplayer, and others.
|
||||
#[mediaplayer]
|
||||
#instance=spotify
|
||||
#interval=5
|
||||
#signal=10
|
||||
|
||||
# OpenVPN support
|
||||
#
|
||||
# Support multiple VPN, with colors.
|
||||
#[openvpn]
|
||||
#interval=20
|
||||
|
||||
# Temperature
|
||||
#
|
||||
# Support multiple chips, though lm-sensors.
|
||||
# The script may be called with -w and -c switches to specify thresholds,
|
||||
# see the script for details.
|
||||
#[temperature]
|
||||
#label=TEMP
|
||||
#interval=10
|
||||
|
||||
# Key indicators
|
||||
#
|
||||
# Add the following bindings to i3 config file:
|
||||
#
|
||||
# bindsym --release Caps_Lock exec pkill -SIGRTMIN+11 i3blocks
|
||||
# bindsym --release Num_Lock exec pkill -SIGRTMIN+11 i3blocks
|
||||
#[keyindicator]
|
||||
#instance=CAPS
|
||||
#interval=once
|
||||
#signal=11
|
||||
|
||||
#[keyindicator]
|
||||
#instance=NUM
|
||||
#interval=once
|
||||
#signal=11
|
||||
# }}} unused blocks #
|
||||
171
dot_config/i3blocks/i3blocks.conf
Normal file
171
dot_config/i3blocks/i3blocks.conf
Normal file
@@ -0,0 +1,171 @@
|
||||
# The top properties below are applied to every block, but can be overridden.
|
||||
# Each block command defaults to the script name to avoid boilerplate.
|
||||
align=center
|
||||
command=~/.config/i3blocks/scripts/$BLOCK_NAME
|
||||
separator=true
|
||||
separator_block_width=25
|
||||
markup=pango
|
||||
# color=#d1e7ff
|
||||
# color=#acc0cd
|
||||
color=#cbe4ff
|
||||
|
||||
# color=$foreground
|
||||
# color="${foreground}"
|
||||
# color="$(echo $foreground)"
|
||||
|
||||
# [time]
|
||||
# label=
|
||||
# # label=🕓
|
||||
# # command=date '+%H:%M.%a-%m-%d'
|
||||
# interval=30
|
||||
# # color=#acc0cd
|
||||
|
||||
[volume]
|
||||
interval=once
|
||||
signal=1
|
||||
interval=60
|
||||
|
||||
[calendar]
|
||||
interval=30
|
||||
label=
|
||||
DATEFMT=+%H:%M
|
||||
# SHORTFMT=+%H:%M:%S
|
||||
HEIGHT=180
|
||||
WIDTH=220
|
||||
|
||||
# unbold this?
|
||||
# [load_average]
|
||||
# label=
|
||||
# interval=5
|
||||
# color=#990000
|
||||
|
||||
[temperature]
|
||||
label=
|
||||
interval=5
|
||||
|
||||
# [cpu_usage -w 50 -c 80]
|
||||
[cpu_usage]
|
||||
label=
|
||||
# color=#990000
|
||||
interval=5
|
||||
|
||||
[memory]
|
||||
label=
|
||||
# color=#3da061
|
||||
interval=5
|
||||
|
||||
# [wifi]
|
||||
# label=
|
||||
# instance=wlp4s0
|
||||
# interval=10
|
||||
|
||||
[name]
|
||||
label=
|
||||
interval=30
|
||||
|
||||
# unused blocks {{{ #
|
||||
|
||||
# [memory]
|
||||
# label=SWAP
|
||||
# instance=swap
|
||||
# separator=false
|
||||
# interval=30
|
||||
|
||||
# Disk usage
|
||||
#
|
||||
# The directory defaults to $HOME if the instance is not specified.
|
||||
# The script may be called with a optional argument to set the alert
|
||||
# (defaults to 10 for 10%).
|
||||
# [disk]
|
||||
# label=HOME
|
||||
# #instance=/mnt/data
|
||||
# interval=30
|
||||
|
||||
# Network interface monitoring
|
||||
#
|
||||
# If the instance is not specified, use the interface used for default route.
|
||||
# The address can be forced to IPv4 or IPv6 with -4 or -6 switches.
|
||||
# [iface]
|
||||
# #instance=wlan0
|
||||
# color=#00FF00
|
||||
# interval=10
|
||||
# separator=false
|
||||
|
||||
# [bandwidth]
|
||||
# #instance=eth0
|
||||
# interval=5
|
||||
|
||||
# Battery indicator
|
||||
#
|
||||
# The battery instance defaults to 0.
|
||||
# [battery]
|
||||
# label=BAT
|
||||
# #label=⚡
|
||||
# #instance=1
|
||||
# interval=30
|
||||
|
||||
# Generic media player support
|
||||
#
|
||||
# This displays "ARTIST - SONG" if a music is playing.
|
||||
# Supported players are: spotify, vlc, audacious, xmms2, mplayer, and others.
|
||||
#[mediaplayer]
|
||||
#instance=spotify
|
||||
#interval=5
|
||||
#signal=10
|
||||
|
||||
# OpenVPN support
|
||||
#
|
||||
# Support multiple VPN, with colors.
|
||||
#[openvpn]
|
||||
#interval=20
|
||||
|
||||
# Temperature
|
||||
#
|
||||
# Support multiple chips, though lm-sensors.
|
||||
# The script may be called with -w and -c switches to specify thresholds,
|
||||
# see the script for details.
|
||||
#[temperature]
|
||||
#label=TEMP
|
||||
#interval=10
|
||||
|
||||
# Key indicators
|
||||
#
|
||||
# Add the following bindings to i3 config file:
|
||||
#
|
||||
# bindsym --release Caps_Lock exec pkill -SIGRTMIN+11 i3blocks
|
||||
# bindsym --release Num_Lock exec pkill -SIGRTMIN+11 i3blocks
|
||||
#[keyindicator]
|
||||
#instance=CAPS
|
||||
#interval=once
|
||||
#signal=11
|
||||
|
||||
#[keyindicator]
|
||||
#instance=NUM
|
||||
#interval=once
|
||||
#signal=11
|
||||
# }}} unused blocks #
|
||||
|
||||
# list of properties {{{ #
|
||||
# i3blocks config file
|
||||
#
|
||||
# Please see man i3blocks for a complete reference!
|
||||
# The man page is also hosted at http://vivien.github.io/i3blocks
|
||||
#
|
||||
# List of valid properties:
|
||||
#
|
||||
# align
|
||||
# color
|
||||
# command
|
||||
# full_text
|
||||
# instance
|
||||
# interval
|
||||
# label
|
||||
# min_width
|
||||
# name
|
||||
# separator
|
||||
# separator_block_width
|
||||
# short_text
|
||||
# signal
|
||||
# urgent
|
||||
# }}} properties #
|
||||
|
||||
35
dot_config/i3blocks/sam-i3blocks.conf
Normal file
35
dot_config/i3blocks/sam-i3blocks.conf
Normal file
@@ -0,0 +1,35 @@
|
||||
# Global properties {{{ #
|
||||
# The top properties below are applied to every block, but can be overridden.
|
||||
# Each block command defaults to the script name to avoid boilerplate.
|
||||
align=center
|
||||
command=~/.config/i3blocks/scripts/$BLOCK_NAME
|
||||
separator=true
|
||||
separator_block_width=25
|
||||
markup=pango
|
||||
color=#cbe4ff
|
||||
# }}} Global properties #
|
||||
|
||||
[spotify]
|
||||
# command=python ~/linux-config/configs/i3blocks-scripts/spotify.py
|
||||
# label=
|
||||
label=
|
||||
# label=🎧
|
||||
# green
|
||||
# color=#198c19
|
||||
# aqua
|
||||
# color=#2d7272
|
||||
interval=5
|
||||
|
||||
[volume]
|
||||
interval=once
|
||||
signal=1
|
||||
interval=60
|
||||
|
||||
[calendar]
|
||||
interval=30
|
||||
label=
|
||||
DATEFMT=+%H:%M.%a-%m-%d
|
||||
# SHORTFMT=+%H:%M:%S
|
||||
HEIGHT=180
|
||||
WIDTH=220
|
||||
|
||||
9
dot_config/i3blocks/scripts/executable_backlight
Normal file
9
dot_config/i3blocks/scripts/executable_backlight
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
# https://askubuntu.com/a/179949/794515
|
||||
round()
|
||||
{
|
||||
echo $(printf %.$2f $(echo "scale=$2;(((10^$2)*$1)+0.5)/(10^$2)" | bc))
|
||||
};
|
||||
|
||||
cur_bl=$(xbacklight -get)
|
||||
echo "$(round "$cur_bl" 0)%"
|
||||
78
dot_config/i3blocks/scripts/executable_battery
Normal file
78
dot_config/i3blocks/scripts/executable_battery
Normal file
@@ -0,0 +1,78 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# Copyright 2014 Pierre Mavro <deimos@deimos.fr>
|
||||
# Copyright 2014 Vivien Didelot <vivien@didelot.org>
|
||||
#
|
||||
# Licensed under the terms of the GNU GPL v3, or any later version.
|
||||
#
|
||||
# This script is meant to use with i3blocks. It parses the output of the "acpi"
|
||||
# command (often provided by a package of the same name) to read the status of
|
||||
# the battery, and eventually its remaining time (to full charge or discharge).
|
||||
#
|
||||
# The color will gradually change for a percentage below 85%, and the urgency
|
||||
# (exit code 33) is set if there is less that 5% remaining.
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use utf8;
|
||||
|
||||
my $acpi;
|
||||
my $status;
|
||||
my $percent;
|
||||
my $full_text;
|
||||
my $short_text;
|
||||
my $bat_number = $ENV{BLOCK_INSTANCE} || 0;
|
||||
|
||||
# read the first line of the "acpi" command output
|
||||
open (ACPI, "acpi -b | grep 'Battery $bat_number' |") or die;
|
||||
$acpi = <ACPI>;
|
||||
close(ACPI);
|
||||
|
||||
# fail on unexpected output
|
||||
if ($acpi !~ /: (\w+), (\d+)%/) {
|
||||
die "$acpi\n";
|
||||
}
|
||||
|
||||
$status = $1;
|
||||
$percent = $2;
|
||||
$full_text = "$percent%";
|
||||
|
||||
if ($status eq 'Discharging') {
|
||||
$full_text .= ' DIS';
|
||||
} elsif ($status eq 'Charging') {
|
||||
$full_text .= ' CHR';
|
||||
}
|
||||
|
||||
$short_text = $full_text;
|
||||
|
||||
if ($acpi =~ /(\d\d:\d\d):/) {
|
||||
$full_text .= " ($1)";
|
||||
}
|
||||
|
||||
# print text
|
||||
print "$full_text\n";
|
||||
print "$short_text\n";
|
||||
|
||||
# consider color and urgent flag only on discharge
|
||||
if ($status eq 'Discharging') {
|
||||
|
||||
if ($percent < 20) {
|
||||
print "#FF0000\n";
|
||||
} elsif ($percent < 40) {
|
||||
print "#FFAE00\n";
|
||||
} elsif ($percent < 60) {
|
||||
print "#FFF600\n";
|
||||
} elsif ($percent < 85) {
|
||||
print "#A8FF00\n";
|
||||
} else {
|
||||
print "#2c9332\n";
|
||||
}
|
||||
|
||||
if ($percent < 5) {
|
||||
exit(33);
|
||||
}
|
||||
} else {
|
||||
print "#2c9332\n";
|
||||
}
|
||||
|
||||
exit(0);
|
||||
42
dot_config/i3blocks/scripts/executable_calendar
Normal file
42
dot_config/i3blocks/scripts/executable_calendar
Normal file
@@ -0,0 +1,42 @@
|
||||
#! /bin/sh
|
||||
|
||||
WIDTH=${WIDTH:-200}
|
||||
HEIGHT=${HEIGHT:-200}
|
||||
DATEFMT=${DATEFMT:-"+%a %d.%m.%Y %H:%M:%S"}
|
||||
SHORTFMT=${SHORTFMT:-"+%H:%M:%S"}
|
||||
|
||||
OPTIND=1
|
||||
while getopts ":f:W:H:" opt; do
|
||||
case $opt in
|
||||
f) DATEFMT="$OPTARG" ;;
|
||||
W) WIDTH="$OPTARG" ;;
|
||||
H) HEIGHT="$OPTARG" ;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
;;
|
||||
:)
|
||||
echo "Option -$OPTARG requires an argument." >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
case "$BLOCK_BUTTON" in
|
||||
1|2|3)
|
||||
|
||||
# the position of the upper left corner of the popup
|
||||
posX=$(($BLOCK_X - $WIDTH / 2))
|
||||
posY=$(($BLOCK_Y - $HEIGHT))
|
||||
|
||||
i3-msg -q "exec yad --calendar \
|
||||
--width=$WIDTH --height=$HEIGHT \
|
||||
--undecorated --fixed \
|
||||
--close-on-unfocus --no-buttons \
|
||||
--posx=$posX --posy=$posY \
|
||||
> /dev/null"
|
||||
esac
|
||||
. "/home/kevin/.cache/wal/colors.sh"
|
||||
echo "$LABEL$(date "$DATEFMT")"
|
||||
echo "$LABEL$(date "$SHORTFMT")"
|
||||
echo "$color7"
|
||||
8
dot_config/i3blocks/scripts/executable_cpu_usage
Normal file
8
dot_config/i3blocks/scripts/executable_cpu_usage
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
. "/home/kevin/.cache/wal/colors.sh"
|
||||
|
||||
idle="$(mpstat 1 1 -P ALL | sed -n -e '4{p;q}' | awk '{print $NF}')"
|
||||
used=$(echo 100 - "$idle" | bc)
|
||||
used_rounded=$(printf %.0f "$used")
|
||||
printf "%s%%\n\n%s\n" "$used_rounded" "$color7"
|
||||
34
dot_config/i3blocks/scripts/executable_load_average
Normal file
34
dot_config/i3blocks/scripts/executable_load_average
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
load="$(cut -d ' ' -f1 /proc/loadavg)"
|
||||
cpus="$(nproc)"
|
||||
|
||||
# full text
|
||||
echo "$load"
|
||||
|
||||
# short text
|
||||
echo "$load"
|
||||
|
||||
# color if load is too high
|
||||
awk -v cpus=$cpus -v cpuload=$load '
|
||||
BEGIN {
|
||||
if (cpus <= cpuload) {
|
||||
print "#FF0000";
|
||||
exit 33;
|
||||
}
|
||||
}
|
||||
'
|
||||
51
dot_config/i3blocks/scripts/executable_memory
Normal file
51
dot_config/i3blocks/scripts/executable_memory
Normal file
@@ -0,0 +1,51 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
TYPE="${BLOCK_INSTANCE:-mem}"
|
||||
. "/home/kevin/.cache/wal/colors.sh"
|
||||
|
||||
awk -v type=$TYPE '
|
||||
/^MemTotal:/ {
|
||||
mem_total=$2
|
||||
}
|
||||
/^MemFree:/ {
|
||||
mem_free=$2
|
||||
}
|
||||
/^Buffers:/ {
|
||||
mem_free+=$2
|
||||
}
|
||||
/^Cached:/ {
|
||||
mem_free+=$2
|
||||
}
|
||||
/^SwapTotal:/ {
|
||||
swap_total=$2
|
||||
}
|
||||
/^SwapFree:/ {
|
||||
swap_free=$2
|
||||
}
|
||||
END {
|
||||
# full text
|
||||
if (type == "swap")
|
||||
printf("%.1fG\n", (swap_total-swap_free)/1024/1024)
|
||||
else
|
||||
printf("%.1fG\n", (mem_total-mem_free)/1024/1024)
|
||||
|
||||
# TODO: short text
|
||||
|
||||
# TODO: color (if less than X%)
|
||||
}
|
||||
' /proc/meminfo
|
||||
printf "\n%s\n" "$color7"
|
||||
4
dot_config/i3blocks/scripts/executable_name
Normal file
4
dot_config/i3blocks/scripts/executable_name
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
. "/home/kevin/.cache/wal/colors.sh"
|
||||
printf "Kevin\n\n%s\n" "$color7"
|
||||
12
dot_config/i3blocks/scripts/executable_spotify
Normal file
12
dot_config/i3blocks/scripts/executable_spotify
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
case "$BLOCK_BUTTON" in
|
||||
1) dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause ;;
|
||||
2) dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous ;;
|
||||
3) dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next ;;
|
||||
esac
|
||||
|
||||
. "/home/kevin/.cache/wal/colors.sh"
|
||||
long_title=$(spotify-now -i '%artist - %title' -p '' -e '' | sed 's/&/&/g')
|
||||
short_title=$(spotify-now -i '%title' -p '' -e '' | sed 's/&/&/g')
|
||||
printf "$long_title\n$short_title\n%s\n" "$color7"
|
||||
7
dot_config/i3blocks/scripts/executable_temperature
Normal file
7
dot_config/i3blocks/scripts/executable_temperature
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
. "/home/kevin/.cache/wal/colors.sh"
|
||||
|
||||
temps="$(sensors | rg 'temp1:.*' | awk '{ print $2 }' | rg -o '\d{2}' | \
|
||||
sed 's/$/°C/' | tr '\n' ' ' | xargs)"
|
||||
printf "%s\n\n%s\n" "$temps" "$color7"
|
||||
6
dot_config/i3blocks/scripts/executable_time
Normal file
6
dot_config/i3blocks/scripts/executable_time
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
. "/home/kevin/.cache/wal/colors.sh"
|
||||
printf "$(date '+%H:%M.%a-%m-%d')\n\n%s\n" "$color7"
|
||||
# echo "<span foreground=\"%s\">$(date '+%H:%M.%a-%m-%d')%s</span>" "$color2"
|
||||
# printf "%s" "$color2"
|
||||
220
dot_config/i3blocks/scripts/executable_volume
Normal file
220
dot_config/i3blocks/scripts/executable_volume
Normal file
@@ -0,0 +1,220 @@
|
||||
#!/bin/bash
|
||||
# Displays the default device, volume, and mute status for i3blocks
|
||||
|
||||
# default vars {{{ #
|
||||
|
||||
set -a
|
||||
|
||||
SINK_SYMB=""
|
||||
|
||||
AUDIO_HIGH_SYMBOL=${AUDIO_HIGH_SYMBOL:-''}
|
||||
|
||||
AUDIO_MED_THRESH=${AUDIO_MED_THRESH:-50}
|
||||
AUDIO_MED_SYMBOL=${AUDIO_MED_SYMBOL:-''}
|
||||
|
||||
AUDIO_LOW_THRESH=${AUDIO_LOW_THRESH:-0}
|
||||
AUDIO_LOW_SYMBOL=${AUDIO_LOW_SYMBOL:-''}
|
||||
|
||||
AUDIO_MUTED_SYMBOL=${AUDIO_MUTED_SYMBOL:-''}
|
||||
|
||||
. "/home/kevin/.cache/wal/colors.sh"
|
||||
# DEFAULT_COLOR=${DEFAULT_COLOR:-"#ffffff"}
|
||||
DEFAULT_COLOR="$color7"
|
||||
MUTED_COLOR=${MUTED_COLOR:-"#a0a0a0"}
|
||||
|
||||
USE_ALSA_NAME=${USE_ALSA_NAME:-0}
|
||||
USE_DESCRIPTION=${USE_DESCRIPTION:-0}
|
||||
|
||||
SUBSCRIBE=${SUBSCRIBE:-0}
|
||||
|
||||
MIXER=${MIXER:-""}
|
||||
SCONTROL=${SCONTROL:-""}
|
||||
|
||||
# }}} default vars #
|
||||
|
||||
AUDIO_DELTA=${AUDIO_DELTA:-5}
|
||||
|
||||
# LONG_FORMAT=${LONG_FORMAT:-'${SYMB} ${VOL}% [${INDEX}:${NAME}]'}
|
||||
LONG_FORMAT=${SHORT_FORMAT:-'${SINK_SYMB} ${VOL}%'}
|
||||
# SHORT_FORMAT=${SHORT_FORMAT:-'${SYMB} ${VOL}%[${INDEX}]'}
|
||||
SHORT_FORMAT=${SHORT_FORMAT:-'${SINK_SYMB} ${VOL}%[${INDEX}]'}
|
||||
|
||||
# flags {{{ #
|
||||
|
||||
while getopts F:Sf:adH:M:L:X:T:t:C:c:i:m:s:h opt; do
|
||||
case "$opt" in
|
||||
S) SUBSCRIBE=1 ;;
|
||||
F) LONG_FORMAT="$OPTARG" ;;
|
||||
f) SHORT_FORMAT="$OPTARG" ;;
|
||||
a) USE_ALSA_NAME=1 ;;
|
||||
d) USE_DESCRIPTION=1 ;;
|
||||
H) AUDIO_HIGH_SYMBOL="$OPTARG" ;;
|
||||
M) AUDIO_MED_SYMBOL="$OPTARG" ;;
|
||||
L) AUDIO_LOW_SYMBOL="$OPTARG" ;;
|
||||
X) AUDIO_MUTED_SYMBOL="$OPTARG" ;;
|
||||
T) AUDIO_MED_THRESH="$OPTARG" ;;
|
||||
t) AUDIO_LOW_THRESH="$OPTARG" ;;
|
||||
C) DEFAULT_COLOR="$OPTARG" ;;
|
||||
c) MUTED_COLOR="$OPTARG" ;;
|
||||
i) AUDIO_INTERVAL="$OPTARG" ;;
|
||||
m) MIXER="$OPTARG" ;;
|
||||
s) SCONTROL="$OPTARG" ;;
|
||||
h) printf \
|
||||
"Usage: volume-pulseaudio [-S] [-F format] [-f format] [-p] [-a|-d] [-H symb] [-M symb]
|
||||
[-L symb] [-X symb] [-T thresh] [-t thresh] [-C color] [-c color] [-i inter]
|
||||
[-m mixer] [-s scontrol] [-h]
|
||||
Options:
|
||||
-F, -f\tOutput format (-F long format, -f short format) to use, with exposed variables:
|
||||
\${SYMB}, \${VOL}, \${INDEX}, \${NAME}
|
||||
-S\tSubscribe to volume events (requires persistent block, always uses long format)
|
||||
-a\tUse ALSA name if possible
|
||||
-d\tUse device description instead of name if possible
|
||||
-H\tSymbol to use when audio level is high. Default: '$AUDIO_HIGH_SYMBOL'
|
||||
-M\tSymbol to use when audio level is medium. Default: '$AUDIO_MED_SYMBOL'
|
||||
-L\tSymbol to use when audio level is low. Default: '$AUDIO_LOW_SYMBOL'
|
||||
-X\tSymbol to use when audio is muted. Default: '$AUDIO_MUTED_SYMBOL'
|
||||
-T\tThreshold for medium audio level. Default: $AUDIO_MED_THRESH
|
||||
-t\tThreshold for low audio level. Default: $AUDIO_LOW_THRESH
|
||||
-C\tColor for non-muted audio. Default: $DEFAULT_COLOR
|
||||
-c\tColor for muted audio. Default: $MUTED_COLOR
|
||||
-i\tInterval size of volume increase/decrease. Default: $AUDIO_DELTA
|
||||
-m\tUse the given mixer.
|
||||
-s\tUse the given scontrol.
|
||||
-h\tShow this help text
|
||||
" && exit 0;;
|
||||
esac
|
||||
done
|
||||
|
||||
# }}} flags #
|
||||
|
||||
# functions {{{ #
|
||||
|
||||
if [[ -z "$MIXER" ]] ; then
|
||||
MIXER="default"
|
||||
if amixer -D pulse info >/dev/null 2>&1 ; then
|
||||
MIXER="pulse"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z "$SCONTROL" ]] ; then
|
||||
SCONTROL=$(amixer -D "$MIXER" scontrols | sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" | head -n1)
|
||||
fi
|
||||
|
||||
CAPABILITY=$(amixer -D $MIXER get $SCONTROL | sed -n "s/ Capabilities:.*cvolume.*/Capture/p")
|
||||
|
||||
|
||||
function move_sinks_to_new_default {
|
||||
DEFAULT_SINK=$1
|
||||
pacmd list-sink-inputs | grep index: | grep -o '[0-9]\+' | while read SINK
|
||||
do
|
||||
pacmd move-sink-input $SINK $DEFAULT_SINK
|
||||
done
|
||||
}
|
||||
|
||||
function set_default_playback_device_next {
|
||||
inc=${1:-1}
|
||||
num_devices=$(pacmd list-sinks | grep -c index:)
|
||||
sink_arr=($(pacmd list-sinks | grep index: | grep -o '[0-9]\+'))
|
||||
default_sink_index=$(( $(pacmd list-sinks | grep index: | grep -no '*' | grep -o '^[0-9]\+') - 1 ))
|
||||
default_sink_index=$(( ($default_sink_index + $num_devices + $inc) % $num_devices ))
|
||||
default_sink=${sink_arr[$default_sink_index]}
|
||||
pacmd set-default-sink $default_sink
|
||||
move_sinks_to_new_default $default_sink
|
||||
}
|
||||
|
||||
# }}} functions #
|
||||
|
||||
# triggers {{{ #
|
||||
|
||||
case "$BLOCK_BUTTON" in
|
||||
1) set_default_playback_device_next ;;
|
||||
2) amixer -q -D $MIXER sset $SCONTROL $CAPABILITY toggle ;;
|
||||
3) set_default_playback_device_next -1 ;;
|
||||
4) amixer -q -D $MIXER sset $SCONTROL $CAPABILITY $AUDIO_DELTA%+ ;;
|
||||
5) amixer -q -D $MIXER sset $SCONTROL $CAPABILITY $AUDIO_DELTA%- ;;
|
||||
esac
|
||||
|
||||
# }}} triggers #
|
||||
|
||||
# print_format {{{ #
|
||||
|
||||
function print_format {
|
||||
# echo $NAME
|
||||
case $NAME in
|
||||
*"USB"*)
|
||||
SINK_SYMB=""
|
||||
;;
|
||||
*"hdmi"*)
|
||||
SINK_SYMB=""
|
||||
;;
|
||||
*"pci"*)
|
||||
SINK_SYMB=""
|
||||
;;
|
||||
esac
|
||||
# echo "$1" | envsubst '${SYMB}${VOL}${INDEX}${NAME}'
|
||||
echo "$1" | envsubst '${SINK_SYMB}${VOL}${INDEX}${NAME}'
|
||||
}
|
||||
|
||||
# }}} print_format #
|
||||
|
||||
# print_block {{{ #
|
||||
|
||||
function print_block {
|
||||
for name in INDEX NAME VOL MUTED; do
|
||||
read $name
|
||||
done < <(pacmd list-sinks | grep "index:\|name:\|volume: front\|muted:" | grep -A3 '*')
|
||||
INDEX=$(echo "$INDEX" | grep -o '[0-9]\+')
|
||||
VOL=$(echo "$VOL" | grep -o "[0-9]*%" | head -1 )
|
||||
VOL="${VOL%?}"
|
||||
|
||||
NAME=$(echo "$NAME")
|
||||
# NAME=$(echo "$NAME" | sed \
|
||||
# 's/.*<.*\.\(.*\)>.*/\1/; t;'\
|
||||
# 's/.*<\(.*\)>.*/\1/; t;'\
|
||||
# 's/.*/unknown/')
|
||||
# NAME=$(echo "$NAME" | sed \
|
||||
# 's/.*<.*\.\(.*\)\..*>.*/\1/; t;')
|
||||
|
||||
if [[ $USE_ALSA_NAME == 1 ]] ; then
|
||||
ALSA_NAME=$(pacmd list-sinks |\
|
||||
awk '/^\s*\*/{f=1}/^\s*index:/{f=0}f' |\
|
||||
grep "alsa.name\|alsa.mixer_name" |\
|
||||
head -n1 |\
|
||||
sed 's/.*= "\(.*\)".*/\1/')
|
||||
NAME=${ALSA_NAME:-$NAME}
|
||||
elif [[ $USE_DESCRIPTION == 1 ]] ; then
|
||||
DESCRIPTION=$(pacmd list-sinks |\
|
||||
awk '/^\s*\*/{f=1}/^\s*index:/{f=0}f' |\
|
||||
grep "device.description" |\
|
||||
head -n1 |\
|
||||
sed 's/.*= "\(.*\)".*/\1/')
|
||||
NAME=${DESCRIPTION:-$NAME}
|
||||
fi
|
||||
|
||||
if [[ $MUTED =~ "no" ]] ; then
|
||||
SYMB=$AUDIO_HIGH_SYMBOL
|
||||
[[ $VOL -le $AUDIO_MED_THRESH ]] && SYMB=$AUDIO_MED_SYMBOL
|
||||
[[ $VOL -le $AUDIO_LOW_THRESH ]] && SYMB=$AUDIO_LOW_SYMBOL
|
||||
COLOR=$DEFAULT_COLOR
|
||||
else
|
||||
SYMB=$AUDIO_MUTED_SYMBOL
|
||||
COLOR=$MUTED_COLOR
|
||||
fi
|
||||
|
||||
if [[ $SUBSCRIBE == 1 ]] ; then
|
||||
print_format "$LONG_FORMAT"
|
||||
else
|
||||
print_format "$LONG_FORMAT"
|
||||
print_format "$SHORT_FORMAT"
|
||||
echo "$COLOR"
|
||||
fi
|
||||
}
|
||||
|
||||
# }}} print_block #
|
||||
|
||||
print_block
|
||||
if [[ $SUBSCRIBE == 1 ]] ; then
|
||||
while read -r EVENT; do
|
||||
print_block
|
||||
done < <(pactl subscribe | stdbuf -oL grep change)
|
||||
fi
|
||||
50
dot_config/i3blocks/scripts/executable_wifi
Normal file
50
dot_config/i3blocks/scripts/executable_wifi
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2014 Alexander Keller <github@nycroth.com>
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
INTERFACE="${BLOCK_INSTANCE:-wlan0}"
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
# As per #36 -- It is transparent: e.g. if the machine has no battery or wireless
|
||||
# connection (think desktop), the corresponding block should not be displayed.
|
||||
# [[ ! -d /sys/class/net/${INTERFACE}/wireless ]] ||
|
||||
# [[ "$(cat /sys/class/net/$INTERFACE/operstate)" = 'down' ]] && exit
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
QUALITY=$(sudo grep $INTERFACE /proc/net/wireless | awk '{ print int($3 * 100 / 70) }')
|
||||
W_inter=$(ip link | grep "[1-9]: wlp" | cut -d " " -f2 | tr -d ':')
|
||||
W_name=$(nmcli d | grep "$W_inter" | awk '{print $4}')
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
# echo $QUALITY% "$W_name" # full text
|
||||
# echo $QUALITY% # short text
|
||||
. "/home/kevin/.cache/wal/colors.sh"
|
||||
printf "%s%%\n\n%s\n" $QUALITY $color7
|
||||
|
||||
# color
|
||||
# if [[ $QUALITY -ge 80 ]]; then
|
||||
# echo "#00FF00"
|
||||
# elif [[ $QUALITY -lt 80 ]]; then
|
||||
# echo "#FFF600"
|
||||
# elif [[ $QUALITY -lt 60 ]]; then
|
||||
# echo "#FFAE00"
|
||||
# elif [[ $QUALITY -lt 40 ]]; then
|
||||
# echo "#FF0000"
|
||||
# fi
|
||||
23
dot_config/mpv/input.conf
Normal file
23
dot_config/mpv/input.conf
Normal file
@@ -0,0 +1,23 @@
|
||||
# volume
|
||||
WHEEL_UP add volume 1
|
||||
WHEEL_DOWN add volume -1
|
||||
|
||||
# speed
|
||||
r set speed 1.0
|
||||
g set speed 1.6
|
||||
s add speed -.2
|
||||
d add speed .2
|
||||
|
||||
# seek
|
||||
Shift+RIGHT seek 1
|
||||
Shift+LEFT seek -1
|
||||
RIGHT seek 3
|
||||
LEFT seek -3
|
||||
UP seek 10
|
||||
DOWN seek -10
|
||||
Shift+UP seek 60
|
||||
Shift+DOWN seek -60
|
||||
|
||||
# mark
|
||||
m revert-seek mark # mark position for revert-seek
|
||||
Shift+m revert-seek
|
||||
754
dot_config/neofetch/config.conf
Normal file
754
dot_config/neofetch/config.conf
Normal file
@@ -0,0 +1,754 @@
|
||||
# header {{{ #
|
||||
|
||||
# Neofetch config file
|
||||
# https://github.com/dylanaraps/neofetch
|
||||
|
||||
|
||||
# See this wiki page for more info:
|
||||
# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info
|
||||
print_info() {
|
||||
info title
|
||||
info underline
|
||||
|
||||
# }}} header #
|
||||
|
||||
# enabled {{{ #
|
||||
|
||||
info "Kernel" kernel
|
||||
info "Terminal" term
|
||||
info "Terminal Font" term_font
|
||||
info "Shell" shell
|
||||
info "Packages" packages
|
||||
info "WM" wm
|
||||
info "WM Theme" wm_theme
|
||||
# info "Font" font
|
||||
info "Theme" theme
|
||||
info "Icons" icons
|
||||
info "CPU" cpu
|
||||
info "CPU Usage" cpu_usage
|
||||
info "GPU" gpu
|
||||
info "GPU Driver" gpu_driver # Linux only
|
||||
info "Memory" memory
|
||||
info "Disk" disk
|
||||
info "Resolution" resolution
|
||||
|
||||
# }}} enabled #
|
||||
|
||||
# others {{{ #
|
||||
|
||||
# info "Song" song
|
||||
# info "Install Date" install_date
|
||||
# info "Host" model
|
||||
# info "Uptime" uptime
|
||||
# info "DE" de
|
||||
# info "Users" users
|
||||
# info "Battery" battery
|
||||
# info "Local IP" local_ip
|
||||
# info "Public IP" public_ip
|
||||
# info "Locale" locale # This only works on glibc systems.
|
||||
|
||||
# }}} others #
|
||||
|
||||
# options {{{ #
|
||||
|
||||
info line_break
|
||||
info cols
|
||||
info line_break
|
||||
}
|
||||
|
||||
|
||||
# Kernel
|
||||
|
||||
|
||||
# Shorten the output of the kernel function.
|
||||
#
|
||||
# Default: 'on'
|
||||
# Values: 'on', 'off'
|
||||
# Flag: --kernel_shorthand
|
||||
# Supports: Everything except *BSDs (except PacBSD and PC-BSD)
|
||||
#
|
||||
# Example:
|
||||
# on: '4.8.9-1-ARCH'
|
||||
# off: 'Linux 4.8.9-1-ARCH'
|
||||
kernel_shorthand="on"
|
||||
|
||||
|
||||
# Distro
|
||||
|
||||
|
||||
# Shorten the output of the distro function
|
||||
#
|
||||
# Default: 'off'
|
||||
# Values: 'on', 'off', 'tiny'
|
||||
# Flag: --distro_shorthand
|
||||
# Supports: Everything except Windows and Haiku
|
||||
distro_shorthand="off"
|
||||
|
||||
# Show/Hide OS Architecture.
|
||||
# Show 'x86_64', 'x86' and etc in 'Distro:' output.
|
||||
#
|
||||
# Default: 'on'
|
||||
# Values: 'on', 'off'
|
||||
# Flag: --os_arch
|
||||
#
|
||||
# Example:
|
||||
# on: 'Arch Linux x86_64'
|
||||
# off: 'Arch Linux'
|
||||
os_arch="off"
|
||||
|
||||
|
||||
# Uptime
|
||||
|
||||
|
||||
# Shorten the output of the uptime function
|
||||
#
|
||||
# Default: 'on'
|
||||
# Values: 'on', 'off', 'tiny'
|
||||
# Flag: --uptime_shorthand
|
||||
#
|
||||
# Example:
|
||||
# on: '2 days, 10 hours, 3 mins'
|
||||
# off: '2 days, 10 hours, 3 minutes'
|
||||
# tiny: '2d 10h 3m'
|
||||
uptime_shorthand="on"
|
||||
|
||||
|
||||
# Shell
|
||||
|
||||
|
||||
# Show the path to $SHELL
|
||||
#
|
||||
# Default: 'off'
|
||||
# Values: 'on', 'off'
|
||||
# Flag: --shell_path
|
||||
#
|
||||
# Example:
|
||||
# on: '/bin/bash'
|
||||
# off: 'bash'
|
||||
shell_path="off"
|
||||
|
||||
# Show $SHELL version
|
||||
#
|
||||
# Default: 'on'
|
||||
# Values: 'on', 'off'
|
||||
# Flag: --shell_version
|
||||
#
|
||||
# Example:
|
||||
# on: 'bash 4.4.5'
|
||||
# off: 'bash'
|
||||
shell_version="on"
|
||||
|
||||
|
||||
# CPU
|
||||
|
||||
|
||||
# CPU speed type
|
||||
#
|
||||
# Default: 'bios_limit'
|
||||
# Values: 'scaling_cur_freq', 'scaling_min_freq', 'scaling_max_freq', 'bios_limit'.
|
||||
# Flag: --speed_type
|
||||
# Supports: Linux with 'cpufreq'
|
||||
# NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value.
|
||||
# speed_type="bios_limit"
|
||||
speed_type="scaling_max_freq"
|
||||
|
||||
# CPU speed shorthand
|
||||
#
|
||||
# Default: 'off'
|
||||
# Values: 'on', 'off'.
|
||||
# Flag: --speed_shorthand.
|
||||
# NOTE: This flag is not supported in systems with CPU speed less than 1 GHz
|
||||
#
|
||||
# Example:
|
||||
# on: 'i7-6500U (4) @ 3.1GHz'
|
||||
# off: 'i7-6500U (4) @ 3.100GHz'
|
||||
speed_shorthand="on"
|
||||
|
||||
# Enable/Disable CPU brand in output.
|
||||
#
|
||||
# Default: 'on'
|
||||
# Values: 'on', 'off'
|
||||
# Flag: --cpu_brand
|
||||
#
|
||||
# Example:
|
||||
# on: 'Intel i7-6500U'
|
||||
# off: 'i7-6500U (4)'
|
||||
cpu_brand="on"
|
||||
|
||||
# CPU Speed
|
||||
# Hide/Show CPU speed.
|
||||
#
|
||||
# Default: 'on'
|
||||
# Values: 'on', 'off'
|
||||
# Flag: --cpu_speed
|
||||
#
|
||||
# Example:
|
||||
# on: 'Intel i7-6500U (4) @ 3.1GHz'
|
||||
# off: 'Intel i7-6500U (4)'
|
||||
cpu_speed="on"
|
||||
|
||||
# CPU Cores
|
||||
# Display CPU cores in output
|
||||
#
|
||||
# Default: 'logical'
|
||||
# Values: 'logical', 'physical', 'off'
|
||||
# Flag: --cpu_cores
|
||||
# Support: 'physical' doesn't work on BSD.
|
||||
#
|
||||
# Example:
|
||||
# logical: 'Intel i7-6500U (4) @ 3.1GHz' (All virtual cores)
|
||||
# physical: 'Intel i7-6500U (2) @ 3.1GHz' (All physical cores)
|
||||
# off: 'Intel i7-6500U @ 3.1GHz'
|
||||
cpu_cores="logical"
|
||||
|
||||
# CPU Temperature
|
||||
# Hide/Show CPU temperature.
|
||||
# Note the temperature is added to the regular CPU function.
|
||||
#
|
||||
# Default: 'off'
|
||||
# Values: 'C', 'F', 'off'
|
||||
# Flag: --cpu_temp
|
||||
# Supports: Linux, BSD
|
||||
# NOTE: For FreeBSD and NetBSD-based systems, you'll need to enable
|
||||
# coretemp kernel module. This only supports newer Intel processors.
|
||||
#
|
||||
# Example:
|
||||
# C: 'Intel i7-6500U (4) @ 3.1GHz [27.2°C]'
|
||||
# F: 'Intel i7-6500U (4) @ 3.1GHz [82.0°F]'
|
||||
# off: 'Intel i7-6500U (4) @ 3.1GHz'
|
||||
cpu_temp="on"
|
||||
|
||||
|
||||
# GPU
|
||||
|
||||
|
||||
# Enable/Disable GPU Brand
|
||||
#
|
||||
# Default: 'on'
|
||||
# Values: 'on', 'off'
|
||||
# Flag: --gpu_brand
|
||||
#
|
||||
# Example:
|
||||
# on: 'AMD HD 7950'
|
||||
# off: 'HD 7950'
|
||||
gpu_brand="on"
|
||||
|
||||
# Which GPU to display
|
||||
#
|
||||
# Default: 'all'
|
||||
# Values: 'all', 'dedicated', 'integrated'
|
||||
# Flag: --gpu_type
|
||||
# Supports: Linux
|
||||
#
|
||||
# Example:
|
||||
# all:
|
||||
# GPU1: AMD HD 7950
|
||||
# GPU2: Intel Integrated Graphics
|
||||
#
|
||||
# dedicated:
|
||||
# GPU1: AMD HD 7950
|
||||
#
|
||||
# integrated:
|
||||
# GPU1: Intel Integrated Graphics
|
||||
gpu_type="all"
|
||||
|
||||
|
||||
# Resolution
|
||||
|
||||
|
||||
# Display refresh rate next to each monitor
|
||||
# Default: 'off'
|
||||
# Values: 'on', 'off'
|
||||
# Flag: --refresh_rate
|
||||
# Supports: Doesn't work on Windows.
|
||||
#
|
||||
# Example:
|
||||
# on: '1920x1080 @ 60Hz'
|
||||
# off: '1920x1080'
|
||||
refresh_rate="off"
|
||||
|
||||
|
||||
# Gtk Theme / Icons / Font
|
||||
|
||||
|
||||
# Shorten output of GTK Theme / Icons / Font
|
||||
#
|
||||
# Default: 'off'
|
||||
# Values: 'on', 'off'
|
||||
# Flag: --gtk_shorthand
|
||||
#
|
||||
# Example:
|
||||
# on: 'Numix, Adwaita'
|
||||
# off: 'Numix [GTK2], Adwaita [GTK3]'
|
||||
gtk_shorthand="off"
|
||||
|
||||
|
||||
# Enable/Disable gtk2 Theme / Icons / Font
|
||||
#
|
||||
# Default: 'on'
|
||||
# Values: 'on', 'off'
|
||||
# Flag: --gtk2
|
||||
#
|
||||
# Example:
|
||||
# on: 'Numix [GTK2], Adwaita [GTK3]'
|
||||
# off: 'Adwaita [GTK3]'
|
||||
gtk2="on"
|
||||
|
||||
# Enable/Disable gtk3 Theme / Icons / Font
|
||||
#
|
||||
# Default: 'on'
|
||||
# Values: 'on', 'off'
|
||||
# Flag: --gtk3
|
||||
#
|
||||
# Example:
|
||||
# on: 'Numix [GTK2], Adwaita [GTK3]'
|
||||
# off: 'Numix [GTK2]'
|
||||
gtk3="on"
|
||||
|
||||
|
||||
# IP Address
|
||||
|
||||
|
||||
# Website to ping for the public IP
|
||||
#
|
||||
# Default: 'http://ident.me'
|
||||
# Values: 'url'
|
||||
# Flag: --ip_host
|
||||
public_ip_host="http://ident.me"
|
||||
|
||||
|
||||
# Disk
|
||||
|
||||
|
||||
# Which disks to display.
|
||||
# The values can be any /dev/sdXX, mount point or directory.
|
||||
# NOTE: By default we only show the disk info for '/'.
|
||||
#
|
||||
# Default: '/'
|
||||
# Values: '/', '/dev/sdXX', '/path/to/drive'.
|
||||
# Flag: --disk_show
|
||||
#
|
||||
# Example:
|
||||
# disk_show=('/' '/dev/sdb1'):
|
||||
# 'Disk (/): 74G / 118G (66%)'
|
||||
# 'Disk (/mnt/Videos): 823G / 893G (93%)'
|
||||
#
|
||||
# disk_show=('/'):
|
||||
# 'Disk (/): 74G / 118G (66%)'
|
||||
#
|
||||
# disk_show=('/' '/home' '/mnt/linux-files' )
|
||||
disk_show=('/dev/sda1' '/dev/sda3' '/dev/sdc2' )
|
||||
|
||||
# Disk subtitle.
|
||||
# What to append to the Disk subtitle.
|
||||
#
|
||||
# Default: 'mount'
|
||||
# Values: 'mount', 'name', 'dir'
|
||||
# Flag: --disk_subtitle
|
||||
#
|
||||
# Example:
|
||||
# name: 'Disk (/dev/sda1): 74G / 118G (66%)'
|
||||
# 'Disk (/dev/sdb2): 74G / 118G (66%)'
|
||||
#
|
||||
# mount: 'Disk (/): 74G / 118G (66%)'
|
||||
# 'Disk (/mnt/Local Disk): 74G / 118G (66%)'
|
||||
# 'Disk (/mnt/Videos): 74G / 118G (66%)'
|
||||
#
|
||||
# dir: 'Disk (/): 74G / 118G (66%)'
|
||||
# 'Disk (Local Disk): 74G / 118G (66%)'
|
||||
# 'Disk (Videos): 74G / 118G (66%)'
|
||||
disk_subtitle="mount"
|
||||
|
||||
|
||||
# Song
|
||||
|
||||
|
||||
# Print the Artist and Title on separate lines
|
||||
#
|
||||
# Default: 'off'
|
||||
# Values: 'on', 'off'
|
||||
# Flag: --song_shorthand
|
||||
#
|
||||
# Example:
|
||||
# on: 'Artist: The Fratellis'
|
||||
# 'Song: Chelsea Dagger'
|
||||
#
|
||||
# off: 'Song: The Fratellis - Chelsea Dagger'
|
||||
song_shorthand="off"
|
||||
|
||||
|
||||
# Install Date
|
||||
|
||||
|
||||
# Whether to show the time in the output
|
||||
#
|
||||
# Default: 'on'
|
||||
# Values: 'on', 'off'
|
||||
# Flag: --install_time
|
||||
#
|
||||
# Example:
|
||||
# on: 'Thu 14 Apr 2016 11:50 PM'
|
||||
# off: 'Thu 14 Apr 2016'
|
||||
install_time="off"
|
||||
|
||||
# Set time format in the output
|
||||
#
|
||||
# Default: '24h'
|
||||
# Values: '12h', '24h'
|
||||
# Flag: --install_time_format
|
||||
#
|
||||
# Example:
|
||||
# 12h: 'Thu 14 Apr 2016 11:50 PM'
|
||||
# 24h: 'Thu 14 Apr 2016 23:50'
|
||||
install_time_format="24h"
|
||||
|
||||
|
||||
# Text Colors
|
||||
|
||||
|
||||
# Text Colors
|
||||
#
|
||||
# Default: 'distro'
|
||||
# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num'
|
||||
# Flag: --colors
|
||||
#
|
||||
# Each number represents a different part of the text in
|
||||
# this order: 'title', '@', 'underline', 'subtitle', 'colon', 'info'
|
||||
#
|
||||
# Example:
|
||||
# colors=(distro) - Text is colored based on Distro colors.
|
||||
# colors=(4 6 1 8 8 6) - Text is colored in the order above.
|
||||
colors=(distro)
|
||||
|
||||
|
||||
# Text Options
|
||||
|
||||
|
||||
# Toggle bold text
|
||||
#
|
||||
# Default: 'on'
|
||||
# Values: 'on', 'off'
|
||||
# Flag: --bold
|
||||
bold="on"
|
||||
|
||||
# Enable/Disable Underline
|
||||
#
|
||||
# Default: 'on'
|
||||
# Values: 'on', 'off'
|
||||
# Flag: --underline
|
||||
underline_enabled="on"
|
||||
|
||||
# Underline character
|
||||
#
|
||||
# Default: '-'
|
||||
# Values: 'string'
|
||||
# Flag: --underline_char
|
||||
underline_char="-"
|
||||
|
||||
|
||||
# Color Blocks
|
||||
|
||||
|
||||
# Color block range
|
||||
# The range of colors to print.
|
||||
#
|
||||
# Default: '0', '7'
|
||||
# Values: 'num'
|
||||
# Flag: --block_range
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# Display colors 0-7 in the blocks. (8 colors)
|
||||
# neofetch --block_range 0 7
|
||||
#
|
||||
# Display colors 0-15 in the blocks. (16 colors)
|
||||
# neofetch --block_range 0 15
|
||||
block_range=(0 7)
|
||||
|
||||
# Toggle color blocks
|
||||
#
|
||||
# Default: 'on'
|
||||
# Values: 'on', 'off'
|
||||
# Flag: --color_blocks
|
||||
color_blocks="on"
|
||||
|
||||
# Color block width in spaces
|
||||
#
|
||||
# Default: '3'
|
||||
# Values: 'num'
|
||||
# Flag: --block_width
|
||||
block_width=3
|
||||
|
||||
# Color block height in lines
|
||||
#
|
||||
# Default: '1'
|
||||
# Values: 'num'
|
||||
# Flag: --block_height
|
||||
block_height=1
|
||||
|
||||
|
||||
# Progress Bars
|
||||
|
||||
|
||||
# Bar characters
|
||||
#
|
||||
# Default: '-', '='
|
||||
# Values: 'string', 'string'
|
||||
# Flag: --bar_char
|
||||
#
|
||||
# Example:
|
||||
# neofetch --bar_char 'elapsed' 'total'
|
||||
# neofetch --bar_char '-' '='
|
||||
bar_char_elapsed="-"
|
||||
bar_char_total="="
|
||||
|
||||
# Toggle Bar border
|
||||
#
|
||||
# Default: 'on'
|
||||
# Values: 'on', 'off'
|
||||
# Flag: --bar_border
|
||||
bar_border="on"
|
||||
|
||||
# Progress bar length in spaces
|
||||
# Number of chars long to make the progress bars.
|
||||
#
|
||||
# Default: '15'
|
||||
# Values: 'num'
|
||||
# Flag: --bar_length
|
||||
bar_length=15
|
||||
|
||||
# Progress bar colors
|
||||
# When set to distro, uses your distro's logo colors.
|
||||
#
|
||||
# Default: 'distro', 'distro'
|
||||
# Values: 'distro', 'num'
|
||||
# Flag: --bar_colors
|
||||
#
|
||||
# Example:
|
||||
# neofetch --bar_colors 3 4
|
||||
# neofetch --bar_colors distro 5
|
||||
bar_color_elapsed="distro"
|
||||
bar_color_total="distro"
|
||||
|
||||
|
||||
# Info display
|
||||
# Display a bar with the info.
|
||||
#
|
||||
# Default: 'off'
|
||||
# Values: 'bar', 'infobar', 'barinfo', 'off'
|
||||
# Flags: --cpu_display
|
||||
# --memory_display
|
||||
# --battery_display
|
||||
# --disk_display
|
||||
#
|
||||
# Example:
|
||||
# bar: '[---=======]'
|
||||
# infobar: 'info [---=======]'
|
||||
# barinfo: '[---=======] info'
|
||||
# off: 'info'
|
||||
cpu_display="off"
|
||||
memory_display="off"
|
||||
# cpu_display="barinfo"
|
||||
# memory_display="barinfo"
|
||||
battery_display="off"
|
||||
disk_display="off"
|
||||
# disk_display="barinfo"
|
||||
|
||||
|
||||
# Backend Settings
|
||||
|
||||
|
||||
# Image backend.
|
||||
#
|
||||
# Default: 'ascii'
|
||||
# Values: 'ascii', 'caca', 'catimg', 'jp2a', 'iterm2', 'off', 'tycat', 'w3m'
|
||||
# Flag: --backend
|
||||
image_backend="ascii"
|
||||
# image_backend="jp2a"
|
||||
|
||||
# Image Source
|
||||
#
|
||||
# Which image or ascii file to display.
|
||||
#
|
||||
# Default: 'auto'
|
||||
# Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/'
|
||||
# Flag: --source
|
||||
#
|
||||
# NOTE: 'auto' will pick the best image source for whatever image backend is used.
|
||||
# In ascii mode, distro ascii art will be used and in an image mode, your
|
||||
# wallpaper will be used.
|
||||
image_source="auto"
|
||||
# image_source="$HOME/Downloads/arch.png"
|
||||
|
||||
|
||||
# Ascii Options
|
||||
|
||||
|
||||
# Ascii distro
|
||||
# Which distro's ascii art to display.
|
||||
#
|
||||
# Default: 'auto'
|
||||
# Values: 'auto', 'distro_name'
|
||||
# Flag: --ascii_distro
|
||||
#
|
||||
# NOTE: Arch and Ubuntu have 'old' logo variants.
|
||||
# Change this to 'arch_old' or 'ubuntu_old' to use the old logos.
|
||||
# NOTE: Ubuntu has flavor variants.
|
||||
# Change this to 'Lubuntu', 'Xubuntu', 'Ubuntu-GNOME' or 'Ubuntu-Budgie' to use the flavors.
|
||||
# NOTE: Arch, Crux and Gentoo have a smaller logo variant.
|
||||
# Change this to 'arch_small', 'crux_small' or 'gentoo_small' to use the small logos.
|
||||
ascii_distro="auto"
|
||||
|
||||
# Ascii Colors
|
||||
#
|
||||
# Default: 'distro'
|
||||
# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num'
|
||||
# Flag: --ascii_colors
|
||||
#
|
||||
# Example:
|
||||
# ascii_colors=(distro) - Ascii is colored based on Distro colors.
|
||||
# ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors.
|
||||
ascii_colors=(distro)
|
||||
|
||||
# Bold ascii logo
|
||||
# Whether or not to bold the ascii logo.
|
||||
#
|
||||
# Default: 'on'
|
||||
# Values: 'on', 'off'
|
||||
# Flag: --ascii_bold
|
||||
ascii_bold="on"
|
||||
|
||||
|
||||
# Image Options
|
||||
|
||||
|
||||
# Image loop
|
||||
# Setting this to on will make neofetch redraw the image constantly until
|
||||
# Ctrl+C is pressed. This fixes display issues in some terminal emulators.
|
||||
#
|
||||
# Default: 'off'
|
||||
# Values: 'on', 'off'
|
||||
# Flag: --loop
|
||||
image_loop="off"
|
||||
|
||||
# Thumbnail directory
|
||||
#
|
||||
# Default: '~/.cache/thumbnails/neofetch'
|
||||
# Values: 'dir'
|
||||
thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch"
|
||||
|
||||
# Crop mode
|
||||
#
|
||||
# Default: 'normal'
|
||||
# Values: 'normal', 'fit', 'fill'
|
||||
# Flag: --crop_mode
|
||||
#
|
||||
# See this wiki page to learn about the fit and fill options.
|
||||
# https://github.com/dylanaraps/neofetch/wiki/What-is-Waifu-Crop%3F
|
||||
crop_mode="normal"
|
||||
|
||||
# Crop offset
|
||||
# Note: Only affects 'normal' crop mode.
|
||||
#
|
||||
# Default: 'center'
|
||||
# Values: 'northwest', 'north', 'northeast', 'west', 'center'
|
||||
# 'east', 'southwest', 'south', 'southeast'
|
||||
# Flag: --crop_offset
|
||||
crop_offset="center"
|
||||
|
||||
# Image size
|
||||
# The image is half the terminal width by default.
|
||||
#
|
||||
# Default: 'auto'
|
||||
# Values: 'auto', '00px', '00%', 'none'
|
||||
# Flags: --image_size
|
||||
# --size
|
||||
image_size="auto"
|
||||
|
||||
# Ggap between image and text
|
||||
#
|
||||
# Default: '3'
|
||||
# Values: 'num', '-num'
|
||||
# Flag: --gap
|
||||
gap=3
|
||||
|
||||
# Image offsets
|
||||
# Only works with the w3m backend.
|
||||
#
|
||||
# Default: '0'
|
||||
# Values: 'px'
|
||||
# Flags: --xoffset
|
||||
# --yoffset
|
||||
yoffset=0
|
||||
xoffset=0
|
||||
|
||||
# Image background color
|
||||
# Only works with the w3m backend.
|
||||
#
|
||||
# Default: ''
|
||||
# Values: 'color', 'blue'
|
||||
# Flag: --bg_color
|
||||
background_color=
|
||||
|
||||
|
||||
# Scrot Options
|
||||
|
||||
|
||||
# Whether or not to always take a screenshot
|
||||
# You can manually take a screenshot with "--scrot" or "-s"
|
||||
#
|
||||
# Default: 'off'
|
||||
# Values: 'on', 'off'
|
||||
# Flags: --scrot
|
||||
# -s
|
||||
scrot="off"
|
||||
|
||||
# Screenshot Program
|
||||
# Neofetch will automatically use whatever screenshot tool
|
||||
# is installed on your system.
|
||||
#
|
||||
# If 'neofetch -v' says that it couldn't find a screenshot
|
||||
# tool or you're using a custom tool then you can change
|
||||
# the option below to a custom command.
|
||||
#
|
||||
# Default: 'auto'
|
||||
# Values: 'auto' 'cmd -flags'
|
||||
# Flag: --scrot_cmd
|
||||
scrot_cmd="auto"
|
||||
|
||||
# Screenshot Filename
|
||||
# What to name the screenshots
|
||||
#
|
||||
# Default: 'neofetch-$(date +%F-%I-%M-%S-${RANDOM}).png'
|
||||
# Values: 'string'
|
||||
# Flag: --scrot_name
|
||||
scrot_name="neofetch-$(date +%F-%I-%M-%S-${RANDOM}).png"
|
||||
|
||||
# Image upload host
|
||||
# Where to upload the image.
|
||||
#
|
||||
# Default: 'teknik'
|
||||
# Values: 'imgur', 'teknik'
|
||||
# Flag: --image_host
|
||||
#
|
||||
# NOTE: If you'd like another image host to be added to Neofetch.
|
||||
# Open an issue on github.
|
||||
image_host="teknik"
|
||||
|
||||
|
||||
# Misc Options
|
||||
|
||||
# Stdout mode
|
||||
# Turn off all colors and disables image backend (ASCII/Image).
|
||||
# Useful for piping into another command.
|
||||
# Default: 'off'
|
||||
# Values: 'on', 'off'
|
||||
stdout="off"
|
||||
|
||||
# Config version.
|
||||
#
|
||||
# NOTE: Don't change this value, neofetch reads this to determine
|
||||
# how to handle backwards compatibility.
|
||||
config_version="3.3.0"
|
||||
|
||||
# }}} options #
|
||||
208
dot_config/private_fish/completions/watson.fish
Normal file
208
dot_config/private_fish/completions/watson.fish
Normal file
@@ -0,0 +1,208 @@
|
||||
# copy this into ~/.config/fish/completions/ to enable autocomplete for the watson time tracker
|
||||
|
||||
function __fish_watson_needs_sub -d "provides a list of sub commands"
|
||||
set cmd (commandline -opc)
|
||||
if [ (count $cmd) -eq 1 -a $cmd[1] = 'watson' ]
|
||||
return 0
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
function __fish_watson_using_command -d "determine if watson is using the passed command"
|
||||
set cmd (commandline -opc)
|
||||
if [ (count $cmd) -ge 2 -a $cmd[1] = 'watson' ]
|
||||
if [ $argv[1] = $cmd[2] ]
|
||||
return 0
|
||||
end
|
||||
return 1
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
function __fish_watson_set_cache_vars -d "set vars used for caches"
|
||||
if test -n "$WATSON_DIR"
|
||||
set -g _watson_dir $WATSON_DIR
|
||||
else
|
||||
# TODO: set dir for Darwin (not sure how to do regex in fish) #
|
||||
set -g _watson_dir "$HOME/.config/watson"
|
||||
end
|
||||
set -g _watson_frame_file "$_watson_dir/frames"
|
||||
set -g _watson_projects_cache "$_watson_dir/projects_cache"
|
||||
set -g _watson_tags_cache "$_watson_dir/tags_cache"
|
||||
set -g _watson_frames_cache "$_watson_dir/frames_cache"
|
||||
end
|
||||
|
||||
function __get_date_num -d "return last modified time of file"
|
||||
date -r $argv[1] +%s
|
||||
end
|
||||
|
||||
function __fish_watson_check_if_refresh_cache -d "see if cache file needs refreshing"
|
||||
if begin not test -e $argv[1];
|
||||
or test (__get_date_num $_watson_frame_file) \
|
||||
-gt (__get_date_num $argv[1]); end
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
end
|
||||
end
|
||||
|
||||
function __fish_watson_get_projects -d "return a list of projects"
|
||||
__fish_watson_set_cache_vars
|
||||
__fish_watson_check_if_refresh_cache $_watson_projects_cache
|
||||
# if test $status -eq 1
|
||||
# command watson projects | tee $_watson_projects_cache
|
||||
# else
|
||||
# cat $_watson_projects_cache
|
||||
# end
|
||||
cat $_watson_projects_cache
|
||||
end
|
||||
|
||||
function __fish_watson_get_tags -d "return a list of tags"
|
||||
__fish_watson_set_cache_vars
|
||||
__fish_watson_check_if_refresh_cache $_watson_tags_cache
|
||||
# if test $status -eq 1
|
||||
# command watson tags | tee $_watson_tags_cache
|
||||
# else
|
||||
# cat $_watson_tags_cache
|
||||
# end
|
||||
cat $_watson_tags_cache
|
||||
end
|
||||
|
||||
function __fish_watson_get_frames -d "return a list of frames" #TODO, use watson logs to get more info
|
||||
__fish_watson_set_cache_vars
|
||||
__fish_watson_check_if_refresh_cache $_watson_frames_cache
|
||||
if test $status -eq 1
|
||||
command watson frames | tee $_watson_frames_cache
|
||||
else
|
||||
cat $_watson_frames_cache
|
||||
end
|
||||
end
|
||||
|
||||
function __fish_watson_has_project -d "determine if watson is using a passed command and if it has a project"
|
||||
set cmd (commandline -opc)
|
||||
if [ (count $cmd) -gt 2 -a $cmd[1] = 'watson' ]
|
||||
if [ $argv[1] = $cmd[2] ]
|
||||
if contains "$cmd[3]" (__fish_watson_get_projects)
|
||||
return 0
|
||||
end
|
||||
end
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
function __fish_watson_has_from -d "determine if watson is using a passed command and if it is using from"
|
||||
set cmd (commandline -opc)
|
||||
if [ (count $cmd) -gt 2 -a $cmd[1] = 'watson' ]
|
||||
if [ $argv[1] = $cmd[2] ]
|
||||
if contains -- "$cmd[3]" -f --from
|
||||
return 0
|
||||
end
|
||||
end
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
function __fish_watson_needs_project -d "check if we need a project"
|
||||
set cmd (commandline -opc)
|
||||
if [ (count $cmd) -ge 2 -a $cmd[1] = 'watson' ]
|
||||
if [ $argv[1] = $cmd[2] ]
|
||||
for i in $cmd
|
||||
if contains $i (__fish_watson_get_projects)
|
||||
return 1 # return 1 because we alredy have a project
|
||||
end
|
||||
end
|
||||
return 0 # we are using $argv as our command and the command does not contain any projects
|
||||
end
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
# if a backend.url is set, use it in the command description
|
||||
if [ -e ~/.config/watson/config ]
|
||||
set url_string (command watson config backend.url 2> /dev/null)
|
||||
if test -n "$url_string"
|
||||
set url $url_string
|
||||
end
|
||||
else
|
||||
set url "a remote Crick server"
|
||||
end
|
||||
|
||||
# ungrouped
|
||||
complete -f -c watson -n '__fish_watson_needs_sub' -a cancel -d "Cancel the last start command"
|
||||
complete -f -c watson -n '__fish_watson_needs_sub' -a stop -d " Stop monitoring time for the current project"
|
||||
complete -f -c watson -n '__fish_watson_needs_sub' -a frames -d "Display the list of all frame IDs"
|
||||
complete -f -c watson -n '__fish_watson_needs_sub' -a help -d "Display help information"
|
||||
complete -f -c watson -n '__fish_watson_needs_sub' -a projects -d "Display the list of projects"
|
||||
complete -f -c watson -n '__fish_watson_needs_sub' -a tags -d "Display the list of tags"
|
||||
complete -f -c watson -n '__fish_watson_needs_sub' -a sync -d "sync your work with $url"
|
||||
|
||||
# config
|
||||
complete -f -c watson -n '__fish_watson_needs_sub' -a config -d "Get and set configuration options"
|
||||
complete -f -c watson -n '__fish_watson_using_command config' -s e -l edit -d "Edit the config with an editor"
|
||||
|
||||
# edit
|
||||
complete -f -c watson -n '__fish_watson_needs_sub' -a edit -d "Edit a frame"
|
||||
complete -f -c watson -n '__fish_watson_using_command edit' -a "(__fish_watson_get_frames)"
|
||||
|
||||
# log
|
||||
complete -f -c watson -n '__fish_watson_needs_sub' -a log -d "Display sessions during the given timespan"
|
||||
complete -f -c watson -n '__fish_watson_using_command log' -s c -l current -d "include the running frame"
|
||||
complete -f -c watson -n '__fish_watson_using_command log' -s C -l no-current -d "exclude the running frame (default)"
|
||||
complete -f -c watson -n '__fish_watson_using_command log' -s f -l from -d "Start date for log"
|
||||
complete -f -c watson -n '__fish_watson_has_from log' -s t -l to -d "end date for log"
|
||||
complete -f -c watson -n '__fish_watson_using_command log' -s y -l year -d "show the last year"
|
||||
complete -f -c watson -n '__fish_watson_using_command log' -s m -l month -d "show the last month"
|
||||
complete -f -c watson -n '__fish_watson_using_command log' -s w -l week -d "show week-to-day"
|
||||
complete -f -c watson -n '__fish_watson_using_command log' -s d -l day -d "show today"
|
||||
complete -f -c watson -n '__fish_watson_using_command log' -s a -l all -d "show all"
|
||||
complete -f -c watson -n '__fish_watson_using_command log' -s p -l project -d "restrict to project" -a "(__fish_watson_get_projects)"
|
||||
complete -f -c watson -n '__fish_watson_using_command log' -s T -l tag -d "restrict to tag" -a "(__fish_watson_get_tags)"
|
||||
complete -f -c watson -n '__fish_watson_using_command log' -s j -l json -d "output json"
|
||||
complete -f -c watson -n '__fish_watson_using_command log' -s g -l pager -d "view through pager"
|
||||
complete -f -c watson -n '__fish_watson_using_command log' -s G -l no-pager -d "don't vew through pager"
|
||||
|
||||
# merge
|
||||
complete -f -c watson -n '__fish_watson_needs_sub' -a merge -d "merge existing frames with conflicting ones"
|
||||
complete -f -c watson -n '__fish_watson_using_command merge' -s f -l force -d "silently merge"
|
||||
|
||||
# remove
|
||||
complete -f -c watson -n '__fish_watson_needs_sub' -a remove -d "Remove a frame"
|
||||
complete -f -c watson -n '__fish_watson_using_command remove' -a "(__fish_watson_get_frames)"
|
||||
complete -f -c watson -n '__fish_watson_using_command remove' -s f -l force -d "silently remove"
|
||||
|
||||
# rename
|
||||
complete -f -c watson -n '__fish_watson_needs_sub' -a rename -d "Rename a project or tag"
|
||||
complete -f -c watson -n '__fish_watson_using_command rename' -a "(__fish_watson_get_projects) (__fish_watson_get_tags)"
|
||||
|
||||
# report
|
||||
complete -f -c watson -n '__fish_watson_needs_sub' -a report -d "Display a report of time spent"
|
||||
complete -f -c watson -n '__fish_watson_using_command report' -s c -l current -d "include the running frame"
|
||||
complete -f -c watson -n '__fish_watson_using_command report' -s C -l no-current -d "exclude the running frame (default)"
|
||||
complete -f -c watson -n '__fish_watson_using_command report' -s f -l from -d "Start date for report"
|
||||
complete -f -c watson -n '__fish_watson_has_from report' -s t -l to -d "end date for report"
|
||||
complete -f -c watson -n '__fish_watson_using_command report' -s y -l year -d "show the last year"
|
||||
complete -f -c watson -n '__fish_watson_using_command report' -s m -l month -d "show the last month"
|
||||
complete -f -c watson -n '__fish_watson_using_command report' -s w -l week -d "show week-to-day"
|
||||
complete -f -c watson -n '__fish_watson_using_command report' -s d -l day -d "show today"
|
||||
complete -f -c watson -n '__fish_watson_using_command report' -s a -l all -d "show all"
|
||||
complete -f -c watson -n '__fish_watson_using_command report' -s p -l project -d "restrict to project" -a "(__fish_watson_get_projects)"
|
||||
complete -f -c watson -n '__fish_watson_using_command report' -s T -l tag -d "restrict to tag" -a "(__fish_watson_get_tags)"
|
||||
complete -f -c watson -n '__fish_watson_using_command report' -s j -l json -d "output json"
|
||||
complete -f -c watson -n '__fish_watson_using_command report' -s g -l pager -d "view through pager"
|
||||
complete -f -c watson -n '__fish_watson_using_command report' -s G -l no-pager -d "don't vew through pager"
|
||||
|
||||
complete -f -c watson -n '__fish_watson_needs_sub' -a restart -d "Restart monitoring time for a stopped project"
|
||||
complete -f -c watson -n '__fish_watson_using_command restart' -s s -l stop -d "stop running project"
|
||||
complete -f -c watson -n '__fish_watson_using_command restart' -s S -l no-stop -d "do not stop running project"
|
||||
complete -f -c watson -n '__fish_watson_using_command restart' -a "(__fish_watson_get_frames)"
|
||||
|
||||
# start
|
||||
complete -f -c watson -n '__fish_watson_needs_sub' -a start -d "Start monitoring time for a project"
|
||||
complete -f -c watson -n '__fish_watson_needs_project start' -a "(__fish_watson_get_projects)"
|
||||
complete -f -c watson -n '__fish_watson_has_project start' -a "+(__fish_watson_get_tags)"
|
||||
|
||||
# status
|
||||
complete -f -c watson -n '__fish_watson_needs_sub' -a status -d "Display when the current project was started and time spent"
|
||||
complete -f -c watson -n '__fish_watson_using_command status' -s p -l project -d "only show project"
|
||||
complete -f -c watson -n '__fish_watson_using_command status' -s t -l tags -d "only show tags"
|
||||
complete -f -c watson -n '__fish_watson_using_command status' -s e -l elapsed -d "only show elapsed time"
|
||||
109
dot_config/private_fish/config.fish
Normal file
109
dot_config/private_fish/config.fish
Normal file
@@ -0,0 +1,109 @@
|
||||
# login to X {{{ #
|
||||
|
||||
if status is-login
|
||||
if test -z "$DISPLAY" -a $XDG_VTNR = 1
|
||||
exec startx -- -keeptty
|
||||
end
|
||||
end
|
||||
set -x GPG_TTY (tty)
|
||||
|
||||
# }}} login to X #
|
||||
|
||||
# fish-specific {{{ #
|
||||
|
||||
fish_vi_key_bindings
|
||||
set -x EDITOR nvim
|
||||
set -x VISUAL nvim
|
||||
set -U fish_help_browser firefox
|
||||
|
||||
builtin cd $last_dir
|
||||
bind \ce edit_command_buffer
|
||||
bind \cr forward-word
|
||||
|
||||
/home/kevin/linux-config/scripts/sync-shortcuts
|
||||
source /home/kevin/.config/fish/key_abbr.fish
|
||||
set -U fish_fxn_dir "/home/kevin/linux-config/fish/.config/fish/functions"
|
||||
abbr ff "cd $fish_fxn_dir"
|
||||
for fxn in (find $fish_fxn_dir -name '*.fish')
|
||||
source $fxn
|
||||
end
|
||||
abbr rf "source ~/.config/fish/config.fish"
|
||||
abbr rfs "sync-shortcuts && source ~/.config/fish/config.fish"
|
||||
abbr xf "fish_config"
|
||||
abbr f. "cd .."
|
||||
abbr f.. "cd ../.."
|
||||
abbr mt "math"
|
||||
|
||||
# }}} fish-specific #
|
||||
|
||||
# universal var's {{{ #
|
||||
|
||||
# spv
|
||||
set -U spv_dir "/home/kevin/coding/spotify-lib-vis"
|
||||
set -U mfs_dir "/home/kevin/coding/mf-site"
|
||||
|
||||
# set -U PATH /usr/local/sbin /usr/local/bin /usr/bin /usr/bin/site_perl
|
||||
# /usr/bin/vendor_perl /usr/bin/core_perl /home/kevin/linux-config/scripts
|
||||
# /home/kevin/linux-config/scripts/colors
|
||||
# (ruby -e 'print Gem.user_dir')/bin
|
||||
set -x PATH $PATH /home/kevin/linux-config/scripts /home/kevin/linux-config/scripts/colors /home/kevin/go/bin
|
||||
set -x PASSWORD_STORE_CLIP_TIME 120
|
||||
set -xU XSET_RATE 90
|
||||
set -xU XSET_DELAY 200
|
||||
# causes xmodmap to have issues when opening terminal sometimes
|
||||
# xmodmap ~/.Xmodmap && xset r rate $XSET_DELAY $XSET_RATE
|
||||
# xset r rate $XSET_DELAY $XSET_RATE
|
||||
|
||||
set -U BROWSER "chromium"
|
||||
|
||||
# }}} universal var's #
|
||||
|
||||
# fxn abbr's {{{ #
|
||||
|
||||
abbr ag "grep-aliases"
|
||||
abbr bq "benq-brightness"
|
||||
abbr cpc "copy cat"
|
||||
abbr cpe "copy echo"
|
||||
abbr cpp "copy echo (pwd)"
|
||||
abbr cff "create-fish-function"
|
||||
abbr ev "evince-silent"
|
||||
# git {{{ #
|
||||
|
||||
abbr gcamp "git-amend-push"
|
||||
abbr gdf "git-diff-files"
|
||||
abbr gpsmt "git-push-multiple"
|
||||
abbr gremotes "git-mult-remotes"
|
||||
abbr grmb "git-delete-branch"
|
||||
|
||||
# }}} git #
|
||||
abbr hs "scan-history"
|
||||
abbr hst "$EDITOR ~/.local/share/fish/fish_history"
|
||||
abbr pgr "grep-pdf"
|
||||
abbr pgrf "grep-pdf-file"
|
||||
abbr rs "redshift-set"
|
||||
abbr ut "unix-timestamp"
|
||||
abbr uzr "unzip-rm"
|
||||
|
||||
# }}} fxn abbr's #
|
||||
|
||||
abbr hm "cd $mfs_dir && hugo serve -D --disableFastRender"
|
||||
|
||||
# school {{{ #
|
||||
|
||||
# 309
|
||||
# abbr r0t "./revert-e3-json restaurants"
|
||||
# abbr r0s "./revert-e3-json reservations"
|
||||
|
||||
# 369
|
||||
abbr grc "grep-c"
|
||||
abbr grh "grep-headers"
|
||||
abbr rgh "rg-headers"
|
||||
|
||||
abbr r6 "run-a4 h e"
|
||||
|
||||
# abbr r6 "run-a3 f d o"
|
||||
# abbr r6g "run-a3 f d g"
|
||||
# abbr r6s "run-a3 s c o"
|
||||
# abbr g6 "source $fish_fxn_dir/369/a3/gdb-a3-break.fish && gdb-a3-break c c"
|
||||
|
||||
# }}} school #
|
||||
@@ -0,0 +1,5 @@
|
||||
function carsim
|
||||
printf '\033c'
|
||||
# and ./carsim stop $argv[1] $argv[2]
|
||||
and ./carsim light $argv[1] $argv[2]
|
||||
end
|
||||
15
dot_config/private_fish/private_functions/369/a2/gdb-a2.fish
Normal file
15
dot_config/private_fish/private_functions/369/a2/gdb-a2.fish
Normal file
@@ -0,0 +1,15 @@
|
||||
function gdb-a2
|
||||
# gdb -ex "b safeStopSign.c:96" -ex "run" \
|
||||
# gdb -ex "b safeTrafficLight.c:98" -ex "run" \
|
||||
gdb -ex "run" -ex "bt" \
|
||||
# gdb -ex "run" \
|
||||
# -ex "p cur_lane_queue.count" \
|
||||
# -ex "p cur_front->car->index" \
|
||||
# -ex "p cur_front->car" \
|
||||
# -ex "p cur_front" \
|
||||
# --args ./carsim stop 1 4
|
||||
# --args ./carsim stop 3 20
|
||||
# --args ./carsim light 1 4
|
||||
--args ./carsim light 1 20
|
||||
# gdb -ex "b safeStopSign.c:86" -ex "run" --args ./carsim stop 1 10
|
||||
end
|
||||
@@ -0,0 +1,30 @@
|
||||
function gdb-a3-break
|
||||
# 1 = trace file, 2 = alg
|
||||
set trace_file 'traceprogs/tr-custom.ref'
|
||||
set memsize 3
|
||||
set swapsize 10
|
||||
if test $argv[1] = 's'
|
||||
set trace_file 'traceprogs/tr-simpleloop.ref'
|
||||
set memsize 50
|
||||
set swapsize 3000
|
||||
end
|
||||
|
||||
set alg 'rand'
|
||||
switch $argv[2]
|
||||
case f
|
||||
set alg 'fifo'
|
||||
case l
|
||||
set alg 'lru'
|
||||
case c
|
||||
set alg 'clock'
|
||||
end
|
||||
|
||||
printf '\033c'
|
||||
and bear make
|
||||
and gdb \
|
||||
# -ex "b pagetable.c:69" \
|
||||
# -ex "b sim.c:158" \
|
||||
-ex "b clock.c:29" \
|
||||
-ex "run" \
|
||||
--args ./sim -f $trace_file -m $memsize -s $swapsize -a $alg
|
||||
end
|
||||
49
dot_config/private_fish/private_functions/369/a3/run-a3.fish
Normal file
49
dot_config/private_fish/private_functions/369/a3/run-a3.fish
Normal file
@@ -0,0 +1,49 @@
|
||||
function run-a3
|
||||
# 1 = alg, 2 = trace file, 3 = output
|
||||
|
||||
set memsize 3
|
||||
set swapsize 10
|
||||
set alg 'rand'
|
||||
switch $argv[1]
|
||||
case f
|
||||
set alg 'fifo'
|
||||
set trace_file 'traceprogs/tr-fifo.ref'
|
||||
case l
|
||||
set alg 'lru'
|
||||
set trace_file 'traceprogs/tr-lru.ref'
|
||||
case c
|
||||
set alg 'clock'
|
||||
set trace_file 'traceprogs/tr-clock.ref'
|
||||
end
|
||||
|
||||
switch $argv[2]
|
||||
case c
|
||||
set trace_file 'traceprogs/tr-custom.ref'
|
||||
case s
|
||||
set trace_file 'traceprogs/tr-simpleloop.ref'
|
||||
set memsize 50
|
||||
set swapsize 3000
|
||||
case m
|
||||
set trace_file 'traceprogs/tr-matmul.ref'
|
||||
set memsize 100
|
||||
set swapsize 3000
|
||||
end
|
||||
|
||||
printf '\033c'
|
||||
# and bear make clean
|
||||
and bear make
|
||||
|
||||
switch $argv[3]
|
||||
case f
|
||||
./sim -f $trace_file -m $memsize -s $swapsize -a $alg > a3.out 2>&1
|
||||
case g
|
||||
gdb -ex "run" -ex "bt" -ex "q" \
|
||||
--args ./sim -f $trace_file -m $memsize -s $swapsize -a $alg
|
||||
case o
|
||||
./sim -f $trace_file -m $memsize -s $swapsize -a $alg
|
||||
end
|
||||
|
||||
if test (count swapfile.*) -gt 0
|
||||
rm swapfile.*
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
function block-to-line
|
||||
set block_size 1024
|
||||
set bytes_per_line 16
|
||||
math "($block_size*$argv[1])/$bytes_per_line + 1"
|
||||
end
|
||||
@@ -0,0 +1,15 @@
|
||||
function revert-image
|
||||
set img_file 'emptydisk.img'
|
||||
switch $argv[1]
|
||||
case 1
|
||||
set img_file 'onefile.img'
|
||||
case m
|
||||
set img_file 'multilevel.img'
|
||||
case l
|
||||
set img_file 'largefile.img'
|
||||
case s
|
||||
set img_file 'symlink.img'
|
||||
end
|
||||
|
||||
cp imgs{-cp,}/$img_file
|
||||
end
|
||||
12
dot_config/private_fish/private_functions/369/a4/hex.fish
Normal file
12
dot_config/private_fish/private_functions/369/a4/hex.fish
Normal file
@@ -0,0 +1,12 @@
|
||||
function hex
|
||||
switch $argv[1]
|
||||
case h
|
||||
# print dec/bin.
|
||||
printf "%d " (echo "ibase=16;obase=A;$argv[2]" | bc)
|
||||
printf "%d\n" (echo "ibase=16;obase=2;$argv[2]" | bc)
|
||||
case d
|
||||
# print hex/bin.
|
||||
printf "%s " (echo "obase=16;$argv[2]" | bc)
|
||||
printf "%d\n" (echo "obase=2;$argv[2]" | bc)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
function mount-image
|
||||
sudo mount $argv[1] /mnt/369-a4
|
||||
end
|
||||
35
dot_config/private_fish/private_functions/369/a4/run-a4.fish
Normal file
35
dot_config/private_fish/private_functions/369/a4/run-a4.fish
Normal file
@@ -0,0 +1,35 @@
|
||||
function run-a4
|
||||
# 1 = ex, 2 = img
|
||||
printf '\033c'
|
||||
# and bear make clean
|
||||
bear make
|
||||
|
||||
set img_file 'imgs/emptydisk.img'
|
||||
switch $argv[2]
|
||||
case 1
|
||||
set img_file 'imgs/onefile.img'
|
||||
case m
|
||||
set img_file 'imgs/multilevel.img'
|
||||
case l
|
||||
set img_file 'imgs/largefile.img'
|
||||
case s
|
||||
set img_file 'imgs/symlink.img'
|
||||
end
|
||||
|
||||
switch $argv[1]
|
||||
case h
|
||||
./ext2_helpers_tester $img_file
|
||||
case hg
|
||||
gdb -ex "run" -ex "bt" -ex "q" \
|
||||
--args ./ext2_helpers_tester './imgs/multilevel.img' '/level1/level2/level3//'
|
||||
case m
|
||||
./ext2_mkdir $img_file '/'
|
||||
# ./ext2_mkdir 'imgs/multilevel.img' '/level1/level2/bfile'
|
||||
case rg
|
||||
./readimage $img_file
|
||||
gdb -ex "run" -ex "bt" -ex "q" \
|
||||
--args ./readimage './imgs/symlink.img'
|
||||
case '*'
|
||||
./readimage $img_file
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
function grep-c
|
||||
grep -nr --include \*.c $argv[1] ./
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
function grep-headers
|
||||
grep --color=auto -nr --include \*.h $argv[1] ./
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
function rg-headers
|
||||
rg $argv[1] *.h
|
||||
end
|
||||
3
dot_config/private_fish/private_functions/369/rgc.fish
Normal file
3
dot_config/private_fish/private_functions/369/rgc.fish
Normal file
@@ -0,0 +1,3 @@
|
||||
function rgc
|
||||
rg $argv[1] *.c
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
function benq-brightness
|
||||
xrandr --output HDMI-0 --gamma 1:0.8:0 --brightness (math $argv[1] / 100)
|
||||
end
|
||||
53
dot_config/private_fish/private_functions/cd.fish
Normal file
53
dot_config/private_fish/private_functions/cd.fish
Normal file
@@ -0,0 +1,53 @@
|
||||
#
|
||||
# Wrap the builtin cd command to maintain directory history.
|
||||
#
|
||||
function cd --description "Change directory"
|
||||
set -l MAX_DIR_HIST 25
|
||||
|
||||
if test (count $argv) -gt 1
|
||||
printf "%s\n" (_ "Too many args for cd command")
|
||||
return 1
|
||||
end
|
||||
|
||||
# Skip history in subshells.
|
||||
if status --is-command-substitution
|
||||
builtin cd $argv
|
||||
return $status
|
||||
end
|
||||
|
||||
# Avoid set completions.
|
||||
set -l previous $PWD
|
||||
|
||||
if test "$argv" = "-"
|
||||
if test "$__fish_cd_direction" = "next"
|
||||
nextd
|
||||
else
|
||||
prevd
|
||||
end
|
||||
return $status
|
||||
end
|
||||
|
||||
# allow explicit "cd ." if the mount-point became stale in the meantime
|
||||
if test "$argv" = "."
|
||||
cd "$PWD"
|
||||
return $status
|
||||
end
|
||||
|
||||
builtin cd $argv
|
||||
set -l cd_status $status
|
||||
|
||||
if test $cd_status -eq 0 -a "$PWD" != "$previous"
|
||||
set -q dirprev
|
||||
or set -l dirprev
|
||||
set -q dirprev[$MAX_DIR_HIST]
|
||||
and set -e dirprev[1]
|
||||
set -g -a dirprev $previous
|
||||
set -e dirnext
|
||||
set -g __fish_cd_direction prev
|
||||
|
||||
set -U last_dir $PWD
|
||||
lsd -a
|
||||
end
|
||||
|
||||
return $cd_status
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
function certbot-ssl
|
||||
set domain_args ""
|
||||
for domain in $argv
|
||||
set -a domain_args "-d" $domain
|
||||
end
|
||||
echo sudo certbot certonly --manual --preferred-challenges=dns \
|
||||
--email kevin.mok@live.ca --server https://acme-v02.api.letsencrypt.org/directory \
|
||||
--agree-tos $domain_args
|
||||
end
|
||||
3
dot_config/private_fish/private_functions/copy.fish
Normal file
3
dot_config/private_fish/private_functions/copy.fish
Normal file
@@ -0,0 +1,3 @@
|
||||
function copy
|
||||
$argv[1] $argv[2] | xclip -selection clipboard
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
function create-fish-function
|
||||
printf 'function %s\nend' $argv[1] > $fish_fxn_dir/$argv[1].fish
|
||||
and cd $fish_fxn_dir
|
||||
and $EDITOR $argv[1].fish
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
function evince-silent
|
||||
evince $argv[1] > /dev/null 2>&1&
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
function find-vim-filetype
|
||||
fd $argv[1] /usr/share/nvim/runtime/ftplugin
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
function git-amend-push
|
||||
git add -A .
|
||||
and git commit --amend --no-edit -S
|
||||
and git push --force
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
function git-delete-branch
|
||||
git push origin --delete $argv[1]
|
||||
and git branch -D $argv[1]
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
function git-diff-files
|
||||
git diff --name-only $argv[1] $argv[2]
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
function git-mult-remotes
|
||||
git remote set-url --add --push origin $argv[1]
|
||||
and git remote set-url --add --push origin $argv[2]
|
||||
and git remote -v
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
function git-push-multiple
|
||||
git remote set-url --add --push origin $argv[1]
|
||||
and git remote set-url --add --push origin $argv[2]
|
||||
and git remote -v
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
function grep-aliases
|
||||
set key_aliases /home/kevin/linux-config/aliases/key_aliases
|
||||
rg $argv[1] $key_aliases
|
||||
# rg "^$argv[1]" $key_aliases
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
function grep-pdf-file
|
||||
pdfgrep -n $argv[1] -B $argv[2] -A $argv[3] (fd -e pdf --no-ignore-vcs) > grep-$argv[1].txt
|
||||
and nvim grep-$argv[1].txt -c "/$argv[1]"
|
||||
end
|
||||
3
dot_config/private_fish/private_functions/grep-pdf.fish
Normal file
3
dot_config/private_fish/private_functions/grep-pdf.fish
Normal file
@@ -0,0 +1,3 @@
|
||||
function grep-pdf
|
||||
pdfgrep -n $argv[1] (fd -e pdf --no-ignore-vcs)
|
||||
end
|
||||
3
dot_config/private_fish/private_functions/pastebin.fish
Normal file
3
dot_config/private_fish/private_functions/pastebin.fish
Normal file
@@ -0,0 +1,3 @@
|
||||
function pastebin
|
||||
cat $argv[1] | curl -F 'sprunge=<-' http://sprunge.us
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
function redshift-set
|
||||
redshift -x && redshift -O (math "$argv[1] * 100")
|
||||
end
|
||||
@@ -0,0 +1,7 @@
|
||||
function scan-history
|
||||
sudo systemctl start postgresql.service
|
||||
# and systemctl status postgresql.service
|
||||
and source $spv_dir/src/api-keys.sh
|
||||
and $spv_dir/src/scripts/update-history.sh
|
||||
and cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1
|
||||
end
|
||||
3
dot_config/private_fish/private_functions/shred-rm.fish
Normal file
3
dot_config/private_fish/private_functions/shred-rm.fish
Normal file
@@ -0,0 +1,3 @@
|
||||
function shred-rm
|
||||
shred $argv && rm $argv
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
function ssh-bandit
|
||||
sshpass -f p/$argv[1] ssh -p 2220 bandit$argv[1]@bandit.labs.overthewire.org
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
# convert unix timestamp
|
||||
function unix-timestamp
|
||||
date -d @$argv[1]
|
||||
end
|
||||
4
dot_config/private_fish/private_functions/unzip-rm.fish
Normal file
4
dot_config/private_fish/private_functions/unzip-rm.fish
Normal file
@@ -0,0 +1,4 @@
|
||||
function unzip-rm
|
||||
unzip $argv[1]
|
||||
and rm $argv[1]
|
||||
end
|
||||
4
dot_config/private_fish/private_functions/vsnp.fish
Normal file
4
dot_config/private_fish/private_functions/vsnp.fish
Normal file
@@ -0,0 +1,4 @@
|
||||
function vsnp
|
||||
set snips_dir "/home/kevin/.vim/plugged/vim-snippets/UltiSnips"
|
||||
$EDITOR $snips_dir/$argv[1].snippets
|
||||
end
|
||||
3
dot_config/private_fish/private_functions/wc-pdf.fish
Normal file
3
dot_config/private_fish/private_functions/wc-pdf.fish
Normal file
@@ -0,0 +1,3 @@
|
||||
function wc-pdf
|
||||
pdftotext $argv[1] - | wc -w
|
||||
end
|
||||
216
dot_config/ranger/commands.py
Normal file
216
dot_config/ranger/commands.py
Normal file
@@ -0,0 +1,216 @@
|
||||
# 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 *
|
||||
|
||||
# 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
|
||||
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)
|
||||
|
||||
|
||||
import os
|
||||
from ranger.core.loader import CommandLoader
|
||||
|
||||
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]
|
||||
|
||||
|
||||
|
||||
|
||||
import os
|
||||
from ranger.core.loader import CommandLoader
|
||||
|
||||
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)
|
||||
|
||||
|
||||
|
||||
230
dot_config/ranger/executable_scope.sh
Normal file
230
dot_config/ranger/executable_scope.sh
Normal file
@@ -0,0 +1,230 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o noclobber -o noglob -o nounset -o pipefail
|
||||
IFS=$'\n'
|
||||
|
||||
# If the option `use_preview_script` is set to `true`,
|
||||
# then this script will be called and its output will be displayed in ranger.
|
||||
# ANSI color codes are supported.
|
||||
# STDIN is disabled, so interactive scripts won't work properly
|
||||
|
||||
# This script is considered a configuration file and must be updated manually.
|
||||
# It will be left untouched if you upgrade ranger.
|
||||
|
||||
# Meanings of exit codes:
|
||||
# code | meaning | action of ranger
|
||||
# -----+------------+-------------------------------------------
|
||||
# 0 | success | Display stdout as preview
|
||||
# 1 | no preview | Display no preview at all
|
||||
# 2 | plain text | Display the plain content of the file
|
||||
# 3 | fix width | Don't reload when width changes
|
||||
# 4 | fix height | Don't reload when height changes
|
||||
# 5 | fix both | Don't ever reload
|
||||
# 6 | image | Display the image `$IMAGE_CACHE_PATH` points to as an image preview
|
||||
# 7 | image | Display the file directly as an image
|
||||
|
||||
# Script arguments
|
||||
FILE_PATH="${1}" # Full path of the highlighted file
|
||||
PV_WIDTH="${2}" # Width of the preview pane (number of fitting characters)
|
||||
PV_HEIGHT="${3}" # Height of the preview pane (number of fitting characters)
|
||||
IMAGE_CACHE_PATH="${4}" # Full path that should be used to cache image preview
|
||||
PV_IMAGE_ENABLED="${5}" # 'True' if image previews are enabled, 'False' otherwise.
|
||||
|
||||
FILE_EXTENSION="${FILE_PATH##*.}"
|
||||
FILE_EXTENSION_LOWER=$(echo ${FILE_EXTENSION} | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
# Settings
|
||||
HIGHLIGHT_SIZE_MAX=262143 # 256KiB
|
||||
HIGHLIGHT_TABWIDTH=8
|
||||
HIGHLIGHT_STYLE='pablo'
|
||||
PYGMENTIZE_STYLE='autumn'
|
||||
|
||||
|
||||
handle_extension() {
|
||||
case "${FILE_EXTENSION_LOWER}" in
|
||||
# Archive
|
||||
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)
|
||||
atool --list -- "${FILE_PATH}" && exit 5
|
||||
bsdtar --list --file "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
rar)
|
||||
# Avoid password prompt by providing empty password
|
||||
unrar lt -p- -- "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
7z)
|
||||
# Avoid password prompt by providing empty password
|
||||
7z l -p -- "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
|
||||
# PDF
|
||||
pdf)
|
||||
# Preview as text conversion
|
||||
pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - | fmt -w ${PV_WIDTH} && exit 5
|
||||
mutool draw -F txt -i -- "${FILE_PATH}" 1-10 | fmt -w ${PV_WIDTH} && exit 5
|
||||
exiftool "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
|
||||
# BitTorrent
|
||||
torrent)
|
||||
transmission-show -- "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
|
||||
# OpenDocument
|
||||
odt|ods|odp|sxw)
|
||||
# Preview as text conversion
|
||||
odt2txt "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
|
||||
# HTML
|
||||
# htm|html|xhtml)
|
||||
# # Preview as text conversion
|
||||
# w3m -dump "${FILE_PATH}" && exit 5
|
||||
# lynx -dump -- "${FILE_PATH}" && exit 5
|
||||
# elinks -dump "${FILE_PATH}" && exit 5
|
||||
# ;; # Continue with next handler on failure
|
||||
|
||||
# htm|html|xhtml)
|
||||
# # Preview as text conversion
|
||||
# w3m -dump "${FILE_PATH}" && exit 5
|
||||
# lynx -dump -- "${FILE_PATH}" && exit 5
|
||||
# elinks -dump "${FILE_PATH}" && exit 5
|
||||
# ;; # Continue with next handler on failure
|
||||
|
||||
# JSON
|
||||
json)
|
||||
jq --color-output . "${FILE_PATH}" && exit 5
|
||||
python -m json.tool -- "${FILE_PATH}" && exit 5
|
||||
esac
|
||||
}
|
||||
|
||||
handle_image() {
|
||||
local mimetype="${1}"
|
||||
case "${mimetype}" in
|
||||
# SVG
|
||||
# image/svg+xml)
|
||||
# convert "${FILE_PATH}" "${IMAGE_CACHE_PATH}" && exit 6
|
||||
# exit 1;;
|
||||
|
||||
# Image
|
||||
image/*)
|
||||
local orientation
|
||||
orientation="$( identify -format '%[EXIF:Orientation]\n' -- "${FILE_PATH}" )"
|
||||
# If orientation data is present and the image actually
|
||||
# needs rotating ("1" means no rotation)...
|
||||
if [[ -n "$orientation" && "$orientation" != 1 ]]; then
|
||||
# ...auto-rotate the image according to the EXIF data.
|
||||
convert -- "${FILE_PATH}" -auto-orient "${IMAGE_CACHE_PATH}" && exit 6
|
||||
fi
|
||||
|
||||
# `w3mimgdisplay` will be called for all images (unless overriden as above),
|
||||
# but might fail for unsupported types.
|
||||
exit 7;;
|
||||
|
||||
# Video
|
||||
# video/*)
|
||||
# # Thumbnail
|
||||
# ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 && exit 6
|
||||
# exit 1;;
|
||||
# PDF
|
||||
# application/pdf)
|
||||
# pdftoppm -f 1 -l 1 \
|
||||
# -scale-to-x 1920 \
|
||||
# -scale-to-y -1 \
|
||||
# -singlefile \
|
||||
# -jpeg -tiffcompression jpeg \
|
||||
# -- "${FILE_PATH}" "${IMAGE_CACHE_PATH%.*}" \
|
||||
# && exit 6 || exit 1;;
|
||||
|
||||
# Preview archives using the first image inside.
|
||||
# (Very useful for comic book collections for example.)
|
||||
# application/zip|application/x-rar|application/x-7z-compressed|\
|
||||
# application/x-xz|application/x-bzip2|application/x-gzip|application/x-tar)
|
||||
# local fn=""; local fe=""
|
||||
# local zip=""; local rar=""; local tar=""; local bsd=""
|
||||
# case "${mimetype}" in
|
||||
# application/zip) zip=1 ;;
|
||||
# application/x-rar) rar=1 ;;
|
||||
# application/x-7z-compressed) ;;
|
||||
# *) tar=1 ;;
|
||||
# esac
|
||||
# { [ "$tar" ] && fn=$(tar --list --file "${FILE_PATH}"); } || \
|
||||
# { fn=$(bsdtar --list --file "${FILE_PATH}") && bsd=1 && tar=""; } || \
|
||||
# { [ "$rar" ] && fn=$(unrar lb -p- -- "${FILE_PATH}"); } || \
|
||||
# { [ "$zip" ] && fn=$(zipinfo -1 -- "${FILE_PATH}"); } || return
|
||||
#
|
||||
# fn=$(echo "$fn" | python -c "import sys; import mimetypes as m; \
|
||||
# [ print(l, end='') for l in sys.stdin if \
|
||||
# (m.guess_type(l[:-1])[0] or '').startswith('image/') ]" |\
|
||||
# sort -V | head -n 1)
|
||||
# [ "$fn" = "" ] && return
|
||||
# [ "$bsd" ] && fn=$(printf '%b' "$fn")
|
||||
#
|
||||
# [ "$tar" ] && tar --extract --to-stdout \
|
||||
# --file "${FILE_PATH}" -- "$fn" > "${IMAGE_CACHE_PATH}" && exit 6
|
||||
# fe=$(echo -n "$fn" | sed 's/[][*?\]/\\\0/g')
|
||||
# [ "$bsd" ] && bsdtar --extract --to-stdout \
|
||||
# --file "${FILE_PATH}" -- "$fe" > "${IMAGE_CACHE_PATH}" && exit 6
|
||||
# [ "$bsd" ] || [ "$tar" ] && rm -- "${IMAGE_CACHE_PATH}"
|
||||
# [ "$rar" ] && unrar p -p- -inul -- "${FILE_PATH}" "$fn" > \
|
||||
# "${IMAGE_CACHE_PATH}" && exit 6
|
||||
# [ "$zip" ] && unzip -pP "" -- "${FILE_PATH}" "$fe" > \
|
||||
# "${IMAGE_CACHE_PATH}" && exit 6
|
||||
# [ "$rar" ] || [ "$zip" ] && rm -- "${IMAGE_CACHE_PATH}"
|
||||
# ;;
|
||||
esac
|
||||
}
|
||||
|
||||
handle_mime() {
|
||||
local mimetype="${1}"
|
||||
case "${mimetype}" in
|
||||
# Text
|
||||
text/* | */xml)
|
||||
# Syntax highlight
|
||||
if [[ "$( stat --printf='%s' -- "${FILE_PATH}" )" -gt "${HIGHLIGHT_SIZE_MAX}" ]]; then
|
||||
exit 2
|
||||
fi
|
||||
if [[ "$( tput colors )" -ge 256 ]]; then
|
||||
local pygmentize_format='terminal256'
|
||||
local highlight_format='xterm256'
|
||||
else
|
||||
local pygmentize_format='terminal'
|
||||
local highlight_format='ansi'
|
||||
fi
|
||||
# local pygmentize_format='terminal'
|
||||
# local highlight_format='ansi'
|
||||
highlight --replace-tabs="${HIGHLIGHT_TABWIDTH}" --out-format="${highlight_format}" \
|
||||
--style="${HIGHLIGHT_STYLE}" --force -- "${FILE_PATH}" && exit 5
|
||||
# pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}" -- "${FILE_PATH}" && exit 5
|
||||
exit 2;;
|
||||
|
||||
# Image
|
||||
image/*)
|
||||
# Preview as text conversion
|
||||
# img2txt --gamma=0.6 --width="${PV_WIDTH}" -- "${FILE_PATH}" && exit 4
|
||||
exiftool "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
|
||||
# Video and audio
|
||||
video/* | audio/*)
|
||||
mediainfo "${FILE_PATH}" && exit 5
|
||||
exiftool "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
handle_fallback() {
|
||||
echo '----- File Type Classification -----' && file --dereference --brief -- "${FILE_PATH}" && exit 5
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
MIMETYPE="$( file --dereference --brief --mime-type -- "${FILE_PATH}" )"
|
||||
if [[ "${PV_IMAGE_ENABLED}" == 'True' ]]; then
|
||||
handle_image "${MIMETYPE}"
|
||||
fi
|
||||
handle_extension
|
||||
handle_mime "${MIMETYPE}"
|
||||
handle_fallback
|
||||
|
||||
exit 1
|
||||
1
dot_config/ranger/plugins/__init__.py
Normal file
1
dot_config/ranger/plugins/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
232
dot_config/ranger/plugins/executable_devicons.py
Normal file
232
dot_config/ranger/plugins/executable_devicons.py
Normal file
@@ -0,0 +1,232 @@
|
||||
#!/usr/bin/python
|
||||
# coding=UTF-8
|
||||
# These glyphs, and the mapping of file extensions to glyphs
|
||||
# has been copied from the vimscript code that is present in
|
||||
# https://github.com/ryanoasis/vim-devicons
|
||||
import re;
|
||||
import os;
|
||||
|
||||
# all those glyphs will show as weird squares if you don't have the correct patched font
|
||||
# My advice is to use NerdFonts which can be found here:
|
||||
# https://github.com/ryanoasis/nerd-fonts
|
||||
file_node_extensions = {
|
||||
'7z' : '',
|
||||
'ai' : '',
|
||||
'apk' : '',
|
||||
'avi' : '',
|
||||
'bat' : '',
|
||||
'bmp' : '',
|
||||
'bz2' : '',
|
||||
'c' : '',
|
||||
'c++' : '',
|
||||
'cab' : '',
|
||||
'cbr' : '',
|
||||
'cbz' : '',
|
||||
'cc' : '',
|
||||
'clj' : '',
|
||||
'cljc' : '',
|
||||
'cljs' : '',
|
||||
'coffee' : '',
|
||||
'conf' : '',
|
||||
'cp' : '',
|
||||
'cpio' : '',
|
||||
'cpp' : '',
|
||||
'css' : '',
|
||||
'cxx' : '',
|
||||
'd' : '',
|
||||
'dart' : '',
|
||||
'db' : '',
|
||||
'deb' : '',
|
||||
'diff' : '',
|
||||
'dump' : '',
|
||||
'edn' : '',
|
||||
'ejs' : '',
|
||||
'epub' : '',
|
||||
'erl' : '',
|
||||
'exe' : '',
|
||||
'f#' : '',
|
||||
'fish' : '',
|
||||
'flac' : '',
|
||||
'flv' : '',
|
||||
'fs' : '',
|
||||
'fsi' : '',
|
||||
'fsscript' : '',
|
||||
'fsx' : '',
|
||||
'gem' : '',
|
||||
'gif' : '',
|
||||
'go' : '',
|
||||
'gz' : '',
|
||||
'gzip' : '',
|
||||
'hbs' : '',
|
||||
'hrl' : '',
|
||||
'hs' : '',
|
||||
'htm' : '',
|
||||
'html' : '',
|
||||
'ico' : '',
|
||||
'ini' : '',
|
||||
'java' : '',
|
||||
'jl' : '',
|
||||
'jpeg' : '',
|
||||
'jpg' : '',
|
||||
'js' : '',
|
||||
'json' : '',
|
||||
'jsx' : '',
|
||||
'less' : '',
|
||||
'lha' : '',
|
||||
'lhs' : '',
|
||||
'log' : '',
|
||||
'lua' : '',
|
||||
'lzh' : '',
|
||||
'lzma' : '',
|
||||
'markdown' : '',
|
||||
'md' : '',
|
||||
'mkv' : '',
|
||||
'ml' : 'λ',
|
||||
'mli' : 'λ',
|
||||
'mov' : '',
|
||||
'mp3' : '',
|
||||
'mp4' : '',
|
||||
'mpeg' : '',
|
||||
'mpg' : '',
|
||||
'mustache' : '',
|
||||
'ogg' : '',
|
||||
'pdf' : '',
|
||||
'php' : '',
|
||||
'pl' : '',
|
||||
'pm' : '',
|
||||
'png' : '',
|
||||
'psb' : '',
|
||||
'psd' : '',
|
||||
'py' : '',
|
||||
'pyc' : '',
|
||||
'pyd' : '',
|
||||
'pyo' : '',
|
||||
'rar' : '',
|
||||
'rb' : '',
|
||||
'rc' : '',
|
||||
'rlib' : '',
|
||||
'rpm' : '',
|
||||
'rs' : '',
|
||||
'rss' : '',
|
||||
'scala' : '',
|
||||
'scss' : '',
|
||||
'sh' : '',
|
||||
'slim' : '',
|
||||
'sln' : '',
|
||||
'sql' : '',
|
||||
'styl' : '',
|
||||
'suo' : '',
|
||||
't' : '',
|
||||
'tar' : '',
|
||||
'tgz' : '',
|
||||
'ts' : '',
|
||||
'twig' : '',
|
||||
'vim' : '',
|
||||
'vimrc' : '',
|
||||
'wav' : '',
|
||||
'webm' : '',
|
||||
'xml' : '',
|
||||
'xul' : '',
|
||||
'xz' : '',
|
||||
'yml' : '',
|
||||
'zip' : '',
|
||||
}
|
||||
|
||||
dir_node_exact_matches = {
|
||||
# English
|
||||
'.git' : '',
|
||||
'Desktop' : '',
|
||||
'Documents' : '',
|
||||
'Downloads' : '',
|
||||
'Dropbox' : '',
|
||||
'Music' : '',
|
||||
'Pictures' : '',
|
||||
'Public' : '',
|
||||
'Templates' : '',
|
||||
'Videos' : '',
|
||||
# Spanish
|
||||
'Escritorio' : '',
|
||||
'Documentos' : '',
|
||||
'Descargas' : '',
|
||||
'Música' : '',
|
||||
'Imágenes' : '',
|
||||
'Público' : '',
|
||||
'Plantillas' : '',
|
||||
'Vídeos' : '',
|
||||
# French
|
||||
'Bureau' : '',
|
||||
'Documents' : '',
|
||||
'Images' : '',
|
||||
'Musique' : '',
|
||||
'Publique' : '',
|
||||
'Téléchargements' : '',
|
||||
'Vidéos' : '',
|
||||
# Portuguese
|
||||
'Documentos' : '',
|
||||
'Imagens' : '',
|
||||
'Modelos' : '',
|
||||
'Música' : '',
|
||||
'Público' : '',
|
||||
'Vídeos' : '',
|
||||
'Área de trabalho' : '',
|
||||
# Italian
|
||||
'Documenti' : '',
|
||||
'Immagini' : '',
|
||||
'Modelli' : '',
|
||||
'Musica' : '',
|
||||
'Pubblici' : '',
|
||||
'Scaricati' : '',
|
||||
'Scrivania' : '',
|
||||
'Video' : '',
|
||||
# German
|
||||
'Bilder' : '',
|
||||
'Dokumente' : '',
|
||||
'Musik' : '',
|
||||
'Schreibtisch' : '',
|
||||
'Vorlagen' : '',
|
||||
'Öffentlich' : '',
|
||||
}
|
||||
|
||||
file_node_exact_matches = {
|
||||
'.Xdefaults' : '',
|
||||
'.Xresources' : '',
|
||||
'.bashprofile' : '',
|
||||
'.bashrc' : '',
|
||||
'.dmrc' : '',
|
||||
'.ds_store' : '',
|
||||
'.fasd' : '',
|
||||
'.gitconfig' : '',
|
||||
'.gitignore' : '',
|
||||
'.jack-settings' : '',
|
||||
'.mime.types' : '',
|
||||
'.nvidia-settings-rc' : '',
|
||||
'.pam_environment' : '',
|
||||
'.profile' : '',
|
||||
'.recently-used' : '',
|
||||
'.selected_editor' : '',
|
||||
'.vimrc' : '',
|
||||
'.xinputrc' : '',
|
||||
'config' : '',
|
||||
'dropbox' : '',
|
||||
'exact-match-case-sensitive-1.txt' : 'X1',
|
||||
'exact-match-case-sensitive-2' : 'X2',
|
||||
'favicon.ico' : '',
|
||||
'gruntfile.coffee' : '',
|
||||
'gruntfile.js' : '',
|
||||
'gruntfile.ls' : '',
|
||||
'gulpfile.coffee' : '',
|
||||
'gulpfile.js' : '',
|
||||
'gulpfile.ls' : '',
|
||||
'ini' : '',
|
||||
'ledger' : '',
|
||||
'license' : '',
|
||||
'mimeapps.list' : '',
|
||||
'node_modules' : '',
|
||||
'procfile' : '',
|
||||
'react.jsx' : '',
|
||||
'user-dirs.dirs' : '',
|
||||
}
|
||||
|
||||
def devicon(file):
|
||||
if file.is_directory: return dir_node_exact_matches.get(file.relative_path, '')
|
||||
return file_node_exact_matches.get(file.relative_path, file_node_extensions.get(file.extension, ''))
|
||||
19
dot_config/ranger/plugins/executable_devicons_linemode.py
Normal file
19
dot_config/ranger/plugins/executable_devicons_linemode.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import ranger.api
|
||||
from ranger.core.linemode import LinemodeBase
|
||||
from plugins.devicons import *
|
||||
|
||||
@ranger.api.register_linemode
|
||||
class DevIconsLinemode(LinemodeBase):
|
||||
name = "devicons"
|
||||
|
||||
uses_metadata = False
|
||||
|
||||
def filetitle(self, file, metadata):
|
||||
return devicon(file) + ' ' + file.relative_path
|
||||
|
||||
@ranger.api.register_linemode
|
||||
class DevIconsLinemodeFile(LinemodeBase):
|
||||
name = "filename"
|
||||
|
||||
def filetitle(self, file, metadata):
|
||||
return devicon(file) + ' ' + file.relative_path
|
||||
707
dot_config/ranger/rc.conf
Normal file
707
dot_config/ranger/rc.conf
Normal file
@@ -0,0 +1,707 @@
|
||||
# default {{{ #
|
||||
# ===================================================================
|
||||
# This file contains the default startup commands for ranger.
|
||||
# To change them, it is recommended to create the file
|
||||
# ~/.config/ranger/rc.conf and add your custom commands there.
|
||||
#
|
||||
# If you copy this whole file there, you may want to set the environment
|
||||
# variable RANGER_LOAD_DEFAULT_RC to FALSE to avoid loading it twice.
|
||||
#
|
||||
# The purpose of this file is mainly to define keybindings and settings.
|
||||
# For running more complex python code, please create a plugin in "plugins/" or
|
||||
# a command in "commands.py".
|
||||
#
|
||||
# Each line is a command that will be run before the user interface
|
||||
# is initialized. As a result, you can not use commands which rely
|
||||
# on the UI such as :delete or :mark.
|
||||
# ===================================================================
|
||||
|
||||
# ===================================================================
|
||||
# == Options
|
||||
# ===================================================================
|
||||
|
||||
# Which viewmode should be used? Possible values are:
|
||||
# miller: Use miller columns which show multiple levels of the hierarchy
|
||||
# multipane: Midnight-commander like multipane view showing all tabs next
|
||||
# to each other
|
||||
set viewmode miller
|
||||
#set viewmode multipane
|
||||
|
||||
# How many columns are there, and what are their relative widths?
|
||||
set column_ratios 1,3,4
|
||||
|
||||
# Which files should be hidden? (regular expression)
|
||||
set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$
|
||||
|
||||
# Show hidden files? You can toggle this by typing 'zh'
|
||||
set show_hidden true
|
||||
|
||||
# Ask for a confirmation when running the "delete" command?
|
||||
# Valid values are "always", "never", "multiple" (default)
|
||||
# With "multiple", ranger will ask only if you delete multiple files at once.
|
||||
set confirm_on_delete multiple
|
||||
|
||||
# Use non-default path for file preview script?
|
||||
# ranger ships with scope.sh, a script that calls external programs (see
|
||||
# README.md for dependencies) to preview images, archives, etc.
|
||||
set preview_script ~/.config/ranger/scope.sh
|
||||
|
||||
# Use the external preview script or display simple plain text or image previews?
|
||||
set use_preview_script true
|
||||
|
||||
# Automatically count files in the directory, even before entering them?
|
||||
set automatically_count_files true
|
||||
|
||||
# Open all images in this directory when running certain image viewers
|
||||
# like feh or sxiv? You can still open selected files by marking them.
|
||||
set open_all_images true
|
||||
|
||||
# Be aware of version control systems and display information.
|
||||
set vcs_aware false
|
||||
|
||||
# State of the four backends git, hg, bzr, svn. The possible states are
|
||||
# disabled, local (only show local info), enabled (show local and remote
|
||||
# information).
|
||||
set vcs_backend_git enabled
|
||||
set vcs_backend_hg disabled
|
||||
set vcs_backend_bzr disabled
|
||||
set vcs_backend_svn disabled
|
||||
|
||||
# Default iTerm2 font size (see: preview_images_method: iterm2)
|
||||
set iterm2_font_width 8
|
||||
set iterm2_font_height 11
|
||||
|
||||
# Use a unicode "..." character to mark cut-off filenames?
|
||||
set unicode_ellipsis false
|
||||
|
||||
# Show dotfiles in the bookmark preview box?
|
||||
set show_hidden_bookmarks true
|
||||
|
||||
# Which colorscheme to use? These colorschemes are available by default:
|
||||
# default, jungle, snow, solarized
|
||||
set colorscheme default
|
||||
|
||||
# Preview files on the rightmost column?
|
||||
# And collapse (shrink) the last column if there is nothing to preview?
|
||||
set preview_files true
|
||||
set preview_directories true
|
||||
set collapse_preview true
|
||||
|
||||
# Save the console history on exit?
|
||||
set save_console_history true
|
||||
|
||||
# Draw the status bar on top of the browser window (default: bottom)
|
||||
set status_bar_on_top false
|
||||
|
||||
# Draw a progress bar in the status bar which displays the average state of all
|
||||
# currently running tasks which support progress bars?
|
||||
set draw_progress_bar_in_status_bar true
|
||||
|
||||
# Draw borders around columns?
|
||||
set draw_borders false
|
||||
|
||||
# Display the directory name in tabs?
|
||||
set dirname_in_tabs true
|
||||
|
||||
# Enable the mouse support?
|
||||
set mouse_enabled false
|
||||
|
||||
# Display the file size in the main column or status bar?
|
||||
set display_size_in_main_column true
|
||||
set display_size_in_status_bar true
|
||||
|
||||
# Display files tags in all columns or only in main column?
|
||||
set display_tags_in_all_columns true
|
||||
|
||||
# Set a title for the window?
|
||||
set update_title false
|
||||
|
||||
# Set the title to "ranger" in the tmux program?
|
||||
set update_tmux_title false
|
||||
|
||||
# Shorten the title if it gets long? The number defines how many
|
||||
# directories are displayed at once, 0 turns off this feature.
|
||||
set shorten_title 3
|
||||
|
||||
# Show hostname in titlebar?
|
||||
set hostname_in_titlebar true
|
||||
|
||||
# Abbreviate $HOME with ~ in the titlebar (first line) of ranger?
|
||||
set tilde_in_titlebar true
|
||||
|
||||
# How many directory-changes or console-commands should be kept in history?
|
||||
set max_history_size 20
|
||||
set max_console_history_size 50
|
||||
|
||||
# Try to keep so much space between the top/bottom border when scrolling:
|
||||
set scroll_offset 8
|
||||
|
||||
# Flush the input after each key hit? (Noticeable when ranger lags)
|
||||
set flushinput true
|
||||
|
||||
# Padding on the right when there's no preview?
|
||||
# This allows you to click into the space to run the file.
|
||||
set padding_right true
|
||||
|
||||
# Save bookmarks (used with mX and `X) instantly?
|
||||
# This helps to synchronize bookmarks between multiple ranger
|
||||
# instances but leads to *slight* performance loss.
|
||||
# When false, bookmarks are saved when ranger is exited.
|
||||
set autosave_bookmarks true
|
||||
|
||||
# Save the "`" bookmark to disk. This can be used to switch to the last
|
||||
# directory by typing "``".
|
||||
set save_backtick_bookmark true
|
||||
|
||||
# You can display the "real" cumulative size of directories by using the
|
||||
# command :get_cumulative_size or typing "dc". The size is expensive to
|
||||
# calculate and will not be updated automatically. You can choose
|
||||
# to update it automatically though by turning on this option:
|
||||
set autoupdate_cumulative_size false
|
||||
|
||||
# Turning this on makes sense for screen readers:
|
||||
set show_cursor false
|
||||
|
||||
# One of: size, natural, basename, atime, ctime, mtime, type, random
|
||||
set sort natural
|
||||
# set sort extension
|
||||
|
||||
# Additional sorting options
|
||||
set sort_reverse false
|
||||
set sort_case_insensitive true
|
||||
set sort_directories_first true
|
||||
set sort_unicode false
|
||||
|
||||
# Enable this if key combinations with the Alt Key don't work for you.
|
||||
# (Especially on xterm)
|
||||
set xterm_alt_key false
|
||||
|
||||
# Whether to include bookmarks in cd command
|
||||
set cd_bookmarks true
|
||||
|
||||
# Changes case sensitivity for the cd command tab completion
|
||||
set cd_tab_case sensitive
|
||||
|
||||
# Use fuzzy tab completion with the "cd" command. For example,
|
||||
# ":cd /u/lo/b<tab>" expands to ":cd /usr/local/bin".
|
||||
set cd_tab_fuzzy false
|
||||
|
||||
# Avoid previewing files larger than this size, in bytes. Use a value of 0 to
|
||||
# disable this feature.
|
||||
set preview_max_size 0
|
||||
|
||||
# Add the highlighted file to the path in the titlebar
|
||||
set show_selection_in_titlebar true
|
||||
|
||||
# The delay that ranger idly waits for user input, in milliseconds, with a
|
||||
# resolution of 100ms. Lower delay reduces lag between directory updates but
|
||||
# increases CPU load.
|
||||
set idle_delay 2000
|
||||
|
||||
# When the metadata manager module looks for metadata, should it only look for
|
||||
# a ".metadata.json" file in the current directory, or do a deep search and
|
||||
# check all directories above the current one as well?
|
||||
set metadata_deep_search false
|
||||
|
||||
# Clear all existing filters when leaving a directory
|
||||
set clear_filters_on_dir_change false
|
||||
|
||||
# Disable displaying line numbers in main column
|
||||
set line_numbers false
|
||||
|
||||
# Start line numbers from 1 instead of 0
|
||||
set one_indexed false
|
||||
|
||||
# Save tabs on exit
|
||||
set save_tabs_on_exit false
|
||||
|
||||
# Enable scroll wrapping - moving down while on the last item will wrap around to
|
||||
# the top and vice versa.
|
||||
set wrap_scroll false
|
||||
|
||||
# Set the global_inode_type_filter to nothing. Possible options: d, f and l for
|
||||
# directories, files and symlinks respectively.
|
||||
set global_inode_type_filter
|
||||
|
||||
# ===================================================================
|
||||
# == Local Options
|
||||
# ===================================================================
|
||||
# You can set local options that only affect a single directory.
|
||||
|
||||
# Examples:
|
||||
# setlocal path=~/downloads sort mtime
|
||||
|
||||
# ===================================================================
|
||||
# == Command Aliases in the Console
|
||||
# ===================================================================
|
||||
|
||||
alias e edit
|
||||
alias q quit
|
||||
alias q! quit!
|
||||
alias qa quitall
|
||||
alias qa! quitall!
|
||||
alias qall 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 -aefklst
|
||||
|
||||
# ===================================================================
|
||||
# == Define keys for the browser
|
||||
# ===================================================================
|
||||
|
||||
# Basic
|
||||
map Q quitall
|
||||
map q quit
|
||||
copymap q ZZ ZQ
|
||||
|
||||
map R reload_cwd
|
||||
map F set freeze_files!
|
||||
map <C-r> reset
|
||||
map <C-l> redraw_window
|
||||
map <C-c> abort
|
||||
map <esc> change_mode normal
|
||||
map ~ set viewmode!
|
||||
|
||||
map i display_file
|
||||
map ? help
|
||||
map W display_log
|
||||
# map w taskview_open
|
||||
# map S shell $SHELL
|
||||
map s shell fish -C "cd %d"
|
||||
|
||||
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 Mm linemode mtime
|
||||
map Mp linemode permissions
|
||||
map Ms linemode sizemtime
|
||||
map Mt linemode metatitle
|
||||
|
||||
# Tagging / Marking
|
||||
map t tag_toggle
|
||||
map ut tag_remove
|
||||
map "<any> tag_toggle tag=%any
|
||||
map <Space> mark_files toggle=True
|
||||
map v mark_files all=True toggle=True
|
||||
# unmark/clear selection
|
||||
map uv mark_files all=True val=False
|
||||
map V toggle_visual_mode
|
||||
map uV toggle_visual_mode reverse=True
|
||||
|
||||
# For the nostalgics: Midnight Commander bindings
|
||||
map <F1> help
|
||||
map <F2> rename_append
|
||||
map <F3> display_file
|
||||
map <F4> edit
|
||||
map <F5> copy
|
||||
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
|
||||
map ) jump_non
|
||||
|
||||
map gh cd ~
|
||||
map ge cd /etc
|
||||
map gu cd /usr
|
||||
map gd cd /dev
|
||||
map gl cd -r .
|
||||
map gL cd -r %f
|
||||
map go cd /opt
|
||||
map gv cd /var
|
||||
map gm cd /media
|
||||
map gM cd /mnt
|
||||
map gs cd /srv
|
||||
map gp cd /tmp
|
||||
# map gr cd /
|
||||
map gR eval fm.cd(ranger.RANGERDIR)
|
||||
map g/ cd /
|
||||
map g? cd /usr/share/doc/ranger
|
||||
|
||||
# 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 yank path
|
||||
map yd yank dir
|
||||
map yn yank name
|
||||
|
||||
# Filesystem Operations
|
||||
map = chmod
|
||||
|
||||
map cw console rename%space
|
||||
map a rename_append
|
||||
map A eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"))
|
||||
map I eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"), 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 dt cut mode=toggle
|
||||
|
||||
map yy copy
|
||||
map uy uncut
|
||||
map ya copy mode=add
|
||||
map yr copy mode=remove
|
||||
map yt copy mode=toggle
|
||||
|
||||
# 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 gr fzf_select
|
||||
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
|
||||
|
||||
# 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 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
|
||||
|
||||
# Sorting
|
||||
map or set 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 set collapse_preview!
|
||||
map zd set sort_directories_first!
|
||||
map zh set show_hidden!
|
||||
map <C-h> set show_hidden!
|
||||
map zI set flushinput!
|
||||
map zi set preview_images!
|
||||
map zm set mouse_enabled!
|
||||
map zp set preview_files!
|
||||
map zP set preview_directories!
|
||||
map zs set sort_case_insensitive!
|
||||
map zu set autoupdate_cumulative_size!
|
||||
map zv set use_preview_script!
|
||||
map zf console filter%space
|
||||
copymap zf zz
|
||||
|
||||
# Bookmarks
|
||||
map `<any> enter_bookmark %any
|
||||
map '<any> enter_bookmark %any
|
||||
map b<any> set_bookmark %any
|
||||
map ub<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))
|
||||
|
||||
# ===================================================================
|
||||
# == Define keys for the console
|
||||
# ===================================================================
|
||||
# Note: Unmapped keys are passed directly to the console.
|
||||
|
||||
# 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)
|
||||
cmap <a-left> eval fm.ui.console.move_word(left=1)
|
||||
cmap <a-right> eval fm.ui.console.move_word(right=1)
|
||||
|
||||
# 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 Keybindings
|
||||
# ===================================================================
|
||||
|
||||
# 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>
|
||||
# }}} #
|
||||
|
||||
# image preview {{{ #
|
||||
|
||||
# Use one of the supported image preview protocols
|
||||
set preview_images true
|
||||
|
||||
# Set the preview image method. Supported methods:
|
||||
#
|
||||
# * w3m (default):
|
||||
# Preview images in full color with the external command "w3mimgpreview"?
|
||||
# This requires the console web browser "w3m" and a supported terminal.
|
||||
# It has been successfully tested with "xterm" and "urxvt" without tmux.
|
||||
#
|
||||
# * iterm2:
|
||||
# Preview images in full color using iTerm2 image previews
|
||||
# (http://iterm2.com/images.html). This requires using iTerm1 compiled
|
||||
# with image preview support.
|
||||
#
|
||||
# This feature relies on the dimensions of the terminal's font. By default, a
|
||||
# width of 8 and height of 11 are used. To use other values, set the options
|
||||
# iterm2_font_width and iterm2_font_height to the desired values.
|
||||
#
|
||||
# * urxvt:
|
||||
# Preview images in full color using urxvt image backgrounds. This
|
||||
# requires using urxvt compiled with pixbuf support.
|
||||
#
|
||||
# * urxvt-full:
|
||||
# The same as urxvt but utilizing not only the preview pane but the
|
||||
# whole terminal window.
|
||||
set preview_images_method w3m
|
||||
# set preview_images_method urxvt
|
||||
# set preview_images_method urxvt-full
|
||||
|
||||
# }}} image preview #
|
||||
|
||||
# custom {{{ #
|
||||
|
||||
# editing ranger config
|
||||
map R chain shell nvim -p ~/.config/ranger/rc.conf %rangerdir/config/rc.conf; source ~/.config/ranger/rc.conf
|
||||
map rr source ~/.config/ranger/rc.conf
|
||||
|
||||
# backgrounds {{{ #
|
||||
|
||||
map w shell /usr/bin/wal -i %f
|
||||
map bde shell mv %f dim/editing
|
||||
map bdn shell mv %f dim/non-editing
|
||||
map bbe shell mv %f bright/editing
|
||||
map bbn shell mv %f bright/non-editing
|
||||
map be shell mv %f editing
|
||||
map bn shell mv %f non-editing
|
||||
|
||||
# }}} backgrounds #
|
||||
|
||||
# bulk rename
|
||||
map cw eval fm.execute_console("bulkrename") if fm.thisdir.marked_items else fm.open_console("rename ")
|
||||
|
||||
map zu shell unzip %f
|
||||
map zr shell unzip %f && rm %f
|
||||
|
||||
map e. open_with evince f
|
||||
map v. shell $EDITOR %f
|
||||
|
||||
# map gr fzf_select
|
||||
source /home/kevin/.config/ranger/key_mappings.conf
|
||||
|
||||
map dg shell dragon-drag-and-drop -a -x %p
|
||||
# map <C-d> shell dragon-drag-and-drop -a -x %p
|
||||
# a plugin that adds file glyphs / icon support to Ranger:
|
||||
# https://github.com/alexanderjeurissen/ranger_devicons
|
||||
default_linemode devicons
|
||||
|
||||
# }}} custom #
|
||||
234
dot_config/ranger/rifle.conf
Normal file
234
dot_config/ranger/rifle.conf
Normal file
@@ -0,0 +1,234 @@
|
||||
# vim: ft=cfg
|
||||
# info {{{
|
||||
#
|
||||
# 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 $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 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-browser, X, flag f = chromium-browser -- "$@"
|
||||
# ext x?html?, has chromium, X, flag f = chromium -- "$@"
|
||||
# ext x?html?, has google-chrome, X, flag f = google-chrome -- "$@"
|
||||
# ext x?html?, has opera, X, flag f = opera -- "$@"
|
||||
# ext x?html?, has firefox, X, flag f = firefox -- "$@"
|
||||
# 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 "$@"
|
||||
# }}}
|
||||
|
||||
# text {{{
|
||||
#-------------------------------------------
|
||||
# Define the "editor" for text files as first action
|
||||
# mime ^text, label editor = urxvt -e "${VISUAL:-$EDITOR} -- $@"
|
||||
mime ^text, label editor = ${VISUAL:-$EDITOR} -- "$@"
|
||||
mime ^text, label pager = "$PAGER" -- "$@"
|
||||
!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php|fish|html|yml|scss = ${VISUAL:-$EDITOR} -- "$@"
|
||||
# !mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php|fish|html|yml|scss = urxvt -e ${VISUAL:-$EDITOR} -- "$@"
|
||||
!mime ^text, label pager, ext xml|json|csv|tex|py|pl|rb|js|sh|php|fish|html|yml|scss = "$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
|
||||
|
||||
# }}}
|
||||
|
||||
#--------------------------------------------
|
||||
# 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"
|
||||
|
||||
#--------------------------------------------
|
||||
# Audio without X
|
||||
#-------------------------------------------
|
||||
mime ^audio|ogg$, terminal, has mpv = mpv -- "$@"
|
||||
mime ^audio|ogg$, terminal, has mplayer2 = mplayer2 -- "$@"
|
||||
mime ^audio|ogg$, terminal, has mplayer = mplayer -- "$@"
|
||||
ext midi?, terminal, has wildmidi = wildmidi -- "$@"
|
||||
|
||||
#--------------------------------------------
|
||||
# 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 --fs -- "$@"
|
||||
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 -- "$@"
|
||||
|
||||
#--------------------------------------------
|
||||
# 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 = ask
|
||||
ext pdf, has zathura, X, flag f = zathura -- "$@"
|
||||
ext pdf, has evince, X, flag f = evince -- "$@"
|
||||
ext pdf, has llpp, X, flag f = llpp "$@"
|
||||
ext pdf, has mupdf, X, flag f = mupdf "$@"
|
||||
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 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 pdf, has open, X, flat f = open "$@"
|
||||
|
||||
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 -- "$@"
|
||||
|
||||
ext epub, has ebook-viewer, X, flag f = ebook-viewer -- "$@"
|
||||
ext mobi, has ebook-viewer, X, flag f = ebook-viewer -- "$@"
|
||||
|
||||
#-------------------------------------------
|
||||
# Image Viewing:
|
||||
#-------------------------------------------
|
||||
mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@"
|
||||
mime ^image/svg, has display, X, flag f = display -- "$@"
|
||||
|
||||
mime ^image, has pqiv, X, flag f = pqiv -- "$@"
|
||||
mime ^image, has sxiv, X, flag f = sxiv -- "$@"
|
||||
mime ^image, has feh, X, flag f = feh -- "$@"
|
||||
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 nomacs, X, flag f = nomacs -- "$@"
|
||||
mime ^image, has geeqie, X, flag f = geeqie -- "$@"
|
||||
mime ^image, has gimp, X, flag f = gimp -- "$@"
|
||||
ext xcf, X, flag f = gimp -- "$@"
|
||||
|
||||
#-------------------------------------------
|
||||
# Archives
|
||||
#-------------------------------------------
|
||||
|
||||
# avoid password prompt by providing empty password
|
||||
ext 7z, has 7z = 7z -p l "$@" | "$PAGER"
|
||||
# This requires atool
|
||||
ext ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool --list --each -- "$@" | "$PAGER"
|
||||
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool --list --each -- "$@" | "$PAGER"
|
||||
ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool --extract --each -- "$@"
|
||||
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool --extract --each -- "$@"
|
||||
|
||||
# Listing and extracting archives without atool:
|
||||
ext tar|gz|bz2|xz, has tar = tar vvtf "$1" | "$PAGER"
|
||||
ext tar|gz|bz2|xz, has tar = for file in "$@"; do tar vvxf "$file"; done
|
||||
ext bz2, has bzip2 = for file in "$@"; do bzip2 -dk "$file"; done
|
||||
ext zip, has unzip = unzip -l "$1" | less
|
||||
ext zip, has unzip = for file in "$@"; do unzip -d "${file%.*}" "$file"; done
|
||||
ext ace, has unace = unace l "$1" | less
|
||||
ext ace, has unace = for file in "$@"; do unace e "$file"; done
|
||||
ext rar, has unrar = unrar l "$1" | less
|
||||
ext rar, has unrar = for file in "$@"; do unrar x "$file"; done
|
||||
|
||||
#-------------------------------------------
|
||||
# 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 = ask
|
||||
label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ${VISUAL:-$EDITOR} -- "$@"
|
||||
label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
|
||||
|
||||
# ext gpg = pass edit -- "$1"
|
||||
|
||||
# The very last action, so that it's never triggered accidentally, is to execute a program:
|
||||
mime application/x-executable = "$1"
|
||||
4
dot_config/zathura/zathurarc
Normal file
4
dot_config/zathura/zathurarc
Normal file
@@ -0,0 +1,4 @@
|
||||
set recolor true
|
||||
set recolor-darkcolor "#dcdccc"
|
||||
set recolor-lightcolor "#1f1f1f"
|
||||
set selection-clipboard clipboard
|
||||
Reference in New Issue
Block a user