]> gitweb.fluxo.info Git - utils-x11.git/commitdiff
Initial import
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 18 Sep 2014 19:38:30 +0000 (16:38 -0300)
committerSilvio Rhatto <user@example.org>
Thu, 18 Sep 2014 19:38:30 +0000 (16:38 -0300)
12 files changed:
README.md [new file with mode: 0644]
TODO.md [new file with mode: 0644]
firefox-profile [new file with mode: 0755]
leds [new file with mode: 0755]
terminal [new file with mode: 0755]
xconky [new file with mode: 0755]
xhibernate [new file with mode: 0755]
xlock [new file with mode: 0755]
xmutt [new file with mode: 0755]
xsuspend [new file with mode: 0755]
xwicd [new file with mode: 0755]
xwyrd [new file with mode: 0755]

diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/TODO.md b/TODO.md
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/firefox-profile b/firefox-profile
new file mode 100755 (executable)
index 0000000..8c06a5f
--- /dev/null
@@ -0,0 +1,9 @@
+#
+# Wrapper around firefox
+#
+
+if [ ! -z "$1" ]; then
+  iceweasel -p $1 --no-remote &
+else
+  iceweasel --profilemanager -no-remote
+fi
diff --git a/leds b/leds
new file mode 100755 (executable)
index 0000000..22ff769
--- /dev/null
+++ b/leds
@@ -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 (executable)
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
diff --git a/xconky b/xconky
new file mode 100755 (executable)
index 0000000..f03feb7
--- /dev/null
+++ b/xconky
@@ -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 (executable)
index 0000000..de26f1e
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/bash
+#
+# Hibernate computer
+#
+
+xlock
+sleep 2
+sudo s2disk
diff --git a/xlock b/xlock
new file mode 100755 (executable)
index 0000000..29ce9b9
--- /dev/null
+++ b/xlock
@@ -0,0 +1,6 @@
+#!/bin/bash
+#
+# Lock the screen using xscreensaver
+#
+
+xscreensaver-command --lock
diff --git a/xmutt b/xmutt
new file mode 100755 (executable)
index 0000000..744f48c
--- /dev/null
+++ b/xmutt
@@ -0,0 +1,6 @@
+#
+# Simple wrapper around mutt
+#
+
+xtitle mail
+mutt
diff --git a/xsuspend b/xsuspend
new file mode 100755 (executable)
index 0000000..e1ecd71
--- /dev/null
+++ b/xsuspend
@@ -0,0 +1,8 @@
+#!/bin/bash
+#
+# Activate software suspend
+#
+
+xlock
+sleep 2
+sudo pm-suspend
diff --git a/xwicd b/xwicd
new file mode 100755 (executable)
index 0000000..3dd8954
--- /dev/null
+++ b/xwicd
@@ -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
diff --git a/xwyrd b/xwyrd
new file mode 100755 (executable)
index 0000000..05964dc
--- /dev/null
+++ b/xwyrd
@@ -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