]> git.friedersdorff.com Git - max/dotfiles.git/commitdiff
Laptop config
authorMaximilian Friedersdorff <max@friedersdorff.com>
Sun, 27 Aug 2017 14:00:44 +0000 (15:00 +0100)
committerMaximilian Friedersdorff <max@friedersdorff.com>
Sun, 27 Aug 2017 14:00:44 +0000 (15:00 +0100)
X/.Xresources
X/.Xresources.iridium [new file with mode: 0644]
X/.local/bin/bat_mgt.sh [new file with mode: 0755]
X/.xinitrc
ratpoison/.ratpoisonrc [deleted file]
ratpoison/.ratpoisonrc.base [new file with mode: 0644]

index eb6dce093e4f82a7aa2fb9e084f0a5b8d6df8484..4fd3626a8b6fa6b5dc0c790c575b61a36da0e620 100644 (file)
@@ -36,7 +36,7 @@
 *.color15:      #ffffff
 
 
-*faceName: Inconsolata
+*faceName: Liberation Mono
 *faceSize: 14
 
 
@@ -52,4 +52,4 @@ XTerm*allowSendEvents: true
               <Key>Delete:    string("\033[3~")\n\
               <Key>Home:      string("\033[1~")\n\
               <Key>End:       string("\033[4~")
-*ttyModes: erase ^?
\ No newline at end of file
+*ttyModes: erase ^?
diff --git a/X/.Xresources.iridium b/X/.Xresources.iridium
new file mode 100644 (file)
index 0000000..6e046c3
--- /dev/null
@@ -0,0 +1 @@
+*faceSize:20 
diff --git a/X/.local/bin/bat_mgt.sh b/X/.local/bin/bat_mgt.sh
new file mode 100755 (executable)
index 0000000..cfdbdd0
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+# Polls the battery status once per minute.  Echos the status to ratpoison if the
+# battery is discharging.  At low battery status, it warns at 30,20 and 15 minutes 
+# remaining.  Shutsdown at 9 minutes remaining.  Requires 'acpitool' to poll the battery.
+
+while [ 1 ]; do
+       if [ $(acpitool | awk '/AC adapter/{print $4}') = "off-line" ]; then
+               bat_stat="$(acpitool | grep Battery)"
+               seconds_remaining=$(echo $bat_stat | awk '{print $6}' | awk -F':' '{print $1*3600 + $2*60 + $3}')
+               if [ $seconds_remaining -le 840 ]; then
+                       sudo shutdown -h now
+               elif [ $seconds_remaining -le 900 ]; then
+                       ratpoison -c "echo Critical! 15 minutes of battery remaining. Shutting down in 1minute."
+               elif [ $seconds_remaining -le 1200 ]; then
+                       ratpoison -c "echo Warning! 20 minutes of battery remaining. Shuttind down in 5 minutes."
+               elif [ $seconds_remaining -le 1800 ]; then
+                       ratpoison -c "echo Warning, 30 minutes of battery remaining. Shutting down in 15 minutes."
+               fi
+               ratpoison -c "echo $bat_stat"
+       fi
+       sleep 60
+done
+
index 60e56eb6bde8dd6e088ca61bb9e08f0f9281728a..ad4afd12629ed744abc0842259445003eb430eb3 100644 (file)
@@ -27,6 +27,12 @@ case $HOSTNAME in
        xmodmap -e "keycode 135 = Control_R Control_R Control_R Control_R"
        xmodmap -e "add Control = Control_L Control_R"
        ;;
+    iridium)
+       setxkbmap -variant colemak gb
+       xmodmap -e "keycode 66 = Control_L Control_L Control_L Control_L"
+       xmodmap -e "keycode 135 = Control_R Control_R Control_R Control_R"
+       xmodmap -e "add Control = Control_L Control_R"
+       ;;
     beryllium)
        setxkbmap -variant colemak us
        xmodmap -e "keycode 66 = Control_L Control_L Control_L Control_L"
@@ -62,4 +68,16 @@ xset -b
 #
 #gpg-connect-agent updatestartuptty /bye >/dev/null
 
+# Battery monitoring
+case $HOSTNAME in
+       palladium)
+               xbattmon&
+               ;;
+       iridium)
+               ~/.local/bin/bat_mgt.sh&
+       *)
+esac
+
+cat ~/.ratpoisonrc.base ~/.ratpoisonrc.$HOSTNAME > ~/.ratpoisonrc
+
 exec /usr/bin/ratpoison
diff --git a/ratpoison/.ratpoisonrc b/ratpoison/.ratpoisonrc
deleted file mode 100644 (file)
index f1b0b5c..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-# Set the colors for ratpoison text!
-set bgcolor red
-set fwcolor red
-
-bind f exec firefox --remote "openurl(`$RATPOISON -c getsel`,new-tab)"
-
-bind l ratclick 1
-bind v ratclick 2
-
-bind dollar exec ~/.local/bin/suspend
diff --git a/ratpoison/.ratpoisonrc.base b/ratpoison/.ratpoisonrc.base
new file mode 100644 (file)
index 0000000..5e1404b
--- /dev/null
@@ -0,0 +1,25 @@
+# Set the colors for ratpoison text!
+set bgcolor red
+set fwcolor red
+set font "Liberation Mono:size=20"
+
+bind f exec firefox --remote "openurl(`$RATPOISON -c getsel`,new-tab)"
+
+bind l ratclick 1
+bind v ratclick 2
+
+bind dollar exec ~/.local/bin/suspend
+
+definekey top XF86AudioLowerVolume exec amixer set Master 5%-
+definekey top XF86AudioRaiseVolume exec amixer set Master 5%+
+definekey top XF86AudioMute exec amixer set Master toggle 
+
+definekey top XF86TouchpadToggle exec source /usr/local/bin/toggle_touchpad
+
+definekey top XF86Sleep exec ~/.local/bin/suspend
+
+definekey top XF86KbdBrightnessDown exec sudo /usr/local/bin/kbd_bl -
+definekey top XF86KbdBrightnessUp exec sudo /usr/local/bin/kbd_bl +
+
+definekey top XF86MonBrightnessUp exec sudo /usr/local/bin/bl +
+definekey top XF86MonBrightnessDown exec sudo /usr/local/bin/bl -