Skip to content

Instantly share code, notes, and snippets.

View erhan-'s full-sized avatar
🏠
Working from home

Erhan erhan-

🏠
Working from home
View GitHub Profile
@erhan-
erhan- / gist:5142637
Created March 12, 2013 12:52
A simple firefox to dwb bookmark converter. Has to be run in the same folder as bookmarks.html
#!/bin/bash
#dwb ff bm conv
#this not completed
count=`grep -c icon bookmarks.html`
for (( i = 1; i < $count; i++));do
url=`cat bookmarks.html|grep icon | awk "FNR==$i" | awk '{gsub(/HREF="|"/,"") };{print $2}'`
name=`cat bookmarks.html | grep icon |awk "FNR==$i" | awk 'match($0,"\">"){print substr($0,RSTART+1)}' | cut -c 2-| rev | cut -c 5- | rev`
@erhan-
erhan- / gist:5142653
Created March 12, 2013 12:54
My dwmstatus
#!/bin/bash
#while true; do
#statements
# xsetroot -name "$(acpi +d'%d') $(date)"
# sleep 5
#done
while true; do
akku=$(acpi +d'%d' | awk '{gsub("[%,]","");print $4}')
if [[ $akku -eq 5 ]]; then
notify-send -u critical "Achtung! Akku bei $akku %."
@erhan-
erhan- / gist:5142679
Created March 12, 2013 12:58
Autorotater for thinkpad x200 tablet under arch linux
#!/bin/bash
# Working autorotate on thinkpad x200 tablet
rstate="0"
while [ true ]
do
react=`grep 0 -c /sys/devices/platform/thinkpad_acpi/hotkey_tablet_mode`
if (( ($react == "1") && ($rstate=="1") )); then
/usr/bin/xrandr -o normal
xsetwacom set "Serial Wacom Tablet WACf008 stylus" Rotate none
xsetwacom set "Serial Wacom Tablet WACf008 eraser" Rotate none