dgy
/
hexagons
Archived
1
0
Fork 0

el commit anterior fue el #100, hagamos una fiesta. cambios en wm, teclas, multihead. css para firefox 72. lf. un par de giladas mas.

This commit is contained in:
deadguy 2020-01-23 11:25:42 -03:00
parent 37071830fe
commit 6cd2e26503
Signed by: dgy
GPG Key ID: 37CA55B52CF63730
13 changed files with 315 additions and 51 deletions

View File

@ -68,9 +68,10 @@ bspc rule -a Zathura state=tiled
bspc rule -a Oblogout state=fullscreen, layer=above
bspc rule -a Firefox:Navigator state=tiled
bspc rule -a Firefox desktop='^2'
bspc rule -a Termite:archi desktop='^3'
bspc rule -a Termite:multi desktop='^1'
setbg &
unclutter &
sleep 3s
if xrandr | grep "VGA1 connected"; then
xrandr --output LVDS1 --auto --output VGA1 --auto --right-of LVDS1
fi

154
.config/lf/lfrc Normal file
View File

@ -0,0 +1,154 @@
# Basic Settings
set shell zsh
set shellopts '-eu:--shwordsplit'
set ifs "\n"
set scrolloff 5
set icons
set previewer ~/bin/lf-preview
set wrapscroll
set number
set sortby time
set info size:time
set reverse
set incsearch
set ratios '1:3:2'
set color256
%{{
w=$(tput cols)
if [ $w -le 80 ]; then
lf -remote "send $id set ratios 5:1"
elif [ $w -le 160 ]; then
lf -remote "send $id set ratios 1:3:2"
else
lf -remote "send $id set ratios 1:3:2"
fi
}}
# Custom Functions
# cmds/functions
cmd open ${{
case $(file --mime-type $f -b) in
text/troff) man ./ $f;;
text/*) $EDITOR $fx;;
image/x-xcf|image/svg+xml) setsid gimp $f >/dev/null 2>&1 & ;;
image/gif) setsid sxiv-gif $f 2>/dev/null & ;;
image/*) setsid sxiv-rifle $f 2>/dev/null & ;;
audio/*) mpv $f ;;
video/*) setsid mpv $f >/dev/null 2>&1 & ;;
application/pdf|application/cbz|application/cbr) setsid zathura $fx >/dev/null 2>&1 & ;;
*) for f in $fx; do setsid $OPENER $f >/dev/null 2>&1 & done;;
esac
}}
cmd rename %[ -e $1 ] && printf "file exists" || mv $f $1
cmd bulkrename ${{
old=$(mktemp)
new=$(mktemp)
[ -n $fs ] && fs=$(ls)
printf "$fs\n" > $old
printf "$fs\n" > $new
$EDITOR $new
[ $(cat $new | wc -l) -ne $(cat $old | wc -l) ] && exit
paste $old $new | while read names; do
src=$(printf $names | cut -f1)
dst=$(printf $names | cut -f2)
[ $src = $dst ] && continue
[ -e $dst ] && continue
mv $src $dst
done
rm $old $new
lf -remote "send $id unselect"
}}
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;;
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
}}
# 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
}}
cmd rifle ${{
set -f
rifle -l $f
read -p "Select runner: " runner
rifle -p $runner $f
}}
# Bindings
# Remove some defaults
map m
map n
map "'"
map '"'
# Basic Functions
map | top
map ¿ bottom
map <f-2> push :rename<space>
map <f-3> cut
map <f-4> copy
map <f-5> reload
map <f-6> push $touch<space>
map <f-7> push $mkdir<space>
map <f-8> delete
map <f-9> paste
map <enter> open
map <delete> delete
map Y %cp -ri $fs .
map D %mv -i $fs .
# Rename with the filename on the command line
map ra $lf -remote "send $id push :rename<space>$f"
# Rename with the filename without the extension
map re $lf -remote "send $id push :rename<space>$f<a-b><a-d>"
map B bulkrename
map bg $setbg $f
map cx %chmod +x $f
map o open $f
map F $find | lf -remote "send $id select $(fzf --height 50% --reverse --border --margin 5% --inline-info --color border:#005688,bg+:#16252E,fg+:#26c6da,hl+:#ffffff,hl:#26c6da)"
# Movement
map gu cd ~/Documents/
map gE cd /etc
map gU cd /usr
map gd cd ~/Downloads
map g. cd ~/.config
map gs cd ~/.local/share
map gm cd ~/Music/Albums
map gb cd ~/bin
map gM cd /media
map gR cd /
map gv cd ~/Videos/Learning
map gp cd ~/Pictures
map gC cd ~/cel
map cg $$EDITOR ~/.config/lf/lfrc

View File

@ -92,6 +92,7 @@ set wildignore+=*/.git,*/.hg,*/.svn " vcs
if &diff
set textwidth=80
highlight! link DiffText MatchParen
endif
match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$'
@ -111,6 +112,7 @@ let g:ale_lint_on_text_changed = 'normal'
let g:ale_lint_on_insert_leave = 1
let g:ale_fix_on_save = 1
let g:ale_close_preview_on_insert = 1
let g:ale_sign_highlight_linenrs = 1
let g:ale_sign_error = '✖'
let g:ale_sign_warning = '⚠'
let g:ale_sign_info = '●'
@ -434,9 +436,9 @@ if !exists('autocommands_loaded') && has('autocmd')
aug END
aug file_types
au FileType * setl formatoptions-=cro
au FileType typescript,json setl formatexpr=CocAction('formatSelected')
au FileType json syntax match Comment +\/\/.\+$+
au FileType * setl formatoptions-=cro
au FileType typescript,json setl formatexpr=CocAction('formatSelected')
au FileType json syntax match Comment +\/\/.\+$+
aug END
endif
" }}}

View File

@ -229,11 +229,7 @@ map <a-9> tab_open 9
map E edit
map du shell -p du --max-depth=1 -h --apparent-size
map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh
map yp shell -f echo -n %%d/%%f | xsel -i; xsel -o | xsel -i -b
map yd shell -f echo -n %%d | xsel -i; xsel -o | xsel -i -b
map yn shell -f echo -n %%f | xsel -i; xsel -o | xsel -i -b
map cg chain shell nvim -p ~/.config/ranger/rc.conf; source ~/.config/ranger/rc.conf
map y. yank name_without_extension
# Open file in a new tmux pane
map ef eval import shlex; fm.run("tmux splitw -h rifle " + shlex.quote(fm.thisfile.basename))
@ -258,8 +254,6 @@ map pht paste_hardlinked_subtree
map pr paste_as_root
map dD console delete
map Tm shell gio trash -f %s
map Te shell gio trash --empty
map dd cut
map ud uncut
map da cut mode=add
@ -271,9 +265,7 @@ map uy uncut
map ya copy mode=add
map yr copy mode=remove
map yt copy mode=toggle
map yd shell -f echo -n %d | xsel -i; xsel -o | xsel -i -b
map yn shell -f echo -n %f | xsel -i; xsel -o | xsel -i -b
map yp shell -f echo -n %d/%f | xsel -i; xsel -o | xsel -i -b
map y. yank name_without_extension
map yp yank path
map yd yank dir
map yn yank name
@ -482,7 +474,7 @@ map Nf console touch%space
map Nd console mkdir%space
map Nc console mkcd%space
map sl console shell ln -sT%space
map X shell extraer %f
map X shell atool -x %f
map Zt shell tar -cvzf %f.tar.gz %f
map Zz shell apack %f.zip %f
map Zb shell apack --format=zip %f.cbz %f

View File

@ -117,8 +117,8 @@ ext epub, has zathura, X, flag f = zathura "$@"
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 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 "$@"
@ -127,8 +127,7 @@ ext djvu, has zathura,X, flag f = zathura -- "$@"
ext mobi, has ebook-viewer, X, flag f = ebook-viewer -- "$@"
ext cbz, has zathura,X, flag f = zathura -- "$@"
ext cbr, has zathura,X, flag f = zathura -- "$@"
ext cbz|cbr, has zathura,X, flag f = zathura -- "$@"
#-------------------------------------------
# Image Viewing:

View File

@ -6,13 +6,16 @@ super + {_,shift} + w
bspc node -{c,k}
super + f
bspc node -t $(bspc query -N -n -n .tiled >/dev/null && echo floating || echo tiled)
bspc node -t $(bspc query -N -n -n .tiled >/dev/null && echo floating || echo tiled)
super + shift + f
bspc node -t $(bspc query -N -n -n .tiled >/dev/null && echo fullscreen || echo tiled)
super + {_,shift,ctrl} + {h,j,k,l}
{foco,mover,agrandar}.sh {west,south,north,east}
super + {_,shift} + {h,j,k,l}
bspc node -{f,s} {west,south,north,east}
super + ctrl + {h,j,k,l}
agrandar.sh {west,south,north,east}
super + alt + {h,j,k,l}
bspc node -p {west,south,north,east}
@ -20,17 +23,14 @@ super + alt + {h,j,k,l}
super + alt + space
bspc node -p cancel
super + {1-9,0}
bspc desktop -f ^{1-9,10} && notifocus
super + shift + {1-9,0}
bspc node -d ^{1-9,10}
super + {_, shift +} {1-9,0}
bspc {desktop -f,node -d} {1-9,10} && notifocus
super + {braceleft,braceright}
bspc desktop -f {prev.occupied,next.occupied}
alt + {_,shift} + Tab
bspc node -f {next,prev}.local.normal
bspc node -f {next,prev}.local.normal
super + {comma,period}
bspc node @/ -R {90,270}
@ -51,7 +51,7 @@ super + alt + u
euclid_balancer
super + o
bspc node @parent -B
bspc node @parent -B
super + y
bspc node -s biggest.local
@ -66,8 +66,8 @@ super + {t,b,v,q,x,c}
super + z
termite --name=multi
super + {n,m}
termite --name=flota -e {nmtui,brandr}
super + n
termite --name=flota -e nmtui
super + alt + z
termite --name=flota

View File

@ -1,5 +1,3 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
:root {
--tabs-border: #212121 !important;
/* active tab left & right borders - not working in 58?*/
@ -263,7 +261,7 @@ display: none !important;
.urlbarView-row
{
padding: 0 18px !important;
height: 48px !important;
height: 32px !important;
border-radius: 0 !important;
display: flex !important;
align-items: center !important;
@ -278,7 +276,6 @@ display: none !important;
grid-template-areas:
"icon title . secondary-icon"
"icon secondary . secondary-icon" !important;
display: grid !important;
align-items: center !important;
align-content: center !important;
}
@ -689,4 +686,6 @@ display: flex !important;
#searchbar
{
--input-offset: -1px;
}
}
.urlbarView-row[has-url]:not([type="switchtab"]) .urlbarView-title-separator{ display: none }

View File

@ -134,6 +134,7 @@ pulseaudio-jack
pygmentize
python-glfw
python-language-server
python-lxml
python-numpy
python-opengl
python-pdoc
@ -199,8 +200,6 @@ xcb-util-cursor
xdo
xdotool
xf86-input-evdev
xf86-input-keyboard
xf86-input-mouse
xf86-input-synaptics
xf86-video-fbdev
xf86-video-intel

View File

@ -15,31 +15,27 @@ git-extras
godot
gtk-theme-minwaita
lab
lf
lscolors-git
neovim-drop-in
nerd-fonts-roboto-mono
otf-nerd-fonts-monacob-mono
otf-san-francisco
perl-extract-url
pmount
postman-bin
pureref
pymdown-extensions
python-lolcat
python-pysdl2
ranger-git
realtimeconfigquickscan-git
rofi-git
simple-mtpfs
soulseekqt
stylelint
syncterm
task-spooler
tcllib
terminus-font-ll2-td1
toilet-fonts
transmission-remote-cli-git
umonitor-git
unclutter-xfixes-git
xcursor-alkano-default
xf86-input-keyboard
xf86-input-mouse
zsh-autopair-git

View File

@ -1,6 +1,6 @@
#!/usr/bin/env sh
pgrep -u "{$USER:=$LOGNAME}" >/dev/null || exit
pgrep -u "$USER" >/dev/null || exit
pgrep -x mbsync >/dev/null && exit
ping -q -c 1 1.1.1.1 > /dev/null || exit

123
bin/lf-preview Executable file
View File

@ -0,0 +1,123 @@
#!/bin/bash
set -C -f -u
#IFS=$'\n'
IFS="$(printf '%b_' '\n')"; IFS="${IFS%_}"
# 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.
# 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
# Script arguments
FILE_PATH="${1}" # Full path of the highlighted file
HEIGHT="${2}"
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'
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}"
bsdtar --list --file "${FILE_PATH}"
exit 1;;
rar)
# Avoid password prompt by providing empty password
unrar lt -p- -- "${FILE_PATH}"
exit 1;;
7z)
# Avoid password prompt by providing empty password
7z l -p -- "${FILE_PATH}"
exit 1;;
# PDF
pdf)
# Preview as text conversion
pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" -
mutool draw -F txt -i -- "${FILE_PATH}" 1-10
exiftool "${FILE_PATH}"
exit 1;;
# BitTorrent
torrent)
transmission-show -- "${FILE_PATH}"
exit 1;;
# OpenDocument
odt|ods|odp|sxw)
# Preview as text conversion
odt2txt "${FILE_PATH}"
exit 1;;
# HTML
htm|html|xhtml)
# Preview as text conversion
w3m -dump "${FILE_PATH}"
lynx -dump -- "${FILE_PATH}"
elinks -dump "${FILE_PATH}"
;; # Continue with next handler on failure
# JSON
json)
jq --color-output . "${FILE_PATH}" && exit 5
python -m json.tool -- "${FILE_PATH}" && exit 5
;;
conf) bat "${FILE_PATH}" && exit 0 ;;
esac
}
handle_mime() {
local mimetype="${1}"
case "${mimetype}" in
text/html) w3m -dump "${FILE_PATH}" ;;
text/troff) man ./ "${FILE_PATH}" | col -b ;;
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
highlight --replace-tabs="${HIGHLIGHT_TABWIDTH}" --out-format="${highlight_format}" \
--style="${HIGHLIGHT_STYLE}" --force -- "${FILE_PATH}"
exit 2;;
application/zip) atool --list -- "${FILE_PATH}" ;;
image/*) chafa --fill=block --symbols=block -c 240 -s 80x"${HEIGHT}" "${FILE_PATH}" || exit 1;;
video/* | audio/*|application/octet-stream) mediainfo "${FILE_PATH}" || exit 1;;
*/pdf) pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - ;;
*opendocument*) odt2txt "${FILE_PATH}" ;;
esac
}
handle_fallback() {
echo '----- File Type Classification -----' && file --dereference --brief -- "${FILE_PATH}"
exit 1
}
MIMETYPE="$( file --dereference --brief --mime-type -- "${FILE_PATH}" )"
handle_extension
handle_mime "${MIMETYPE}"
handle_fallback
exit 1

View File

@ -31,4 +31,3 @@ else
(( I++ ))
done
fi

View File

@ -1,4 +1,4 @@
#!/bin/sh
# Sets the background. If given an argument, will set file as background.
[ -n "$1" ] && cp "$1" ~/.config/wall.png && notify-send -u low -i "$HOME/.config/wall.png" "Wallpaper changed."
hsetroot -fill ~/.config/wall.png
[ -n "$1" ] && cp "$1" ~/.config/wall.png
hsetroot -fill ~/.config/wall.png >/dev/null 2>&1