Emacs: some keybindings. Removed auto-complete.

Shell: cleaned pacman aliases.
Shell: 'halt' and 'reboot' alias without ConsoleKit (use sudoer instead).
Shell: 'formatc' function. WIP.
Shell: TeXlive netinstall added to PATH.
xinitrc: removed consolekit.
master
Ambrevar 2012-07-25 12:16:21 +01:00
parent 8f48ccf8d1
commit 1d652c442b
10 changed files with 125 additions and 37 deletions

View File

@ -23,13 +23,15 @@ 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 : default,matcher,keyboard-select
URxvt.perl-ext-common : matcher,keyboard-select
! URxvt.keysym.M-v: perl:clipboard:paste
! URxvt.keysym.M-C-v: perl:clipboard:paste_escaped
!! Keyboard-Select
URxvt.keysym.M-Escape: perl:keyboard-select:activate
URxvt.keysym.M-Escape: perl:keyboard-select:activate
! URxvt.keysym.M-s: perl:keyboard-select:search
!! URL Support

View File

@ -5,6 +5,7 @@ dropbox
dropbox-cli
emacs-mediawiki-bzr
emacs-yasnippet
grub
gsharkdown
handbrake-cli-svn
handbrake-svn
@ -12,6 +13,7 @@ movgrab
package-query
pacman-color
rxvt-unicode-patched
texlive-dummy
trash-cli
urlview
urxvt-clipboard

View File

@ -22,7 +22,6 @@ bzr
calc
catdvi
cmus
consolekit
coreutils
cpufrequtils
cronie
@ -43,6 +42,7 @@ emacs-lua-mode
emacs-mediawiki-bzr
emacs-nox
emacs-yasnippet
expac
fakeroot
fbv
feh
@ -92,7 +92,6 @@ libtool
licenses
links
linux
linux-docs
linux-lts
logrotate
lrzip
@ -157,9 +156,7 @@ task
tcpdump
texi2html
texinfo
texlive-genericextra
texlive-latexextra
texlive-pictures
texlive-dummy
trash-cli
tree
unrar
@ -185,7 +182,7 @@ wireshark-gtk
wpa_supplicant
wv
xf86-input-synaptics
xf86-video-intel-uxa
xf86-video-intel
xf86-video-vesa
xfsprogs
xorg-server

View File

@ -37,7 +37,6 @@ cdparanoia
cloog
cmus
compositeproto
consolekit
coreutils
cpufrequtils
cracklib
@ -75,6 +74,7 @@ emacs-nox
enca
enchant
eventlog
expac
expat
faac
faad2
@ -135,7 +135,6 @@ gpgme
gpm
grep
groff
grub
gsasl
gsettings-desktop-schemas
gsfonts
@ -326,7 +325,6 @@ licenses
links
linux
linux-api-headers
linux-docs
linux-firmware
linux-lts
lirc-utils
@ -466,11 +464,6 @@ task
tcpdump
texi2html
texinfo
texlive-bin
texlive-core
texlive-genericextra
texlive-latexextra
texlive-pictures
tree
ttf-dejavu
tzdata
@ -510,7 +503,7 @@ xextproto
xf86dgaproto
xf86-input-evdev
xf86-input-synaptics
xf86-video-intel-uxa
xf86-video-intel
xf86-video-vesa
xf86vidmodeproto
xfsprogs

View File

@ -128,7 +128,7 @@ batf:close()
-- Volume
volmwidget = widget({ type = "textbox" })
vicious.register(volmwidget, vicious.widgets.volume, "Master: $1% $2 ", 1, "Master")
vicious.register(volmwidget, vicious.widgets.volume, "Master $1% $2 ", 1, "Master")
-- PCM may not be available all the time on every machine.
-- If PCM is toggled after awesome has been started, you'll need to reload the
-- configuration.
@ -137,13 +137,17 @@ local volpf = io.popen("amixer | grep PCM 2>/dev/null")
local volpl = volpf:read("*a")
if volpl ~= "" then
volpwidget = widget({ type = "textbox" })
vicious.register(volpwidget, vicious.widgets.volume, "PCM: $1%", 1, "PCM")
vicious.register(volpwidget, vicious.widgets.volume, "PCM $1%", 1, "PCM")
end
volpf:close()
-- Separator
separator = widget({ type = "textbox" })
separator.text = " | "
separatordate = widget({ type = "textbox" })
separatordate.text = " |"
separatorapps = widget({ type = "textbox" })
separatorapps.text = " "
-- Create a wibox for each screen and add it
mywibox = {}
@ -222,7 +226,7 @@ for s = 1, screen.count() do
},
s == 1 and systraywidget or nil,
clockwidget,
separator,
separatordate,
volpwidget,
volmwidget,
separator,
@ -231,7 +235,7 @@ for s = 1, screen.count() do
netwidget,
separator,
batwidget,
separator,
separatorapps,
mytasklist[s],
layout = awful.widget.layout.horizontal.rightleft
}
@ -331,7 +335,7 @@ globalkeys = awful.util.table.join(
-- Touchpad
awful.key({ }, "XF86TouchpadToggle", function () os.execute("synclient TouchpadOff=`synclient -l | grep -c 'TouchpadOff.*=.*0'`") end),
-- awful.key({ }, "XF86Tool", function () os.execute("synclient TouchpadOff=`synclient -l | grep -c 'TouchpadOff.*=.*0'`") end),
awful.key({ }, "XF86Tools", function () os.execute("synclient TouchpadOff=`synclient -l | grep -c 'TouchpadOff.*=.*0'`") end),
-- Mouse control
-- Bind ''Meta4+Ctrl+m'' to move the mouse to the coordinates set above.

29
.emacs
View File

@ -366,18 +366,33 @@ the line."
;; Duplicate line
(define-key my-keys-minor-mode-map (kbd "C-d") 'duplicate-line)
(define-key my-keys-minor-mode-map (kbd "M-a") 'beginning-of-defun)
(define-key my-keys-minor-mode-map (kbd "M-e") 'end-of-defun)
;; Paste from clipboard.
;; (define-key my-keys-minor-mode-map (kbd "M-p") (kbd "C-u M-! xclip <SPC> -o"))
(define-key my-keys-minor-mode-map (kbd "M-p") (kbd "C-u M-! xsel <SPC> -o"))
(define-key my-keys-minor-mode-map (kbd "C-<f6>") (kbd "M-| xsel <SPC> -p <SPC> -i"))
(define-key my-keys-minor-mode-map (kbd "C-<f7>") (kbd "C-u M-! xsel <SPC> -o"))
(define-key my-keys-minor-mode-map (kbd "C-<f8>") (kbd "C-u M-! xsel <SPC> -o -b"))
;; Modern scrolling
(global-set-key [next]
(lambda () (interactive)
(condition-case nil (scroll-up)
(end-of-buffer (goto-char (point-max))))))
(global-set-key [prior]
(lambda () (interactive)
(condition-case nil (scroll-down)
(beginning-of-buffer (goto-char (point-min))))))
;; Compilation
(define-key my-keys-minor-mode-map (kbd "<f10>") 'compile)
(define-key my-keys-minor-mode-map (kbd "<f12>") 'next-error)
;; Window resize
(define-key my-keys-minor-mode-map (kbd "S-C-<right>") 'shrink-window-horizontally)
(define-key my-keys-minor-mode-map (kbd "S-C-<left>") 'enlarge-window-horizontally)
;; (define-key my-keys-minor-mode-map (kbd "S-C-<right>") 'shrink-window-horizontally)
;; (define-key my-keys-minor-mode-map (kbd "S-C-<left>") 'enlarge-window-horizontally)
;; (define-key my-keys-minor-mode-map (kbd "S-C-<down>") 'shrink-window)
;; (define-key my-keys-minor-mode-map (kbd "S-C-<up>") 'enlarge-window)
@ -497,10 +512,10 @@ the line."
;;==============================================================================
;; Auto-Complete
;;==============================================================================
(add-to-list 'load-path "/usr/share/emacs/site-lisp/auto-complete")
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "/usr/share/emacs/site-lisp/auto-complete/ac-dict")
(ac-config-default)
;; (add-to-list 'load-path "/usr/share/emacs/site-lisp/auto-complete")
;; (require 'auto-complete-config)
;; (add-to-list 'ac-dictionary-directories "/usr/share/emacs/site-lisp/auto-complete/ac-dict")
;; (ac-config-default)
;;==============================================================================
;; AucTeX

View File

@ -76,10 +76,8 @@ alias echolibpath='echo -e ${LD_LIBRARY_PATH//:/\\n}'
## Shutdown / Reboot
## Will only work with consolekit and dbus daemons running.
if [ -e "/usr/bin/dbus-send" ]; then
alias halt='dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop'
alias reboot='dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart'
alias restart='dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart'
alias shutdown='dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop'
alias halt='sudo halt'
alias reboot='sudo reboot'
fi
## Screensaver
@ -126,9 +124,11 @@ if [ "$PACMAN_FRONTEND" = "pacman" ]; then
alias pc='sudo pacman -Scc'
alias pi='sudo pacman -S --needed'
alias pqi='pacman -Qi'
alias pql='pacman -Ql'
alias pqo='pacman -Qo'
alias pqs='pacman -Qs'
alias psi='pacman -Si'
alias pr='sudo pacman -Rs'
alias psi='pacman -Si'
alias pss='pacman -Ss'
alias pu='sudo pacman -Syu'
fi
@ -137,12 +137,13 @@ if [ "$PACMAN_FRONTEND" = "pacman-color" ]; then
alias pc='sudo pacman-color -Scc'
alias pi='sudo pacman -S --needed'
alias pqi='pacman-color -Qi'
alias pql='pacman-color -Ql'
alias pqo='pacman-color -Qo'
alias pqs='pacman-color -Qs'
alias psi='pacman-color -Si'
alias pr='sudo pacman-color -Rs'
alias psi='pacman-color -Si'
alias pss='pacman-color -Ss'
alias pu='sudo pacman-color -Syu'
alias pql='pacman -Ql'
fi
##==============================================================================

View File

@ -422,6 +422,74 @@ lsofstat()
done
}
## Format C
formatc()
{
echo "WARNING: Work in progress."
if [ ! $# -eq 1 ]; then
echo "Wrong number of argument."
return
fi
FILE="$1"
## Remove trailing whitespace
sed -i 's/\s*$//g' "$FILE"
## Function parenthesis
sed -i 's/\([^ ]\)(/\1 (/g' "$FILE"
sed -i 's/\s\s\+(/ (/g' "$FILE"
## Semicolon
sed -i 's/\([^ ]\);/\1 ;/g' "$FILE"
sed -i 's/;\([^ ]\)/; \1/g' "$FILE"
# Skip line -- Bad idea because of 'for' loops.
# sed -i 's/^\(\s*\)\(.*\);\s*\(.\+\)$/\1\2;\n\1\3/g' "$FILE"
## Commas
sed -i 's/\s\s\+,/,/g' "$FILE"
sed -i 's/,\([^ ]\)/, \1/g' "$FILE"
## Plus/Minus
sed -i 's/\([^+-]\)\([-+]\)\([^ +-]\)/\1\2 \3/g' "$FILE"
sed -i 's/\([^ +-]\)\([-+]\)\([^+-]\)/\1 \2\3/g' "$FILE"
sed -i 's/\( \+++\)/++/g' "$FILE"
sed -i 's/\(++ \+\)/++/g' "$FILE"
sed -i 's/\( \+--\)/--/g' "$FILE"
sed -i 's/\(-- \+\)/--/g' "$FILE"
## Modulus, Equality, Affectation, Binary ops, Comparison
sed -i 's/\s\s\+\(%\|==\|&&\|||\|<=\|>=\|!=\)/ \1/g' "$FILE"
sed -i 's/\(%\|==\|&&\|||\|<=\|>=\|!=\)\s\s\+/\1 /g' "$FILE"
sed -i 's/\([^ ]\)\(%\|==\|&&\|||\|<=\|>=\|!=\)/\1 \2/g' "$FILE"
sed -i 's/\(%\|==\|&&\|||\|<=\|>=\|!=\)\([^ ]\)/\1 \2/g' "$FILE"
## Equality, >, <
sed -i 's/\s\s\+\([<>=]\)/ \1/g' "$FILE"
sed -i 's/\([<>=]\)\s\s\+/\1 /g' "$FILE"
sed -i 's/\([<>=]\)\([^ =]\)/\1 \2/g' "$FILE"
sed -i 's/\([^ ]\)\([<>]\)/\1 \2/g' "$FILE"
sed -i 's/\([^ =<>]\)\(=\)/\1 \2/g' "$FILE"
## Asterisk, slash
sed -i 's/\s\s\+\*/ \*/g' "$FILE"
sed -i 's/\*\s\s\+/\* /g' "$FILE"
sed -i 's/\([^\/]\)\/\s\+/\1\//g' "$FILE"
sed -i 's/\s\+\/\([^\/]\)/\/\1/g' "$FILE"
## Braces
sed -i 's/^\( *\)\(.\+\) *{ *$/\1\2\n\1{/g' "$FILE"
## Proper comments
sed -i 's:// *\([[:lower:]]\):// \u\1:g' "$FILE"
sed -i 's:\(//.*[^\.]\)$:\1\.:g' "$FILE"
}
##==============================================================================
## Pacman Functions
##==============================================================================

View File

@ -11,6 +11,9 @@ umask 027
## Path
export PATH=.:$PATH
## TeXlive
export PATH=/usr/local/texlive/2012/bin/x86_64-linux/:$PATH
## Terminal
# if [[ "$TERM" = "*rxvt*" ]]; then
# export TERM="rxvt-unicode"

View File

@ -17,8 +17,11 @@
##==============================================================================
## Launch session
##==============================================================================
udiskie &
[ -e /usr/bin/awesome ] && exec awesome
# [ -e /usr/bin/awesome ] && exec ck-launch-session awesome
[ -e /usr/bin/awesome ] && exec ck-launch-session zsh -c "udiskie & awesome"
# [ -e /usr/bin/awesome ] && exec ck-launch-session zsh -c "udiskie & awesome"
# [ -e /usr/bin/awesome ] && exec zsh -c "udiskie & awesome"