URxvt: use url-select instead of matcher (works for non-US keyboards).

Shell: codescan + utf8conv functions.
master
Ambrevar 2012-09-14 10:35:53 +02:00
parent 4447c7119e
commit 899dbb21a5
7 changed files with 70 additions and 23 deletions

View File

@ -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

View File

@ -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

View File

@ -7,6 +7,7 @@ fortune-mod-tbbt
gmp-ecm
movgrab
msieve
oss
package-query
pacman-color
rxvt-unicode-patched

View File

@ -215,7 +215,6 @@ w3m
wget
which
wipe
wpa_actiond
wpa_supplicant
wv
xclip

View File

@ -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

View File

@ -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 ()
{

4
README
View File

@ -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.