From c91e221bb12ad73be8bb50bae988f25910cd0c77 Mon Sep 17 00:00:00 2001 From: Ambrevar Date: Wed, 20 Jun 2012 18:07:54 +0100 Subject: [PATCH] Awesome: added forgotten theme file. [FIX] Conky: added minimal config for HD+CPU monitoring. [NEW] Mutt: config for multiple accounts + encrypted password using msmtp. [NEW] Script: .netinit is a simple network connection tool. Works with wpa_supplicant. [NEW] Shell: new "steal" function, allowing silent replacing of file content. Useful if you want to insert a password in a file without makeing it appear on the screen. [NEW] --- .config/awesome/themes/custom/theme.lua | 98 +++++++++++++++++++ .conkyrc | 14 +++ .../text-mode/latex-mode/art.yasnippet | 2 +- .../text-mode/latex-mode/beam.yasnippet | 2 +- .../text-mode/latex-mode/letter.yasnippet | 4 +- .ml.sh | 5 + .muttrc | 50 ++++++++++ .netinit | 39 ++++++++ .shell.d/funs_rc | 36 +++++-- 9 files changed, 240 insertions(+), 10 deletions(-) create mode 100644 .config/awesome/themes/custom/theme.lua create mode 100644 .conkyrc create mode 100755 .ml.sh create mode 100644 .muttrc create mode 100755 .netinit diff --git a/.config/awesome/themes/custom/theme.lua b/.config/awesome/themes/custom/theme.lua new file mode 100644 index 00000000..5acb60ab --- /dev/null +++ b/.config/awesome/themes/custom/theme.lua @@ -0,0 +1,98 @@ +--------------------------- +-- Custom awesome theme -- +--------------------------- + +theme = {} + +theme.font = "sans 8" + +theme.bg_normal = "#222222" +theme.bg_focus = "#535d6c" +theme.bg_urgent = "#ff0000" +theme.bg_minimize = "#444444" + +theme.fg_normal = "#aaaaaa" +theme.fg_focus = "#ffffff" +theme.fg_urgent = "#ffffff" +theme.fg_minimize = "#ffffff" + +theme.border_width = "2" +theme.border_normal = "#222222" +theme.border_focus = "#535d6c" +theme.border_marked = "#91231c" + +-- There are other variable sets +-- overriding the default one when +-- defined, the sets are: +-- [taglist|tasklist]_[bg|fg]_[focus|urgent] +-- titlebar_[bg|fg]_[normal|focus] +-- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] +-- mouse_finder_[color|timeout|animate_timeout|radius|factor] +-- Example: +--theme.taglist_bg_focus = "#ff0000" + +-- Display the taglist squares +theme.taglist_squares_sel = awful.util.getdir("config") .. "/themes/custom/taglist/squarefw.png" +theme.taglist_squares_unsel = awful.util.getdir("config") .. "/themes/custom/taglist/squarew.png" + +theme.tasklist_floating_icon = awful.util.getdir("config") .. "/themes/custom/tasklist/floatingw.png" + +-- Variables set for theming the menu: +-- menu_[bg|fg]_[normal|focus] +-- menu_[border_color|border_width] +theme.menu_submenu_icon = awful.util.getdir("config") .. "/themes/custom/submenu.png" +theme.menu_height = "15" +theme.menu_width = "100" + +-- You can add as many variables as +-- you wish and access them by using +-- beautiful.variable in your rc.lua +--theme.bg_widget = "#cc0000" + +-- Define the image to load +theme.titlebar_close_button_normal = awful.util.getdir("config") .. "/themes/custom/titlebar/close_normal.png" +theme.titlebar_close_button_focus = awful.util.getdir("config") .. "/themes/custom/titlebar/close_focus.png" + +theme.titlebar_ontop_button_normal_inactive = awful.util.getdir("config") .. "/themes/custom/titlebar/ontop_normal_inactive.png" +theme.titlebar_ontop_button_focus_inactive = awful.util.getdir("config") .. "/themes/custom/titlebar/ontop_focus_inactive.png" +theme.titlebar_ontop_button_normal_active = awful.util.getdir("config") .. "/themes/custom/titlebar/ontop_normal_active.png" +theme.titlebar_ontop_button_focus_active = awful.util.getdir("config") .. "/themes/custom/titlebar/ontop_focus_active.png" + +theme.titlebar_sticky_button_normal_inactive = awful.util.getdir("config") .. "/themes/custom/titlebar/sticky_normal_inactive.png" +theme.titlebar_sticky_button_focus_inactive = awful.util.getdir("config") .. "/themes/custom/titlebar/sticky_focus_inactive.png" +theme.titlebar_sticky_button_normal_active = awful.util.getdir("config") .. "/themes/custom/titlebar/sticky_normal_active.png" +theme.titlebar_sticky_button_focus_active = awful.util.getdir("config") .. "/themes/custom/titlebar/sticky_focus_active.png" + +theme.titlebar_floating_button_normal_inactive = awful.util.getdir("config") .. "/themes/custom/titlebar/floating_normal_inactive.png" +theme.titlebar_floating_button_focus_inactive = awful.util.getdir("config") .. "/themes/custom/titlebar/floating_focus_inactive.png" +theme.titlebar_floating_button_normal_active = awful.util.getdir("config") .. "/themes/custom/titlebar/floating_normal_active.png" +theme.titlebar_floating_button_focus_active = awful.util.getdir("config") .. "/themes/custom/titlebar/floating_focus_active.png" + +theme.titlebar_maximized_button_normal_inactive = awful.util.getdir("config") .. "/themes/custom/titlebar/maximized_normal_inactive.png" +theme.titlebar_maximized_button_focus_inactive = awful.util.getdir("config") .. "/themes/custom/titlebar/maximized_focus_inactive.png" +theme.titlebar_maximized_button_normal_active = awful.util.getdir("config") .. "/themes/custom/titlebar/maximized_normal_active.png" +theme.titlebar_maximized_button_focus_active = awful.util.getdir("config") .. "/themes/custom/titlebar/maximized_focus_active.png" + +-- You can use your own command to set your wallpaper +-- theme.wallpaper_cmd = { "awsetbg /usr/share/awesome/themes/default/background.png" } +theme.wallpaper_cmd = { "awsetbg " .. awful.util.getdir("config") .. "/themes/custom/background.png" } + +-- You can use your own layout icons like this: +-- theme.layout_fairh = awful.util.getdir("config") .. "/themes/custom/layouts/fairhw.png" +theme.layout_fairh = awful.util.getdir("config") .. "/themes/custom/layouts/fairhw.png" +theme.layout_fairv = awful.util.getdir("config") .. "/themes/custom/layouts/fairvw.png" +theme.layout_floating = awful.util.getdir("config") .. "/themes/custom/layouts/floatingw.png" +theme.layout_magnifier = awful.util.getdir("config") .. "/themes/custom/layouts/magnifierw.png" +theme.layout_max = awful.util.getdir("config") .. "/themes/custom/layouts/maxw.png" +theme.layout_fullscreen = awful.util.getdir("config") .. "/themes/custom/layouts/fullscreenw.png" +theme.layout_tilebottom = awful.util.getdir("config") .. "/themes/custom/layouts/tilebottomw.png" +theme.layout_tileleft = awful.util.getdir("config") .. "/themes/custom/layouts/tileleftw.png" +theme.layout_tile = awful.util.getdir("config") .. "/themes/custom/layouts/tilew.png" +theme.layout_tiletop = awful.util.getdir("config") .. "/themes/custom/layouts/tiletopw.png" +theme.layout_spiral = awful.util.getdir("config") .. "/themes/custom/layouts/spiralw.png" +theme.layout_dwindle = awful.util.getdir("config") .. "/themes/custom/layouts/dwindlew.png" + +theme.awesome_icon = "/usr/share/awesome/icons/awesome16.png" + +return theme +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/.conkyrc b/.conkyrc new file mode 100644 index 00000000..3e22b9d7 --- /dev/null +++ b/.conkyrc @@ -0,0 +1,14 @@ +out_to_console yes +out_to_x no +background no +update_interval 0.9 +total_run_times 0 +no_buffers yes + +TEXT +HDD:${diskio /dev/sda} +CPU1:${cpu cpu1}% +CPU2:${cpu cpu2}% +CPU3:${cpu cpu3}% +CPU4:${cpu cpu4}% + diff --git a/.emacs.d/plugins/yas/snippets/text-mode/latex-mode/art.yasnippet b/.emacs.d/plugins/yas/snippets/text-mode/latex-mode/art.yasnippet index 3d41bc57..78ea33cf 100644 --- a/.emacs.d/plugins/yas/snippets/text-mode/latex-mode/art.yasnippet +++ b/.emacs.d/plugins/yas/snippets/text-mode/latex-mode/art.yasnippet @@ -1,7 +1,7 @@ # -*- mode: snippet -*- # contributor: Mads D. Kristensen # contributor : Song Qiang -# contributor : Pierre Neidhardt 2012-03-17 +# contributor : Pierre Neidhardt 2012-03-17 # key: art # group: skeleton # name: \documentclass{article} ... diff --git a/.emacs.d/plugins/yas/snippets/text-mode/latex-mode/beam.yasnippet b/.emacs.d/plugins/yas/snippets/text-mode/latex-mode/beam.yasnippet index d299e20d..9caa478c 100644 --- a/.emacs.d/plugins/yas/snippets/text-mode/latex-mode/beam.yasnippet +++ b/.emacs.d/plugins/yas/snippets/text-mode/latex-mode/beam.yasnippet @@ -1,5 +1,5 @@ # -*- mode: snippet -*- -# contributor : Pierre Neidhardt 2012-04-27 +# contributor : Pierre Neidhardt 2012-04-27 # key: beam # group: skeleton # name: \documentclass{beamer} ... diff --git a/.emacs.d/plugins/yas/snippets/text-mode/latex-mode/letter.yasnippet b/.emacs.d/plugins/yas/snippets/text-mode/latex-mode/letter.yasnippet index ffc593ec..840bcacd 100644 --- a/.emacs.d/plugins/yas/snippets/text-mode/latex-mode/letter.yasnippet +++ b/.emacs.d/plugins/yas/snippets/text-mode/latex-mode/letter.yasnippet @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # contributor : Xavier Danaux -# contributor : Pierre Neidhardt 2012-04-27 +# contributor : Pierre Neidhardt 2012-04-27 # key: let # group: skeleton # name: \documentclass{article} ... @@ -33,7 +33,7 @@ \def\country{France} \def\phone{\en{(+33) }09 52 92 86 07} \def\mobile{\en{(+33) }07 61 08 55 94} -\def\mail{pe.neidhardt@gmail.com} +\def\mail{ambrevar at gmail dot com} \def\institute{INSA Lyon} %%============================================================================== diff --git a/.ml.sh b/.ml.sh new file mode 100755 index 00000000..d83fcfd3 --- /dev/null +++ b/.ml.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +pwds=`gpg --decrypt ~/.pwds.gpg` +eval "$pwds" +exec mutt "$@" diff --git a/.muttrc b/.muttrc new file mode 100644 index 00000000..2d872611 --- /dev/null +++ b/.muttrc @@ -0,0 +1,50 @@ +#------------------------------------------------------------------------------- +# Multiple accounts +#------------------------------------------------------------------------------- +set my_ac_personal=personal +set my_ac_work=work +set my_ac_university=university + +folder-hook '$my_ac_personal' 'source ~/.mutt/$my_ac_personal' +folder-hook '$my_ac_work' 'source ~/.mutt/$my_ac_work' +folder-hook '$my_ac_university' 'source ~/.mutt/$my_ac_university' + +# Switch to default account on startup +#source ~/.mutt/$my_ac_personal +source ~/.mutt/$my_ac_work +#source ~/.mutt/$my_ac_university + +macro index 'source ~/.mutt/$my_ac_personal!' +macro index 'source ~/.mutt/$my_ac_work!' +macro index 'source ~/.mutt/$my_ac_university!' + + +#------------------------------------------------------------------------------- +# Receiving options +#------------------------------------------------------------------------------- + +# Store message headers locally to speed things up. +set header_cache = ~/.mutt/hcache + +# Allow mutt to open new imap connection automatically. +unset imap_passive + +# Keep imap connection alive by polling intermittently (time in seconds). +set imap_keepalive = 300 + +# How often to check for new mail (time in seconds). +set mail_check = 120 + +bind index "^" imap-fetch-mail + +#------------------------------------------------------------------------------- +# Sending options +#------------------------------------------------------------------------------- + +set mbox_type=Maildir +set edit_headers=yes + +#set folder=~/mail +#set mbox=+mbox +#set record=+sent +#set postponed=+drafts diff --git a/.netinit b/.netinit new file mode 100755 index 00000000..5f56718f --- /dev/null +++ b/.netinit @@ -0,0 +1,39 @@ +#!/bin/bash +################################################################################ +## Custom network initialization script. +## 2012-04-09 +################################################################################ + +if [ $(id -u) -ne 0 ]; then + echo "You must be root to run this script." + exit +fi + +NET_INTERFACE=wlan0 +WPA_SUPPLICANT_CONF="/etc/wpa_supplicant.conf" +TIMEOUT_LIMIT=500 + +## Clean running processes if any. +pkill dhcpcd +pkill wpa_supplicant + +## In case network inteface is not up. +ip link set ${NET_INTERFACE} up + + +## Connection. +if [ $# -eq 0 ]; then + # Associate if needed. + if [ "$(iwconfig ${NET_INTERFACE} | grep 'Not-Associated')" != "" ]; then + wpa_supplicant -B -i ${NET_INTERFACE} -D wext -c "${WPA_SUPPLICANT_CONF}" + fi + + ## Wait until wpa_supplicant has finished association. + i=0 + while [ "$(iwconfig ${NET_INTERFACE} | grep 'off/any')" != "" ] && [ $i -lt $TIMEOUT_LIMIT ] ; do + i=$(($i+1)) + done + + ## Get IP. + dhcpcd $NET_INTERFACE +fi diff --git a/.shell.d/funs_rc b/.shell.d/funs_rc index d26dac8a..77ca38ca 100644 --- a/.shell.d/funs_rc +++ b/.shell.d/funs_rc @@ -415,19 +415,17 @@ sanitize() chown -R ${USER}:users "$@" } -## sanitize - set file/directory owner and permissions to normal values (644/755) -## usage: sanitize asciify() { asciify_help() { - echo - echo "Synopsis:" - echo -e "\tConvert non-ASCII characters to their ASCII equivalent." echo echo "Usage:" echo -e "\t$1 FILES" echo + echo "Synopsis:" + echo -e "\tConvert non-ASCII characters to their ASCII equivalent." + echo } if [ $# -eq 0 ]; then @@ -454,7 +452,33 @@ asciify() done; } - +## steal +steal() +{ + steal_help() + { + echo + echo "Usage:" + echo -e "\t$1 STRING FILE" + echo + echo "Synopsis:" + echo -e "\tAppend a silently prompted string to STRING from FILE." + echo + } + + if [ $# -ne 2 ]; then + echo "Wrong number of arguments." + steal_help $0 + return + fi + + STRING="$1" + FILE="$2" + + read -s DUMMY + sed -i "s/${STRING}/${STRING}${DUMMY}/g" "${FILE}" + echo File stolen. +}