diff options
-rw-r--r-- | README.md | 0 | ||||
-rw-r--r-- | TODO.md | 0 | ||||
-rwxr-xr-x | firefox-profile | 9 | ||||
-rwxr-xr-x | leds | 25 | ||||
-rwxr-xr-x | terminal | 38 | ||||
-rwxr-xr-x | xconky | 57 | ||||
-rwxr-xr-x | xhibernate | 8 | ||||
-rwxr-xr-x | xlock | 6 | ||||
-rwxr-xr-x | xmutt | 6 | ||||
-rwxr-xr-x | xsuspend | 8 | ||||
-rwxr-xr-x | xwicd | 10 | ||||
-rwxr-xr-x | xwyrd | 13 |
12 files changed, 180 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/README.md diff --git a/firefox-profile b/firefox-profile new file mode 100755 index 0000000..8c06a5f --- /dev/null +++ b/firefox-profile @@ -0,0 +1,9 @@ +# +# Wrapper around firefox +# + +if [ ! -z "$1" ]; then + iceweasel -p $1 --no-remote & +else + iceweasel --profilemanager -no-remote +fi @@ -0,0 +1,25 @@ +#! /bin/bash +# +# Get keyboard led state. +# See https://bbs.archlinux.org/viewtopic.php?id=68511 +# + +ledstate="`xset q 2>/dev/null | grep LED`" +ledstate="`echo $ledstate | sed s/[^1-9]//g`" +case "$ledstate" in + '1') + echo "[CapsLock] " + ;; + '2') + # Right now we're not interested on NumLock status + #echo "[NumLock]" + echo "" + ;; + '3') + # Right now we're not interested on NumLock status + #echo "[CapsLock][NumLock]" + echo "[CapsLock] " + ;; + *) + echo "" +esac diff --git a/terminal b/terminal new file mode 100755 index 0000000..e76974a --- /dev/null +++ b/terminal @@ -0,0 +1,38 @@ +#!/bin/bash +# +# Terminal emulator wrapper +# + +source ~/.geometry || exit 1 + +if [ -z "$TITLE" ]; then + if [ ! -z "$1" ]; then + TITLE="$1" + else + TITLE="terminal" + fi +fi + +if [ "$TERM" == "rxvt" ]; then + if [ ! -z "$1" ]; then + rxvt-unicode -bg black +sb -fg white -fn $FONT -g $GEOMETRY -title $TITLE \ + -e bash -rcfile $HOME/.terminal -c "$*" + else + rxvt-unicode -bg black +sb -fg white -fn $FONT -g $GEOMETRY -title $TITLE \ + -e bash -rcfile $HOME/.terminal + fi +elif [ "$TERM" == "Eterm" ]; then + if [ ! -z "$1" ]; then + Eterm --background-pixmap 0 --scrollbar 0 +sb -b black -f white -F $FONT --borderless no \ + --buttonbar 0 -g $GEOMETRY -n$TITLE -e bash -rcfile $HOME/.terminal -c "$*" + else + Eterm --background-pixmap 0 --scrollbar 0 +sb -b black -f white -F $FONT --borderless no \ + --buttonbar 0 -g $GEOMETRY -n$TITLE -e bash -rcfile $HOME/.terminal + fi +elif [ "$TERM" == "xterm" ]; then + if [ ! -z "$1" ]; then + xterm -u8 -fn $FONT -geometry $GEOMETRY -title $TITLE -e bash -c "$*" + else + xterm -u8 -fn $FONT -geometry $GEOMETRY -title $TITLE -e bash + fi +fi @@ -0,0 +1,57 @@ +#!/bin/bash +# +# Conky wrapper +# + +# Start multiple conky instances +function xconky_start { + # Default one + conky & + + # Weather + if [ -e "$HOME/.brweather.conf" ]; then + # Give time for networking + sleep 60 + + # Load weather data first + weather &> /dev/null + + # Clear cache + brweather --clean-cache + + # Weather + conky -c ~/.conky/weather/conkyrc & + fi +} + +# Battery level if on laptop +function xconky_battery { + if laptop-detect; then + echo '${color grey}${color grey}Power: ${battery} ${battery_bar 6}' + fi +} + +# Show home usage +function xconky_fs_home { + echo "~/ \$color\${fs_free $HOME}/\${fs_size $HOME} \${fs_bar 6 $HOME}" +} + +# Refresh all instances +function xconky_refresh { + # Clear cache + brweather --clean-cache + + # Send HUP + killall -USR1 conky +} + +# Parse +if [ -z "$1" ] || [ "$1" == "start" ]; then + xconky_start +elif [ "$1" == "battery" ]; then + xconky_battery +elif [ "$1" = "fs_home" ]; then + xconky_fs_home +elif [ "$1" = "refresh" ]; then + xconky_refresh +fi diff --git a/xhibernate b/xhibernate new file mode 100755 index 0000000..de26f1e --- /dev/null +++ b/xhibernate @@ -0,0 +1,8 @@ +#!/bin/bash +# +# Hibernate computer +# + +xlock +sleep 2 +sudo s2disk @@ -0,0 +1,6 @@ +#!/bin/bash +# +# Lock the screen using xscreensaver +# + +xscreensaver-command --lock @@ -0,0 +1,6 @@ +# +# Simple wrapper around mutt +# + +xtitle mail +mutt diff --git a/xsuspend b/xsuspend new file mode 100755 index 0000000..e1ecd71 --- /dev/null +++ b/xsuspend @@ -0,0 +1,8 @@ +#!/bin/bash +# +# Activate software suspend +# + +xlock +sleep 2 +sudo pm-suspend @@ -0,0 +1,10 @@ +#!/bin/bash +# +# Start wicd if on laptop boxes. +# + +if laptop-detect; then + if which wicd-gtk &> /dev/null; then + wicd-gtk --tray + fi +fi @@ -0,0 +1,13 @@ +#!/bin/bash +# +# Start calendar application. +# + +# Set title. +xtitle calendar + +# For some reason, we have to sleep a while, otherwise wyrd won't start. +sleep 0.01 + +# Start wyrd. +wyrd |