diff --git a/.Xresources b/.Xresources index 76c3ce54..e67d3d10 100644 --- a/.Xresources +++ b/.Xresources @@ -14,18 +14,22 @@ ! Xft.rgba: rgb !!------------------------------------------------------------------------------ -!!URxvt -!!------------------------------------------------------------------------------ +!! URxvt +!! ------------------------------------------------------------------------------ +!! url-select, clipboard and keyboard-select are provided in Muennich's perl +!! plugins. ! URxvt*modifier: alt URxvt*saveLines: 5000 URxvt*scrollBar: false -!! Plugins -!! clipboard and keyboard-select are not provided by default. -! URxvt.perl-ext-common : default,matcher,keyboard-select -URxvt.perl-ext-common : matcher,keyboard-select,clipboard +!! URL Support +URxvt.perl-ext: default,url-select +URxvt.keysym.M-u: perl:url-select:select_next +URxvt.url-select.launcher: /usr/bin/luakit +URxvt.url-select.underline: true +URxvt.perl-ext-common : keyboard-select,clipboard URxvt.keysym.C-M-v: perl:clipboard:paste URxvt.keysym.C-M-c: perl:clipboard:paste_escaped @@ -36,17 +40,6 @@ URxvt.keysym.C-M-c: perl:clipboard:paste_escaped URxvt.keysym.M-Escape: perl:keyboard-select:activate ! URxvt.keysym.M-s: perl:keyboard-select:search -!! URL Support -URxvt.matcher.button : 1 -URxvt.keysym.C-Delete : perl:matcher:last -URxvt.keysym.M-Delete : perl:matcher:list -URxvt.urlLauncher : luakit -URxvt.underlineURLs : true - -!! TODO: Does not work. -! URxvt*keysym.M-Left: \033[1;3D - - !! Font URxvt*font : xft:Dejavu Sans Mono:pixelsize=14 diff --git a/.config/ranger/rc.conf b/.config/ranger/rc.conf index fe3d1e47..f625bbe0 100644 --- a/.config/ranger/rc.conf +++ b/.config/ranger/rc.conf @@ -56,7 +56,8 @@ map ess shell -w svn status ## MPlayer ## Note that latin1 for MPlayer is cp1252 in reality. -map ev console shell mplayer "%f" -sub "%s" -subcp latin1 +map ev console shell mplayer "%f" -sub "%s" +map eV console shell mplayer "%f" -sub "%s" -subcp latin1 ## Cmus map ea shell cmus-remote -P %s diff --git a/.pkg-arch-aur-peteramd b/.pkg-arch-aur-peteramd index 357d6ff1..795d9493 100644 --- a/.pkg-arch-aur-peteramd +++ b/.pkg-arch-aur-peteramd @@ -7,6 +7,7 @@ fortune-mod-tbbt gmp-ecm movgrab msieve +oss package-query pacman-color rxvt-unicode-patched diff --git a/.pkg-arch-explicit-peteramd b/.pkg-arch-explicit-peteramd index 97720c07..9be51c02 100644 --- a/.pkg-arch-explicit-peteramd +++ b/.pkg-arch-explicit-peteramd @@ -215,7 +215,6 @@ w3m wget which wipe -wpa_actiond wpa_supplicant wv xclip diff --git a/.pkg-arch-official-peteramd b/.pkg-arch-official-peteramd index df81b009..9c83349a 100644 --- a/.pkg-arch-official-peteramd +++ b/.pkg-arch-official-peteramd @@ -399,7 +399,6 @@ openjpeg openssh openssl orc -oss p11-kit p7zip pacman @@ -525,7 +524,6 @@ wget which wildmidi wipe -wpa_actiond wpa_supplicant wv wxgtk diff --git a/.shell.d/funs_rc b/.shell.d/funs_rc index 6eb70421..d4eeea5a 100644 --- a/.shell.d/funs_rc +++ b/.shell.d/funs_rc @@ -183,6 +183,61 @@ cpuusage() fi } +codescan () +{ + IFS=" +" + + for i in $(find . -type f -size -50M -print); do + echo -n "# " + file "$i" + grep -m1 "\`" "$i" + grep -m1 "oe" "$i" + done +} + +## Confert all 'bad' encoding to UTF-8/LF. +# +## It will fail for encoding other than ISO-8859-1 and cp1252. +utf8conv () +{ + local CODING + + IFS=" +" + + for i in $(find . -type f -size -50M -print); do + CODING=$(file "$i") + + if [ -n "$(echo $CODING | grep 'ISO-8859')" ]; then + echo "ISO-8859: [$i]" + recode latin1..utf-8 "$i" + + elif [ -n "$(echo $CODING | grep 'Non-ISO extended-ASCII')" ]; then + echo "cp1252: [$i]" + recode cp1252..utf-8 "$i" + + elif [ -n "$(echo $CODING | grep 'UTF-16 Unicode text')" ]; then + echo "UTF-16: [$i]" + recode utf-16..utf-8 "$i" + + elif [ -n "$(echo $CODING | grep 'UTF-8 Unicode (with BOM)')" ]; then + echo "UTF-8 BOM: [$i]" + sed -i '1s/^.//' "$i" + ## The following commands work, but may be overkill. + # dd iflag=skip_bytes skip=3 if=file.srt of=temp.srt + # dd bs=1 skip=3 if=file.srt of=temp.srt + # tail -c +32 file.srt > temp.srt + fi + + if [ -n "$(echo $CODING | grep 'CRLF')" ]; then + echo "CRLF: [$i]" + sed -i 's/\r//g' "$i" + fi + + done +} + ## Webcam webcam () { diff --git a/README b/README index 8609017e..dbcafc98 100644 --- a/README +++ b/README @@ -137,8 +137,8 @@ Emacs: some colors do not work as intended. Luakit: Adblock will not always block ads correctly. -Ranger: if editor is 'emacsclient -t -a""', it will not show up if emacs daemon -is not running. +Ranger: if editor is 'emacsclient -t -a ""', it will not show up if emacs daemon +is not running. This is because the "" are not properly recognized. Shell: some custom functions would need auto-completion.