1
0
mirror of https://github.com/alrayyes/dotfiles/ synced 2023-11-14 15:56:30 +00:00

Compare commits

...

15 Commits

34 changed files with 345 additions and 1023 deletions

View File

@ -8,6 +8,7 @@
- [[#maintainers][Maintainers]]
- [[#prerequisites][Prerequisites]]
- [[#applications][Applications]]
- [[#fonts][Fonts]]
- [[#lsp-backends][LSP Backends]]
- [[#configured-applications][Configured Applications]]
- [[#fish][Fish]]
@ -45,11 +46,17 @@ A repository of my personal configuration files.
- [[https://github.com/cdemoulins/pamixer][pamixer]]
- [[https://github.com/dylanaraps/pfetch][pfetch]]
- [[https://www.freedesktop.org/wiki/Software/PulseAudio/][Pulseaudio]]
- [[https://www.python.org/][Python]]
- [[https://github.com/dylanaraps/pywal][pywal]]
- [[http://www.gnu.org/software/stow/][stow]]
- [[https://www.python.org/][Python]]
- [[https://github.com/muennich/sxiv][sxiv]]
- [[https://www.freedesktop.org/wiki/Software/udisks/][udisks]]
- [[https://github.com/stoeckmann/xwallpaper][xwallpaper]]
- [[https://pwmt.org/projects/zathura/][zathura]]
** Fonts
- [[https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/FiraCode][Fira Code Nerd Patched]]
- [[https://www.google.com/get/noto/][Noto]]
- [[https://savannah.gnu.org/projects/unifont/][Unifont]]
** LSP Backends
- [[https://github.com/mads-hartmann/bash-language-server][bash-language-server]]
- [[https://github.com/MaskRay/ccls][ccls]]
@ -81,7 +88,6 @@ A repository of my personal configuration files.
- [[https://github.com/baskerville/sxhkd][sxhkd]]
- [[https://tmux.github.io/][tmux]]
- [[https://gitlab.com/ajak/tuir][tuir]]
- [[https://vifm.info/][vifm]]
- [[https://weechat.org/][weechat]]
* Fish

View File

@ -1,62 +1,29 @@
#!/usr/bin/env fish
# Start program if it's not running to avoid multiple instances running on bspwm reload
###---Functions---###
function start_if_not_running
if [ (pgrep -u (id -u) -x $argv[1] | wc -l) -lt 1 ]
eval "$argv[1] &"
end
end
set -U SXHKD_SHELL sh
###---Flush rules---###
bspc rule -r "*"
# Map keys
###---Sxhkd---###
set -U SXHKD_SHELL sh
sxhkd &
###---Keyboard---###
setxkbmap -option caps:escape
# Enable numberlock
if [ -x /usr/bin/numlockx ]
/usr/bin/numlockx on
end
# Keybindings
sxhkd &
# Make things pretty
wal -R
~/.local/bin/wallpaper
picom -b
e
# Load wal colours
. ~/.cache/wal/colors.fish
bspc config normal_border_color "$color1"
bspc config active_border_color "$color2"
bspc config focused_border_color "$color15"
bspc config presel_feedback_color "$color1"
bspc config border_width 2
bspc config window_gap 12
bspc config split_ratio 0.52
bspc config borderless_monocle true
bspc config gapless_monocle true
bspc rule -a "Syncthing GTK" state=floating
bspc rule -a Gimp state=floating
bspc rule -a wttr state=floating
bspc rule -a neomutt state=floating
bspc rule -a newsboat state=floating
bspc rule -a updatearch state=floating
bspc rule -a lf state=floating
bspc rule -a Spotify desktop='^4'
bspc rule -a Spt desktop='^4'
bspc rule -a Emacs state=tiled
bspc rule -a Zathura state=tiled
bspc rule -a Brave-browser desktop='^9'
bspc rule -a scratchpad sticky=on state=floating
bspc rule -a scratchmacs sticky=on state=floating
# Set screen orientation if second monitor is connected
###---Monitors---###
set SCREENCOUNT (xrandr | grep -c "\*")
# If multi screen add special mode for monitor so it supports 1440p over HDMI
if [ "$SCREENCOUNT" -eq 2 ]
bspc monitor DP-1 -d 2 3 4 5 6 7 8 9 0
bspc monitor HDMI-2 -d 1
@ -76,7 +43,42 @@ else
end
end
# Start apps
###---Wallpaper & opacity---###
wal -R
~/.local/bin/wallpaper
picom -b
###---Global Settings---###
. ~/.cache/wal/colors.fish
bspc config normal_border_color "$color1"
bspc config active_border_color "$color2"
bspc config focused_border_color "$color15"
bspc config presel_feedback_color "$color1"
bspc config automatic_scheme alternate
bspc config initial_polarity second_child
###---Desktop Settings----###
bspc config border_width 2
bspc config window_gap 10
###---Rules---###
bspc rule -a "Syncthing GTK" state=floating
bspc rule -a Gimp state=floating
bspc rule -a wttr state=floating
bspc rule -a neomutt state=floating
bspc rule -a newsboat state=floating
bspc rule -a updatearch state=floating
bspc rule -a lf state=floating
bspc rule -a Spotify desktop='^4'
bspc rule -a Spt desktop='^4'
bspc rule -a Emacs state=tiled
bspc rule -a Zathura state=tiled
bspc rule -a Brave-browser desktop='^9'
bspc rule -a scratchpad sticky=on state=floating
bspc rule -a scratchmacs sticky=on state=floating
###---Autostart---###
start_if_not_running unclutter
start_if_not_running nm-applet
start_if_not_running pasystray
@ -84,14 +86,19 @@ start_if_not_running redshift-gtk
start_if_not_running syncthing-gtk
start_if_not_running caffeine
start_if_not_running brave
pkill -f cleanfullscreen
~/.local/bin/cleanfullscreen &
pkill -f spt
alacritty --class Spt,Spt -e ~/.local/bin/spotify-command-line &
# system lock
###---System lock---###
pkill -f xss-lock
xss-lock -n ~/.local/bin/lock -- ~/.local/bin/lock &
pkill -f xautolock
xautolock -time 10 -locker ~/.local/bin/lock &
###---Misc---###
# Needed for Jetbrains products to work
wmname LG3D &

View File

@ -0,0 +1,87 @@
#!/usr/bin/env sh
# Clean fullscreen aims to provide a means to have a clean desktop when using
# transparency in bspwm, the issue I found was that when a window entered,
# fullscreen mode I was still able to see the windows behind it, I think this
# looks kind of gross so that's why this exists.
HideBar() {
if pgrep "polybar"; then
polybar-msg cmd hide
fi
}
ShowBar() {
if pgrep "polybar"; then
polybar-msg cmd show
fi
}
HideNodes() {
NODES=$(bspc query -N -n .tiled -d "$1")
for node in $NODES; do
bspc node "$node" -g hidden=on
done
}
ShowNodes() {
NODES=$(bspc query -N -n .hidden -d "$1")
for node in $NODES; do
bspc node "$node" -g hidden=off
done
}
bspc subscribe node_state | while read -r Event
do
Desktop=$(echo "$Event" | awk '{print $3}')
State=$(echo "$Event" | awk '{print $5}')
Active=$(echo "$Event" | awk '{print $6}')
# Hide bar and nodes when node becomes fullscreen, otherwise show
if [ "$State" = "fullscreen" ]; then
if [ "$Active" = "on" ]; then
HideNodes "$Desktop"
HideBar
else
ShowNodes "$Desktop"
ShowBar
fi
fi
done &
bspc subscribe node_remove | while read -r Event
do
Desktop=$(echo "$Event" | awk '{print $3}')
# Show bar if no nodes are fullscreen on current desktop
if [ -z "$(bspc query -N -n .fullscreen -d "$Desktop")" ]; then
ShowBar
fi
ShowNodes "$Desktop"
done &
bspc subscribe node_transfer | while read -r Event
do
SrcNode=$(echo "$Event" | awk '{print $4}')
# Show nodes on src desktop and hide nodes on dest desktop
# If src node is in full screen mode
if [ -n "$(bspc query -N -n "$SrcNode".fullscreen)" ]; then
SrcDesktop=$(echo "$Event" | awk '{print $3}')
ShowNodes "$SrcDesktop"
DestDesktop=$(echo "$Event" | awk '{print $6}')
HideNodes "$DestDesktop"
ShowBar
fi
done &
bspc subscribe desktop_focus | while read -r Event
do
Desktop=$(echo "$Event" | awk '{print $3}')
# Hide bar if desktop contains fullscreen node, otherwise show it
if [ -n "$(bspc query -N -n .fullscreen -d "$Desktop")" ]; then
HideBar
else
ShowBar
fi
done &

View File

@ -1 +0,0 @@
0af55a0b-18b5-49ec-a93f-81206b8fb3c6

View File

@ -1,105 +1,146 @@
# interpreter for shell commands (needs to be POSIX compatible)
set shell zsh
# enable icons
# Basic settings
set shell sh
set preview false
set icons on
set hidden true
set drawbox true
set ignorecase true
# set '-eu' options for shell commands
# These options are used to have safer shell commands. Option '-e' is used to
# exit on error and option '-u' is used to give error for unset variables.
# Option '-f' disables pathname expansion which can be useful when $f, $fs, and
# $fx variables contain names with '*' or '?' characters. However, this option
# is used selectively within individual commands as it can be limiting at
# times.
set shellopts '-eu'
# set internal field separator (IFS) to "\n" for shell commands
# This is useful to automatically split file names in $fs and $fx properly
# since default file separator used in these variables (i.e. 'filesep' option)
# is newline. You need to consider the values of these options and create your
# commands accordingly.
set ifs "\n"
# leave some space at the top and the bottom of the screen
set scrolloff 10
# use enter for shell commands
map <enter> shell
# execute current file (must be executable)
map x $$f
map X !$f
# dedicated keys for file opener actions
map o &mimeopen $f
map O $mimeopen --ask $f
# map fzf
map f $lf -remote "send $id select '$(fzf)'"
# define a custom 'open' command
# This command is called when current file is not a directory. You may want to
# use either file extensions and/or mime types here. Below uses an editor for
# text files and a file opener for the rest.
# Custom functions
cmd open ${{
case $(file --mime-type $f -b) in
text/*) $EDITOR $fx;;
*) for f in $fx; do $OPENER $f > /dev/null 2> /dev/null & done;;
case $(file --mime-type "$f" -bL) in
text/*|application/json) nvim "$f";;
video/*|image/*/application/pdf) xdg-open "$f" & disown;;
*) xdg-open "$f" ;;
esac
}}
# define a custom 'rename' command without prompt for overwrite
# cmd rename %[ -e $1 ] && printf "file exists" || mv $f $1
# map r push :rename<space>
cmd mkdir ${{
printf "Directory Name: "
read ans
mkdir $ans
}}
# make sure trash folder exists
# %mkdir -p ~/.trash
cmd mkfile ${{
printf "File Name: "
read ans
$EDITOR $ans
}}
# move current file or selected files to trash folder
# (also see 'man mv' for backup/overwrite options)
cmd trash %set -f; mv $fx ~/.trash
cmd chmod ${{
printf "Mode Bits: "
read ans
# define a custom 'delete' command
# cmd delete ${{
# set -f
# printf "$fx\n"
# printf "delete?[y/n]"
# read ans
# [ $ans = "y" ] && rm -rf $fx
# }}
for file in "$fx"
do
chmod $ans $file
done
}}
# use '<delete>' key for either 'trash' or 'delete' command
# map <delete> trash
map <delete> delete
cmd sudomkfile ${{
printf "File Name: "
read ans
sudo $EDITOR $ans
}}
# extract the current file with the right command
# (xkcd link: https://xkcd.com/1168/)
cmd wallpaperone switch-background-image "$f" 1 2> /dev/null
cmd wallpapertow switch-background-image "$f" 2 2> /dev/null
cmd fzf_jump ${{
res="$(find . -maxdepth 3 | fzf --reverse --header='Jump to location')"
if [ -f "$res" ]; then
cmd="select"
elif [ -d "$res" ]; then
cmd="cd"
fi
lf -remote "send $id $cmd \"$res\""
}}
cmd broot_jump ${{
f=$(mktemp)
res="$(broot --outcmd $f && cat $f | sed 's/cd //')"
rm -f "$f"
if [ -f "$res" ]; then
cmd="select"
elif [ -d "$res" ]; then
cmd="cd"
fi
lf -remote "send $id $cmd \"$res\""
}}
# Archive bindings
cmd extract ${{
set -f
case $f in
*.tar.bz|*.tar.bz2|*.tbz|*.tbz2) tar xjvf $f;;
*.tar.gz|*.tgz) tar xzvf $f;;
*.tar.xz|*.txz) tar xJvf $f;;
*.zip) unzip $f;;
*.rar) unrar x $f;;
*.7z) 7z x $f;;
case "$f" in
*.zip) unzip "$f" ;;
*.tar.gz) tar -xzvf "$f" ;;
*.tar.bz2) tar -xjvf "$f" ;;
*.tar) tar -xvf "$f" ;;
*) echo "Unsupported format" ;;
esac
}}
# compress current file or selected files with tar and gunzip
cmd tar ${{
set -f
mkdir $1
cp -r $fx $1
tar czf $1.tar.gz $1
rm -rf $1
}}
cmd zip %zip -r "$f" "$f"
cmd tar %tar cvf "$f.tar" "$f"
cmd targz %tar cvzf "$f.tar.gz" "$f"
cmd tarbz2 %tar cjvf "$f.tar.bz2" "$f"
# compress current file or selected files with zip
cmd zip ${{
set -f
mkdir $1
cp -r $fx $1
zip -r $1.zip $1
rm -rf $1
}}
# Bindings
# Remove some defaults
map m
map o
map n
map "'"
map '"'
map d
map c
map e
map f
# File Openers
map ee $$EDITOR "$f"
# Archive Mappings
map az zip
map at tar
map ag targz
map ab targz
map ae extract
# Broot Mapping
map f broot_jump
# Basic Functions
map . set hidden!
map DD delete
map p paste
map x cut
map y copy
map <enter> open
map mf mkfile
map mr sudomkfile
map md mkdir
map ch chmod
map bg setwallpaper
map o open_config
map r rename
map H top
map L bottom
map R reload
map C clear
map U unselect
# Movement
map gd. cd ~/Documents
map gD cd ~/Downloads
map gdbb cd ~/Documents/Business/Boekhouding
map gdbi cd ~/Documents/Business/Interne\ zaken
map gdf cd ~/Documents/Finances
map gddd cd ~/Documents/Data\ Dumps
map gdl cd ~/Documents/ledger
map gdo cd ~/Documents/org
map gs cd ~/Sync
map gm. cd ~/music
map gw. cd ~/Pictures/wallpaper/
map gww cd ~/Pictures/wallpaper/Wallpaper
map gws cd ~/Pictures/wallpaper/Wallpaper\ Small
map gw9 cd ~/Pictures/wallpaper/Wallpaper\ 90

View File

@ -10,7 +10,7 @@ show-read-articles no
auto-reload false
reload-time 10
external-url-viewer "urlscan -dc -r 'linkhandler {}'"
notify-program "notify-rss"
notify-program "~/.local/bin/notify-rss"
cache-file "~/.cache/newsboat/cache.db"
bind-key ^R reload-all

View File

@ -3,5 +3,5 @@
if [ "$(systemctl is-active bluetooth.service)" = "active" ]; then
echo ""
else
echo ""
echo "%{F#666}%{F-}"
fi

View File

@ -11,5 +11,5 @@ fi
if [ ! "$unread" -eq 0 ]; then
echo "$icon $unread"
else
echo ""
echo "%{F#666}%{F-}"
fi

View File

@ -1,11 +1,17 @@
;=====================================================
;==========================================================
;
; To learn more about how to configure Polybar
; go to https://github.com/jaagr/polybar
;
; The README contains alot of information
; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
;
;=====================================================
;
; Modified By Ryan Kes.
;
;==========================================================
[colors]
background = ${xrdb:color0:#222}
@ -16,41 +22,49 @@ secondary = ${xrdb:color2:#222}
alert = ${xrdb:color3:#222}
disabled = #666
;== Bars ========================================================
[bar/base]
background = ${colors.background}
foreground = ${colors.foreground}
module-margin-left = 1
module-margin-right = 2
module-margin-right = 1
scroll-up = bspwm-desknext
scroll-down = bspwm-deskprev
cursor-click = pointer
wm-restack = bspwm
[bar/base-laptop]
inherit = "bar/base"
font-0 = FuraCode Nerd Font:pixelsize=16
font-1 = Noto Sans Symbols2:size=16
font-2 = Unifont Upper:size=16
[bar/base-desktop]
inherit = "bar/base"
font-0 = FuraCode Nerd Font:pixelsize=10
font-0 = FuraCode Nerd Font:size=10
font-1 = Noto Sans Symbols2:size=10
font-2 = Unifont Upper:size=10
[bar/laptop-bottom]
inherit = bar/base-laptop
bottom = true
monitor = ${env:MONITOR:eDP1}
modules-right = system-usb-udev filesystem
modules-center = mpd player-mpris-tail
modules-right = system-usb-udev
modules-left = mpd player-mpris-tail
[bar/laptop-top]
inherit = bar/base-laptop
monitor = ${env:MONITOR:eDP1}
modules-left = bspwm
modules-center = battery0 battery1 wlan wg0 wg1 bluetooth
modules-right = xbacklight volume-laptop memory cpu temperature docker updates-arch-combined mail reddit github rss weather date
modules-center = battery0 battery1 seperator wlan wg0 wg1 bluetooth
modules-right = seperator xbacklight volume-laptop seperator docker memory cpu temperature seperator filesystem seperator updates-arch-combined mail reddit github rss seperator weather date
tray-position = right
@ -60,7 +74,7 @@ monitor = ${env:MONITOR:DP-1}
modules-left = bspwm
modules-center = mpd player-mpris-tail
modules-right = eth bluetooth volume memory cpu temperature system-usb-udev filesystem docker updates-arch-combined mail reddit github rss weather date
modules-right = eth bluetooth seperator volume seperator docker memory cpu temperature seperator system-usb-udev filesystem seperator updates-arch-combined mail reddit github rss seperator weather date
tray-position = right
@ -69,25 +83,7 @@ inherit = bar/base-desktop
monitor = ${env:MONITOR:HDMI-2}
modules-left = bspwm
[module/xwindow]
type = internal/xwindow
label = %title:0:30:...%
[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock
format-prefix = " "
format-prefix-foreground = ${colors.foreground-alt}
format-prefix-underline = ${colors.secondary}
label-layout = %layout%
label-layout-underline = ${colors.secondary}
label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-background = ${colors.secondary}
label-indicator-underline = ${colors.secondary}
;== Modules ========================================================
[module/filesystem]
type = internal/fs
@ -103,14 +99,11 @@ type = internal/bspwm
label-focused-background = ${colors.primary}
label-focused-padding = 2
label-occupied-background = ${colors.background}
label-occupied-padding = 2
label-empty =
label-urgent-background = ${colors.alert}
label-urgent-padding = 2
label-empty-foreground = ${colors.foreground-alt}
label-empty-padding = 2
@ -120,8 +113,11 @@ pin-workspaces = true
type = internal/mpd
format-online = <icon-prev> <icon-seekb> <icon-stop> <toggle> <icon-seekf> <icon-next> <icon-repeat> <icon-random> <bar-progress> <label-time> <label-song>
format-stopped =
label-song = 𝄞 %artist% - %title%
label-song-maxlen = 25
label-song-ellipsis = true
icon-play = ⏵
icon-pause = ⏸
@ -136,10 +132,6 @@ icon-repeatone = 🔂
icon-single = 🔂
icon-consume = ✀
label-song-maxlen = 25
label-song-ellipsis = true
; Only applies if <bar-progress> is used
bar-progress-width = 45
bar-progress-indicator = |
bar-progress-fill = ─
@ -162,16 +154,13 @@ bar-empty = ─
bar-empty-font = 2
bar-empty-foreground = ${colors.foreground-alt}
[module/backlight-acpi]
inherit = module/xbacklight
type = internal/backlight
card = intel_backlight
[module/cpu]
type = internal/cpu
format-prefix = " "
label = %percentage%%
format = <label> <ramp-coreload>
format-prefix = " "
label = %percentage%%
ramp-coreload-0 = ▁
ramp-coreload-1 = ▂
@ -184,7 +173,9 @@ ramp-coreload-7 = █
[module/memory]
type = internal/memory
format-prefix = " "
label = %percentage_used%%
ramp-used-0 = ▁
@ -212,18 +203,8 @@ label-disconnected =
animation-packetloss-0 = ⚠
animation-packetloss-1 = 📶
; Framerate in milliseconds
animation-packetloss-framerate = 500
[module/tun1]
type = internal/network
interface = tun1
interval = 3.0
format-connected-underline = #55aa55
format-connected-prefix = "嬨 "
label-connected = "%ifname%"
[module/eth]
type = internal/network
interface = eno1
@ -235,12 +216,10 @@ label-connected = "%local_ip%  %downspeed%  %upspeed%"
[module/date]
type = internal/date
date =
date-alt = " %d-%m-%Y"
time = %H:%M
time-alt = %H:%M:%S
time = "%H:%M"
time-alt =
format-prefix = 
@ -249,7 +228,6 @@ label-padding-right=1
[module/volume]
type = internal/pulseaudio
sink = alsa_output.pci-0000_00_1b.0.iec958-stereo
label-volume = 蓼 %percentage%%
@ -260,7 +238,6 @@ click-right = pavucontrol &
[module/volume-laptop]
type = internal/pulseaudio
sink = alsa_output.pci-0000_00_1f.3.analog-stereo
label-volume = 蓼 %percentage%%
@ -277,7 +254,6 @@ full-at = 70
format-charging = <animation-charging> <label-charging>
format-discharging = <animation-discharging> <label-discharging>
format-full-prefix = " "
format-full-prefix-foreground = ${colors.foreground-alt}
@ -303,7 +279,6 @@ full-at = 70
format-charging = <animation-charging> <label-charging>
format-discharging = <animation-discharging> <label-discharging>
format-full-prefix = " "
format-full-prefix-foreground = ${colors.foreground-alt}
@ -325,126 +300,112 @@ animation-discharging-framerate = 5000
type = internal/temperature
format-prefix = " "
label-warn-foreground = ${colors.alert}
[module/powermenu]
type = custom/menu
expand-right = true
format-spacing = 1
label-open = 
label-open-foreground = ${colors.secondary}
label-close =  cancel
label-close-foreground = ${colors.secondary}
label-separator = |
label-separator-foreground = ${colors.foreground-alt}
menu-0-0 = reboot
menu-0-0-exec = menu-open-1
menu-0-1 = power off
menu-0-1-exec = menu-open-2
menu-1-0 = cancel
menu-1-0-exec = menu-open-0
menu-1-1 = reboot
menu-1-1-exec = sudo reboot
menu-2-0 = power off
menu-2-0-exec = sudo poweroff
menu-2-1 = cancel
menu-2-1-exec = menu-open-0
[module/github]
type = internal/github
token = ${file:~/.github-access-token}
empty-notificaitons = false
interval = 300
format-prefix = " "
format-prefix-foreground=${colors.alert}
format-offline =
label-foreground = ${colors.alert}
empty-notificaitons = false
[module/updates-arch-combined]
type = custom/script
exec = sh ~/.local/share/polybar-scripts/polybar-scripts/updates-arch-combined/updates-arch-combined.sh | tr -d "\#\ "
interval = 600
click-left = setsid alacritty --class=updatearch,updatearch -e update-arch
format-prefix = " "
[module/player-mpris-tail]
type = custom/script
exec = python ~/.local/share/polybar-scripts/polybar-scripts/player-mpris-tail/player-mpris-tail.py -f '{:title: {icon} {artist} - {title}:}' --icon-playing '契' --icon-paused '' --icon-stop '栗'
tail = true
click-left = python ~/.local/share/polybar-scripts/polybar-scripts/player-mpris-tail/player-mpris-tail.py previous &
click-right = python ~/.local/share/polybar-scripts/polybar-scripts/player-mpris-tail/player-mpris-tail.py next &
click-middle = python ~/.local/share/polybar-scripts/polybar-scripts/player-mpris-tail/player-mpris-tail.py play-pause &
[module/bluetooth]
type = custom/script
exec = ~/.config/polybar/bin/isactive-bluetooth
click-left = ~/.config/polybar/bin/switch-bluetooth
[module/rss]
type = custom/script
exec = ~/.config/polybar/bin/rsscount
click-left = setsid alacritty --class newsboat,newsboat -e /usr/bin/newsboat
click-middle = setsid ~/.local/bin/newsup
[module/mail]
type = custom/script
exec = ~/.config/polybar/bin/mailcount
click-left = setsid alacritty --class neomutt,neomutt -e neomutt
click-middle = mailsync &
[module/docker]
type = custom/script
exec = ~/.config/polybar/bin/dockerstatus
label =  %output%
[module/reddit]
type = custom/script
exec = ~/.config/polybar/bin/notification-reddit.sh
interval = 300
label =  %output%
click-left = brave https://www.reddit.com/message/unread
[module/system-usb-udev]
type = custom/script
exec = sh ~/.config/polybar/bin/system-usb-udev
tail = true
click-left = sh ~/.config/polybar/bin/system-usb-udev --mount &
click-right = sh ~/.config/polybar/bin/system-usb-udev --unmount &
[module/wg0]
type = custom/script
exec = ~/.config/polybar/bin/wireguard-status wg0
;This doesn't work when run in the background for some reason
click-left = ~/.local/bin/wireguard-switch wg0
[module/wg1]
type = custom/script
exec = ~/.config/polybar/bin/wireguard-status wg1
;This doesn't work when run in the background for some reason
click-left = ~/.local/bin/wireguard-switch wg1
[module/weather]
type = custom/script
exec = curl --silent "https://wttr.in/?format=2"
click-left = setsid alacritty --class wttr,wttr -e ~/.config/polybar/bin/wttr-and-wait
interval = 900
click-left = setsid alacritty --class wttr,wttr -e ~/.config/polybar/bin/wttr-and-wait
[module/seperator]
type = custom/text
content = "|"
content-foreground = ${colors.primary}
;== Other Settings ========================================================
[settings]
screenchange-reload = true
;compositing-background = xor
;compositing-background = screen
;compositing-foreground = source
;compositing-border = over
[global/wm]
margin-top = 5

View File

@ -1,71 +0,0 @@
" Ranger devicons for ViFM
" https://github.com/cirala/vifm_devicons
"
" Filetypes/directories
set classify=' :dir:/, :exe:, :reg:, :link:,? :?:, ::../::'
" Specific files
set classify+=' ::.Xdefaults,,.Xresources,,.bashprofile,,.bash_profile,,.bashrc,,.dmrc,,.d_store,,.fasd,,.gitconfig,,.gitignore,,.jack-settings,,.mime.types,,.nvidia-settings-rc,,.pam_environment,,.profile,,.recently-used,,.selected_editor,,.xinitpurc,,.zprofile,,.yarnc,,.snclirc,,.tmux.conf,,.urlview,,.config,,.ini,,.user-dirs.dirs,,.mimeapps.list,,.offlineimaprc,,.msmtprc,,.Xauthority,,config::'
set classify+=' ::dropbox::'
set classify+=' ::favicon.*,,README,,readme::'
set classify+=' ::.vim,,.vimrc,,.gvimrc,,.vifm::'
set classify+=' ::gruntfile.coffee,,gruntfile.js,,gruntfile.ls::'
set classify+=' ::gulpfile.coffee,,gulpfile.js,,gulpfile.ls::'
set classify+=' ::ledger::'
set classify+=' ::license,,copyright,,copying,,LICENSE,,COPYRIGHT,,COPYING::'
set classify+=' ::node_modules::'
set classify+=' ::react.jsx::'
" File extensions
set classify+='λ ::*.ml,,*.mli::'
set classify+=' ::*.styl::'
set classify+=' ::*.scss::'
set classify+=' ::*.py,,*.pyc,,*.pyd,,*.pyo::'
set classify+=' ::*.php::'
set classify+=' ::*.markdown,,*.md::'
set classify+=' ::*.json::'
set classify+=' ::*.js::'
set classify+=' ::*.bmp,,*.gif,,*.ico,,*.jpeg,,*.jpg,,*.png,,*.svg,,*.svgz,,*.tga,,*.tiff,,*.xmb,,*.xcf,,*.xpm,,*.xspf,,*.xwd,,*.cr2,,*.dng,,*.3fr,,*.ari,,*.arw,,*.bay,,*.crw,,*.cr3,,*.cap,,*.data,,*.dcs,,*.dcr,,*drf,,*.eip,,*.erf,,*.fff,,*.gpr,,*.iiq,,*.k25,,*.kdc,,*.mdc,,.*mef,,*.mos,,.*.mrw,,.*.obm,,*.orf,,*.pef,,*.ptx,,*.pxn,,*.r3d,,*.raf,,*.raw,,*.rwl,,*.rw2,,*.rwz,,*.sr2,,*.srf,,*.srf,,*.srw,,*.tif,,*.x3f::'
set classify+=' ::*.ejs,,*.htm,,*.html,,*.slim,,*.xml::'
set classify+=' ::*.mustasche::'
set classify+=' ::*.css,,*.less,,*.bat,,*.conf,,*.ini,,*.rc,,*.yml,,*.cfg,,*.rc::'
set classify+=' ::*.rss::'
set classify+=' ::*.coffee::'
set classify+=' ::*.twig::'
set classify+=' ::*.c++,,*.cc,,*.c,,*.cpp,,*.cxx,,*.c,,*.h::'
set classify+=' ::*.hs,,*.lhs::'
set classify+=' ::*.lua::'
set classify+=' ::*.jl::'
set classify+=' ::*.go::'
set classify+=' ::*.ts::'
set classify+=' ::*.db,,*.dump,,*.sql::'
set classify+=' ::*.sln,,*.suo::'
set classify+=' ::*.exe::'
set classify+=' ::*.diff,,*.sum,,*.md5,,*.sha512::'
set classify+=' ::*.scala::'
set classify+=' ::*.java,,*.jar::'
set classify+=' ::*.xul::'
set classify+=' ::*.clj,,*.cljc::'
set classify+=' ::*.pl,,*.pm,,*.t::'
set classify+=' ::*.cljs,,*.edn::'
set classify+=' ::*.rb::'
set classify+=' ::*.fish,,*.sh,,*.bash::'
set classify+=' ::*.dart::'
set classify+=' ::*.f#,,*.fs,,*.fsi,,*.fsscript,,*.fsx::'
set classify+=' ::*.rlib,,*.rs::'
set classify+=' ::*.d::'
set classify+=' ::*.erl,,*.hrl::'
set classify+=' ::*.ai::'
set classify+=' ::*.psb,,*.psd::'
set classify+=' ::*.jsx::'
set classify+=' ::*.vim,,*.vimrc::'
set classify+=' ::*.aac,,*.anx,,*.asf,,*.au,,*.axa,,*.flac,,*.m2a,,*.m4a,,*.mid,,*.midi,,*.mp3,,*.mpc,,*.oga,,*.ogg,,*.ogx,,*.ra,,*.ram,,*.rm,,*.spx,,*.wav,,*.wma,,*.ac3::'
set classify+=' ::*.avi,,*.flv,,*.mkv,,*.mov,,*.mov,,*.mp4,,*.mpeg,,*.mpg,,*.webm::'
set classify+=' ::*.epub,,*.pdf,,*.fb2,,*.djvu::'
set classify+=' ::*.7z,,*.apk,,*.bz2,,*.cab,,*.cpio,,*.deb,,*.gem,,*.gz,,*.gzip,,*.lh,,*.lzh,,*.lzma,,*.rar,,*.rpm,,*.tar,,*.tgz,,*.xz,,*.zip::'
set classify+=' ::*.cbr,,*.cbz::'
set classify+=' ::*.log::'
set classify+=' ::*.doc,,*.docx,,*.adoc::'
set classify+=' ::*.xls,,*.xls,,*.xlsmx::'
set classify+=' ::*.pptx,,*.ppt::'

View File

@ -1,80 +0,0 @@
" You can edit this file by hand.
" The " character at the beginning of a line comments out the line.
" Blank lines are ignored.
" The Default color scheme is used for any directory that does not have
" a specified scheme and for parts of user interface like menus. A
" color scheme set for a base directory will also
" be used for the sub directories.
" The standard ncurses colors are:
" Default = -1 = None, can be used for transparency or default color
" Black = 0
" Red = 1
" Green = 2
" Yellow = 3
" Blue = 4
" Magenta = 5
" Cyan = 6
" White = 7
" Light versions of colors are also available (set bold attribute):
" LightBlack
" LightRed
" LightGreen
" LightYellow
" LightBlue
" LightMagenta
" LightCyan
" LightWhite
" Available attributes (some of them can be combined):
" bold
" underline
" reverse or inverse
" standout
" italic (on unsupported systems becomes reverse)
" none
" Vifm supports 256 colors you can use color numbers 0-255
" (requires properly set up terminal: set your TERM environment variable
" (directly or using resources) to some color terminal name (e.g.
" xterm-256color) from /usr/lib/terminfo/; you can check current number
" of colors in your terminal with tput colors command)
" highlight group cterm=attrs ctermfg=foreground_color ctermbg=background_color
highlight clear
highlight Win cterm=none ctermfg=white ctermbg=black
highlight Directory cterm=bold ctermfg=cyan ctermbg=default
highlight Link cterm=bold ctermfg=yellow ctermbg=default
highlight BrokenLink cterm=bold ctermfg=red ctermbg=default
highlight Socket cterm=bold ctermfg=magenta ctermbg=default
highlight Device cterm=bold ctermfg=red ctermbg=default
highlight Fifo cterm=bold ctermfg=cyan ctermbg=default
highlight Executable cterm=bold ctermfg=green ctermbg=default
highlight Selected cterm=bold ctermfg=magenta ctermbg=default
highlight CurrLine cterm=bold,reverse ctermfg=default ctermbg=default
highlight TopLine cterm=none ctermfg=black ctermbg=white
highlight TopLineSel cterm=bold ctermfg=black ctermbg=default
highlight StatusLine cterm=bold ctermfg=black ctermbg=white
highlight WildMenu cterm=underline,reverse ctermfg=white ctermbg=black
highlight CmdLine cterm=none ctermfg=white ctermbg=black
highlight ErrorMsg cterm=none ctermfg=red ctermbg=black
highlight Border cterm=none ctermfg=black ctermbg=white
highlight JobLine cterm=bold,reverse ctermfg=black ctermbg=white
highlight SuggestBox cterm=bold ctermfg=default ctermbg=default
highlight CmpMismatch cterm=bold ctermfg=white ctermbg=red
highlight AuxWin cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight TabLine cterm=none ctermfg=white ctermbg=black
highlight TabLineSel cterm=bold,reverse ctermfg=default ctermbg=default
highlight User1 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User2 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User3 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User4 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User5 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User6 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User7 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User8 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User9 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default

View File

@ -1,31 +0,0 @@
" Molokai
" by Miguel Madrid Mencia
" https://github.com/vifm/vifm-colors
highlight clear
highlight Border cterm=none ctermfg=black ctermbg=default
highlight BrokenLink cterm=bold ctermfg=red ctermbg=default
highlight CmdLine cterm=none ctermfg=white ctermbg=default
highlight CurrLine cterm=bold ctermfg=default ctermbg=208
highlight Device cterm=bold ctermfg=red ctermbg=default
highlight Directory cterm=bold ctermfg=12 ctermbg=default
highlight ErrorMsg cterm=none ctermfg=red ctermbg=black
highlight Executable cterm=bold ctermfg=green ctermbg=default
highlight Fifo cterm=bold ctermfg=cyan ctermbg=default
highlight Link cterm=bold ctermfg=green ctermbg=default
highlight OtherLine cterm=bold ctermfg=default ctermbg=130
highlight Selected cterm=bold ctermfg=magenta ctermbg=default
highlight Socket cterm=bold ctermfg=magenta ctermbg=default
highlight StatusLine cterm=none ctermfg=white ctermbg=default
highlight SuggestBox cterm=none ctermfg=white ctermbg=black
highlight TopLine cterm=none ctermfg=15 ctermbg=default
highlight TopLineSel cterm=none ctermfg=148 ctermbg=default
highlight WildMenu cterm=underline,reverse ctermfg=white ctermbg=black
highlight Win cterm=none ctermfg=white ctermbg=default
if $USER == 'root'
highlight Border cterm=none ctermfg=default ctermbg=red
highlight StatusLine cterm=none ctermfg=white ctermbg=red
highlight TopLine cterm=none ctermfg=default ctermbg=red
endif

View File

@ -1,45 +0,0 @@
" VIFM COLORS
" solarized dark
" based on: https://github.com/istib/dotfiles/blob/master/vifm/vifm-colors
" Default = -1 = None, can be used for transparency or default color
" Black = 0
" Red = 1
" Green = 2
" Yellow = 3
" Blue = 4
" Magenta = 5
" Cyan = 6
" White = 7
" STYLES
" bold
" underline
" reverse or inverse
" standout
" none
highlight clear
highlight Win cterm=none ctermfg=default ctermbg=none
highlight TopLine cterm=none ctermfg=blue ctermbg=none
highlight TopLineSel cterm=none ctermfg=blue ctermbg=none
highlight StatusLine cterm=none ctermfg=blue ctermbg=none
highlight Border cterm=none ctermfg=blue ctermbg=none
highlight Selected cterm=bold ctermfg=magenta ctermbg=default
highlight CurrLine cterm=bold ctermfg=default ctermbg=blue
highlight WildMenu cterm=underline,reverse ctermfg=white ctermbg=black
highlight CmdLine cterm=none ctermfg=white ctermbg=black
highlight ErrorMsg cterm=none ctermfg=red ctermbg=black
highlight Directory cterm=none ctermfg=cyan ctermbg=default
highlight Link cterm=none ctermfg=yellow ctermbg=default
highlight BrokenLink cterm=none ctermfg=red ctermbg=default
highlight Socket cterm=none ctermfg=magenta ctermbg=default
highlight Device cterm=none ctermfg=red ctermbg=default
highlight Fifo cterm=none ctermfg=cyan ctermbg=default
highlight Executable cterm=none ctermfg=green ctermbg=default

View File

@ -1,6 +0,0 @@
This directory is dedicated for user-supplied scripts/executables.
vifm modifies its PATH environment variable to let user run those
scripts without specifying full path. All subdirectories are added
as well. File in a subdirectory overrules file with the same name
in parent directories. Restart might be needed to recognize files
in newly created or renamed subdirectories.

View File

@ -1,377 +0,0 @@
" vim: filetype=vifm :
" vim alias
set vicmd=nvim
" set vicmd=elvis\ -G\ termcap
" set vicmd=vile
" This makes vifm perform file operations on its own instead of relying on
" standard utilities like `cp`. While using `cp` and alike is a more universal
" solution, it's also much slower when processing large amounts of files and
" doesn't support progress measuring.
set syscalls
" Trash Directory
" The default is to move files that are deleted with dd or :d to
" the trash directory. If you change this you will not be able to move
" files by deleting them and then using p to put the file in the new location.
" I recommend not changing this until you are familiar with vifm.
" This probably shouldn't be an option.
set trash
" This is how many directories to store in the directory history.
set history=100
" Automatically resolve symbolic links on l or Enter.
set nofollowlinks
" Natural sort of (version) numbers within text.
set sortnumbers
" Maximum number of changes that can be undone.
set undolevels=100
" If you installed the vim.txt help file set vimhelp.
" If would rather use a plain text help file set novimhelp.
set novimhelp
" If you would like to run an executable file when you
" press return on the file name set this.
set norunexec
" Selected color scheme
colorscheme molokai
" Format for displaying time in file list. For example:
" TIME_STAMP_FORMAT=%m/%d-%H:%M
" See man date or man strftime for details.
set timefmt=%m-%d-%Y\ %H:%M
" Show list of matches on tab completion in command-line mode
set wildmenu
" Display completions in a form of popup with descriptions of the matches
set wildstyle=popup
" Display suggestions in normal, visual and view modes for keys, marks and
" registers (at most 5 files). In other view, when available.
set suggestoptions=normal,visual,view,otherpane,keys,marks,registers
" Ignore case in search patterns unless it contains at least one uppercase
" letter
set ignorecase
set smartcase
" Don't highlight search results automatically
set nohlsearch
" Use increment searching (search while typing)
set incsearch
" Try to leave some space from cursor to upper/lower border in lists
set scrolloff=4
" Set custom status line look
set statusline=" Hint: %z%= %A %10u:%-7g %15s %20d "
" ------------------------------------------------------------------------------
" :mark mark /full/directory/path [filename]
mark h ~/
mark b ~/.local/bin
mark d ~/Documents
mark w ~/Pictures/wallpaper
" ------------------------------------------------------------------------------
" :com[mand][!] command_name action
" The following macros can be used in a command
" %a is replaced with the user arguments.
" %c the current file under the cursor.
" %C the current file under the cursor in the other directory.
" %f the current selected file, or files.
" %F the current selected file, or files in the other directory.
" %b same as %f %F.
" %d the current directory name.
" %D the other window directory name.
" %m run the command in a menu window
command! df df -h %m 2> /dev/null
command! diff nvim -d %f %F
command! zip zip -r %f.zip %f
command! run !! ./%f
command! make !!make %a
command! mkcd :mkdir %a | cd %a
command! vgrep nvim "+grep %a"
command! reload :write | restart
command! ncdu ncdu %d 2> /dev/null
command! lockwallpaper generate-lock-image %f 2> /dev/null
command! backgroundwallpaperone switch-background-image %f 1 2> /dev/null
command! backgroundwallpapertwo switch-background-image %f 2 2> /dev/null
" Fuzzy file search
command! FZFfind :set noquickview | :execute 'goto "'.system('find | fzf --height 10 2>/dev/tty ').'"%IU' | redraw
" ------------------------------------------------------------------------------
" The file type is for the default programs to be used with
" a file extension.
" :filetype pattern1,pattern2 defaultprogram,program2
" :fileviewer pattern1,pattern2 consoleviewer
" The other programs for the file type can be accessed with the :file command
" The command macros %f, %F, %d, %F may be used in the commands.
" The %a macro is ignored. To use a % you must put %%.
" For automated FUSE mounts, you must register an extension with :file[x]type
" in one of following formats:
"
" :filetype extensions FUSE_MOUNT|some_mount_command using %SOURCE_FILE and %DESTINATION_DIR variables
" %SOURCE_FILE and %DESTINATION_DIR are filled in by vifm at runtime.
" A sample line might look like this:
" :filetype *.zip,*.jar,*.war,*.ear FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR
"
" :filetype extensions FUSE_MOUNT2|some_mount_command using %PARAM and %DESTINATION_DIR variables
" %PARAM and %DESTINATION_DIR are filled in by vifm at runtime.
" A sample line might look like this:
" :filetype *.ssh FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR
" %PARAM value is filled from the first line of file (whole line).
" Example first line for SshMount filetype: root@127.0.0.1:/
"
" You can also add %CLEAR if you want to clear screen before running FUSE
" program.
" Inline previews
fileviewer *.pdf
\ vifmimg pdfpreview %px %py %pw %ph %c
\ %pc
\ vifmimg clear
fileviewer *.epub
\ vifmimg epubpreview %px %py %pw %ph %c
\ %pc
\ vifmimg clear
fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
\*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
\ vifmimg videopreview %px %py %pw %ph %c
\ %pc
\ vifmimg clear
fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.xpm
\ vifmimg draw %px %py %pw %ph %c
\ %pc
\ vifmimg clear
fileviewer *.gif
\ vifmimg gifpreview %px %py %pw %ph %c
\ %pc
\ vifmimg clear
fileviewer *.ico
\ vifmimg magickpreview %px %py %pw %ph %c
\ %pc
\ vifmimg clear
fileviewer *.mp3 mp3info
fileviewer *.flac soxi
fileviewer *.zip,*.tgz,*.tar.gz,*.rar pistol %c
" Man page
filetype *.[1-8] man ./%c
fileviewer *.[1-8] man ./%c | col -b
" MD5
filetype *.md5
\ {Check MD5 hash sum}
\ md5sum -c %f %S,
" SHA1
filetype *.sha1
\ {Check SHA1 hash sum}
\ sha1sum -c %f %S,
" SHA256
filetype *.sha256
\ {Check SHA256 hash sum}
\ sha256sum -c %f %S,
" SHA512
filetype *.sha512
\ {Check SHA512 hash sum}
\ sha512sum -c %f %S,
" GPG signature
filetype *.asc
\ {Check signature}
\ !!gpg --verify %c,
" FuseZipMount
filetype *.zip,*.jar,*.war,*.ear,*.oxt,*.apkg
\ {Mount with fuse-zip}
\ FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR,
\ {View contents}
\ zip -sf %c | less,
\ {Extract here}
\ tar -xf %c,
" ArchiveMount
filetype *.tar,*.tar.bz2,*.tbz2,*.tgz,*.tar.gz,*.tar.xz,*.txz
\ {Mount with archivemount}
\ FUSE_MOUNT|archivemount %SOURCE_FILE %DESTINATION_DIR,
" Rar2FsMount and rar archives
filetype *.rar
\ {Mount with rar2fs}
\ FUSE_MOUNT|rar2fs %SOURCE_FILE %DESTINATION_DIR,
" Office files
fileviewer *.doc catdoc %c
fileviewer *.docx docx2txt.pl %f -
fileviewer *.odt,*.ods,*.odp,*.sxw odt2txt %c
" default file view/preview
filetype * gio open
fileviewer * env -uCOLORTERM bat -r 0:50 --color always --wrap never --pager never %c -p
" ------------------------------------------------------------------------------
" What should be saved automatically between vifm runs
" Like in previous versions of vifm
" set vifminfo=options,filetypes,commands,bookmarks,dhistory,state,cs
" Like in vi
set vifminfo=dhistory,savedirs,chistory,state,tui,shistory,
\phistory,fhistory,dirstack,registers,bookmarks,bmarks
" ------------------------------------------------------------------------------
" Examples of configuring both panels
" Customize view columns a bit (enable ellipsis for truncated file names)
"
" set viewcolumns=-{name}..,6{}.
" Filter-out build and temporary files
"
" filter! /^.*\.(lo|o|d|class|py[co])$|.*~$/
" ------------------------------------------------------------------------------
" Sample mappings
" Start shell in current directory
nnoremap s :shell<cr>
" Display sorting dialog
nnoremap S :sort<cr>
" Toggle visibility of preview window
nnoremap w :view<cr>
vnoremap w :view<cr>gv
" Open file in existing instance of gvim
nnoremap o :!gvim --remote-tab-silent %f<cr>
" Open file in new instance of gvim
nnoremap O :!gvim %f<cr>
" Open file in the background using its default program
nnoremap gb :file &<cr>l
" Yank current directory path into the clipboard
nnoremap yd :!echo %d | xclip -selection clipboard %i<cr>
" Yank current file path into the clipboard
nnoremap yf :!echo %c:p | xclip -selection clipboard %i<cr>
" yank current filename without path into the clipboard
nnoremap yn :!echo -n %c | xclip -selection clipboard %i<cr>
" yank root of current file's name into the clipboard
nnoremap yr :!echo -n %c:r | xclip -selection clipboard %i<cr>
" Mappings for faster renaming
nnoremap I cw<c-a>
nnoremap cc cw<c-u>
nnoremap A cw
" Open console in current directory
nnoremap ,t :!st &<cr>
" Open editor to edit vifmrc and apply settings after returning to vifm
nnoremap ,c :write | edit $MYVIFMRC | restart<cr>
" Open gvim to edit vifmrc
nnoremap ,C :!st -e nvim %i $MYVIFMRC &<cr>
" Toggle wrap setting on ,w key
nnoremap ,w :set wrap!<cr>
" Example of standard two-panel file managers mappings
nnoremap <f3> :!less %f<cr>
nnoremap <f4> :edit<cr>
nnoremap <f5> :copy<cr>
nnoremap <f6> :move<cr>
nnoremap <f7> :mkdir<space>
nnoremap <f8> :delete<cr>
" Generate lock wallapaper
nnoremap ,l :lockwallpaper<cr>
" Generate background image wallpaper
nnoremap ,w1 :backgroundwallpaperone<cr>
nnoremap ,w2 :backgroundwallpapertwo<cr>
" quit
nnoremap q :q!<cr>
" Fuzzy search
nnoremap <c-f> :FZFfind<cr>
" ------------------------------------------------------------------------------
" Various customization examples
" Use ag (the silver searcher) instead of grep
"
" set grepprg='ag --line-numbers %i %a %s'
" Add additional place to look for executables
"
" let $PATH = $HOME.'/bin/fuse:'.$PATH
" Block particular shortcut
"
" nnoremap <left> <nop>
" Export IPC name of current instance as environment variable and use it to
" communicate with the instance later.
"
" It can be used in some shell script that gets run from inside vifm, for
" example, like this:
" vifm --server-name "$VIFM_SERVER_NAME" --remote +"cd '$PWD'"
"
" let $VIFM_SERVER_NAME = v:servername
" pdf review keybindings
map > :!vifmimg inc<CR>
map < :!vifmimg dec<CR>
" load devicons
source ~/.config/vifm//SETUP

View File

@ -1,154 +0,0 @@
#!/usr/bin/env bash
readonly ID_PREVIEW="preview"
#PLAY_GIF="yes"
# By enabling this option the GIF will be animated, by leaving it commented like it
# is now will make the gif previews behave the same way as video previews.
#AUTO_REMOVE="yes"
# By enabling this option the script will remove the preview file after it is drawn
# and by doing so the preview will always be up-to-date with the file.
# This however, requires more CPU and therefore affects the overall performance.
# The messy code below is for moving pages in pdf files in the vifm file preview by
# utilizing the < and > keys which will be bound to `vifmimg inc` or `vifmimg dec`.
PDF_PAGE_CONFIG="$HOME/.config/vifm/vifmimgpdfpage"
PDF_FILE_CONFIG="$HOME/.config/vifm/vifmimgpdffile"
PDF_PAGE=1
PDF_FILE=""
# Initialize the variables and required files
[[ -f "$PDF_PAGE_CONFIG" ]] && PDF_PAGE=$(cat $PDF_PAGE_CONFIG) || touch $PDF_PAGE_CONFIG
[[ -f "$PDF_FILE_CONFIG" ]] && PDF_FILE=$(cat $PDF_FILE_CONFIG) || touch $PDF_FILE_CONFIG
# Create temporary working directory if the directory structure doesn't exist
if [[ ! -d "/tmp$PWD/" ]]; then
mkdir -p "/tmp$PWD/"
fi
function inc() {
VAL="$(cat $PDF_PAGE_CONFIG)"
echo "$(expr $VAL + 1)" > $PDF_PAGE_CONFIG
}
function dec() {
VAL="$(cat $PDF_PAGE_CONFIG)"
echo "$(expr $VAL - 1)" > $PDF_PAGE_CONFIG
if [[ $VAL -le 0 ]]; then
echo 0 > $PDF_PAGE_CONFIG
fi
}
function previewclear() {
declare -p -A cmd=([action]=remove [identifier]="$ID_PREVIEW") \
> "$FIFO_UEBERZUG"
}
function fileclean() {
if [[ -f "/tmp$PWD/$6.png" ]]; then
rm -f "/tmp$PWD/$6.png"
elif [[ -d "/tmp$PWD/$6/" ]]; then
rm -rf "/tmp$PWD/$6/"
fi
}
function preview() {
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
[x]="$2" [y]="$3" [width]="$4" [height]="$5" \
[path]="$PWD/$6") \
> "$FIFO_UEBERZUG"
}
function previewvideo() {
if [[ ! -f "/tmp$PWD/$6.png" ]]; then
ffmpegthumbnailer -i "$PWD/$6" -o "/tmp$PWD/$6.png" -s 0 -q 10
fi
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
[x]="$2" [y]="$3" [width]="$4" [height]="$5" \
[path]="/tmp$PWD/$6.png") \
> "$FIFO_UEBERZUG"
}
function previewepub() {
if [[ ! -f "/tmp$PWD/$6.png" ]]; then
epub-thumbnailer "$6" "/tmp$PWD/$6.png" 1024
fi
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
[x]="$2" [y]="$3" [width]="$4" [height]="$5" \
[path]="/tmp$PWD/$6.png") \
> "$FIFO_UEBERZUG"
}
function previewgif() {
if [[ ! -d "/tmp$PWD/$6/" ]]; then
mkdir -p "/tmp$PWD/$6/"
convert -coalesce "$PWD/$6" "/tmp$PWD/$6/$6.png"
fi
if [[ ! -z "$PLAY_GIF" ]]; then
for frame in $(ls -1 /tmp$PWD/$6/$6*.png | sort -V); do
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
[x]="$2" [y]="$3" [width]="$4" [height]="$5" \
[path]="$frame") \
> "$FIFO_UEBERZUG"
# Sleep between frames to make the animation smooth.
sleep .07
done
else
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
[x]="$2" [y]="$3" [width]="$4" [height]="$5" \
[path]="/tmp$PWD/$6/$6-0.png") \
> "$FIFO_UEBERZUG"
fi
}
function previewpdf() {
if [[ ! "$6" == "$PDF_FILE" ]]; then
PDF_PAGE=1
echo 1 > $PDF_PAGE_CONFIG
rm -f "/tmp$PWD/$6.png"
fi
if [[ ! "$PDF_PAGE" == "1" ]] && [[ -f "/tmp$PWD/$6.png" ]]; then
rm -f "/tmp$PWD/$6.png"
fi
if [[ ! -f "/tmp$PWD/$6.png" ]]; then
pdftoppm -png -f $PDF_PAGE -singlefile "$6" "/tmp$PWD/$6"
fi
echo "$6" > $PDF_FILE_CONFIG
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
[x]="$2" [y]="$3" [width]="$4" [height]="$5" \
[path]="/tmp$PWD/$6.png") \
> "$FIFO_UEBERZUG"
}
function previewmagick() {
if [[ ! -f "/tmp$PWD/$6.png" ]]; then
convert -thumbnail $(identify -format "%wx%h" "$6") "$PWD/$6" "/tmp$PWD/$6.png"
fi
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
[x]="$2" [y]="$3" [width]="$4" [height]="$5" \
[path]="/tmp$PWD/$6.png") \
> "$FIFO_UEBERZUG"
}
function main() {
case "$1" in
"inc") inc "$@" ;;
"dec") dec "$@" ;;
"clear") previewclear "$@" ;;
"clean") fileclean "$@" ;;
"draw") preview "$@" ;;
"videopreview") previewvideo "$@" ;;
"epubpreview") previewepub "$@" ;;
"gifpreview") previewgif "$@" ;;
"pdfpreview") previewpdf "$@" ;;
"magickpreview") previewmagick "$@" ;;
"*") echo "Unknown command: '$@'" ;;
esac
}
main "$@"

View File

@ -1,15 +0,0 @@
#!/usr/bin/env bash
export FIFO_UEBERZUG="/tmp/vifm-ueberzug-${PPID}"
function cleanup {
rm "$FIFO_UEBERZUG" 2>/dev/null
pkill -P $$ 2>/dev/null
}
pkill -P $$ 2>/dev/null
rm "$FIFO_UEBERZUG" 2>/dev/null
mkfifo "$FIFO_UEBERZUG" >/dev/null
trap cleanup EXIT 2>/dev/null
tail --follow "$FIFO_UEBERZUG" | ueberzug layer --silent --parser bash 2>&1 >/dev/null &
vifm
cleanup