/trunk/Bash/asus-touchpad.sh |
---|
0,0 → 1,9 |
#!/bin/bash |
state=$(synclient -l | grep TouchpadOff | awk -F"= " '{print $2}') |
if [ "$state" = "0" ]; then |
kdialog --passivepopup "Wyłączam TouchPad" --title "Wciśnięty przycisk TouchPad" |
synclient TouchpadOff=1 |
else |
kdialog --passivepopup "Włączam TouchPad" --title "Wciśnięty przycisk TouchPad" |
synclient TouchpadOff=0 |
fi |
Property changes: |
Added: svn:executable |
## -0,0 +1 ## |
+* |
\ No newline at end of property |
Added: svn:mime-type |
## -0,0 +1 ## |
+text/plain |
\ No newline at end of property |
Index: trunk/Bash/dockeroff.sh |
=================================================================== |
--- trunk/Bash/dockeroff.sh (nonexistent) |
+++ trunk/Bash/dockeroff.sh (revision 10) |
@@ -0,0 +1,10 @@ |
+#!/bin/sh |
+ |
+#Check if cairo-dock is running if it's running stop it |
+ |
+if (ps -U ${USER} | grep cairo-dock > /dev/null); then |
+ PID=$(ps -U ${USER} | grep cairo-dock | awk '{printf $1}') |
+ kill -9 $PID |
+fi |
+ |
+ |
/trunk/Bash/dockeroff.sh |
---|
Property changes: |
Added: svn:executable |
## -0,0 +1 ## |
+* |
\ No newline at end of property |
Added: svn:mime-type |
## -0,0 +1 ## |
+text/plain |
\ No newline at end of property |
Index: trunk/Bash/dockeron.sh |
=================================================================== |
--- trunk/Bash/dockeron.sh (nonexistent) |
+++ trunk/Bash/dockeron.sh (revision 10) |
@@ -0,0 +1,7 @@ |
+#!/bin/sh |
+ |
+#Check if cairo dock is running if not let's start it |
+ |
+if !(ps -U ${USER} | grep cairo-dock > /dev/null); then |
+ /usr/bin/cairo-dock -c & |
+fi |
/trunk/Bash/dockeron.sh |
---|
Property changes: |
Added: svn:executable |
## -0,0 +1 ## |
+* |
\ No newline at end of property |
Added: svn:mime-type |
## -0,0 +1 ## |
+text/plain |
\ No newline at end of property |
Index: trunk/Bash/mail.sh |
=================================================================== |
--- trunk/Bash/mail.sh (nonexistent) |
+++ trunk/Bash/mail.sh (revision 10) |
@@ -0,0 +1,5 @@ |
+#!/bin/sh |
+ |
+kdialog --passivepopup "Uruchamiam program KMail" --title "Wciśnięty przycisk Email" |
+ |
+/usr/bin/kmail |
/trunk/Bash/mail.sh |
---|
Property changes: |
Added: svn:executable |
## -0,0 +1 ## |
+* |
\ No newline at end of property |
Added: svn:mime-type |
## -0,0 +1 ## |
+text/plain |
\ No newline at end of property |
Index: trunk/Bash/mailledoff.sh |
=================================================================== |
--- trunk/Bash/mailledoff.sh (nonexistent) |
+++ trunk/Bash/mailledoff.sh (revision 10) |
@@ -0,0 +1,4 @@ |
+#!/bin/sh |
+ |
+echo 0 > /sys/class/leds/asus\:\:mail/brightness |
+ |
/trunk/Bash/mailledoff.sh |
---|
Property changes: |
Added: svn:executable |
## -0,0 +1 ## |
+* |
\ No newline at end of property |
Added: svn:mime-type |
## -0,0 +1 ## |
+text/plain |
\ No newline at end of property |
Index: trunk/Bash/mailledon.sh |
=================================================================== |
--- trunk/Bash/mailledon.sh (nonexistent) |
+++ trunk/Bash/mailledon.sh (revision 10) |
@@ -0,0 +1,4 @@ |
+#!/bin/sh |
+ |
+echo 1 > /sys/class/leds/asus\:\:mail/brightness |
+ |
/trunk/Bash/mailledon.sh |
---|
Property changes: |
Added: svn:executable |
## -0,0 +1 ## |
+* |
\ No newline at end of property |
Added: svn:mime-type |
## -0,0 +1 ## |
+text/plain |
\ No newline at end of property |
Index: trunk/Bash/media-start.sh |
=================================================================== |
--- trunk/Bash/media-start.sh (nonexistent) |
+++ trunk/Bash/media-start.sh (revision 10) |
@@ -0,0 +1,9 @@ |
+#!/bin/sh |
+ |
+if (ps -u $USER | grep amarok); then |
+ kdialog --passivepopup "Program Amarok uruchomiony otwieram główne okno programu" --title "Wciśnięty przycisk Uruchamiania Mediów" |
+else |
+ kdialog --passivepopup "Uruchamiam program Amarok" --title "Wciśnięty przycisk Uruchamiania Mediów" |
+fi |
+ |
+/usr/bin/amarok |
/trunk/Bash/media-start.sh |
---|
Property changes: |
Added: svn:executable |
## -0,0 +1 ## |
+* |
\ No newline at end of property |
Added: svn:mime-type |
## -0,0 +1 ## |
+text/plain |
\ No newline at end of property |
Index: trunk/Bash/performance.sh |
=================================================================== |
--- trunk/Bash/performance.sh (nonexistent) |
+++ trunk/Bash/performance.sh (revision 10) |
@@ -0,0 +1,47 @@ |
+#!/bin/sh |
+ |
+PROFILES="/usr/local/bin/profiles" |
+ |
+test -f ${PROFILES} || exit 0 |
+ |
+TEMPFILE=/tmp/${USER}-profile.tmp |
+ |
+if (test -f ${TEMPFILE}) then |
+ read line < ${TEMPFILE} |
+ PROFILE=${line} |
+else |
+ PROFILE=Dynamic |
+fi |
+ |
+i=0 |
+flaga=0 |
+ |
+while read line |
+do |
+ i=`expr $i + 1` |
+ if (test "${line}" = "${PROFILE}") then |
+ flaga=$i |
+fi |
+done < ${PROFILES} |
+ |
+if (test $flaga -eq $i) then |
+ flaga=1 |
+else |
+ flaga=`expr $flaga + 1` |
+fi |
+ |
+j=0 |
+ |
+while read line |
+do |
+ j=`expr $j + 1` |
+ if (test $flaga -eq $j) then |
+ PROFILE=${line} |
+ fi |
+done < ${PROFILES} |
+ |
+CMD="dbus-send --print-reply --session --dest=org.kde.powerdevil /modules/powerdevil org.kde.PowerDevil.setProfile string:" |
+ |
+${CMD}"${PROFILE}" |
+ |
+echo ${PROFILE} > ${TEMPFILE} |
/trunk/Bash/performance.sh |
---|
Property changes: |
Added: svn:executable |
## -0,0 +1 ## |
+* |
\ No newline at end of property |
Added: svn:mime-type |
## -0,0 +1 ## |
+text/plain |
\ No newline at end of property |
Index: trunk/Bash/screen1.sh |
=================================================================== |
--- trunk/Bash/screen1.sh (nonexistent) |
+++ trunk/Bash/screen1.sh (revision 10) |
@@ -0,0 +1,5 @@ |
+#!/bin/sh |
+ |
+kdialog --passivepopup "Wyłączam drugi ekran" --title "Wciśnięty przycisk Screen" |
+ |
+xrandr --output LVDS --auto --output VGA-0 --off |
/trunk/Bash/screen1.sh |
---|
Property changes: |
Added: svn:executable |
## -0,0 +1 ## |
+* |
\ No newline at end of property |
Added: svn:mime-type |
## -0,0 +1 ## |
+text/plain |
\ No newline at end of property |
Index: trunk/Bash/screen2.sh |
=================================================================== |
--- trunk/Bash/screen2.sh (nonexistent) |
+++ trunk/Bash/screen2.sh (revision 10) |
@@ -0,0 +1,5 @@ |
+#!/bin/sh |
+ |
+kdialog --passivepopup "Ustawiam oba ekrany w tryb klonowania" --title "Wciśnięty przycisk Screen" |
+ |
+xrandr --output LVDS --mode 1024x768 --output VGA-0 --mode 1024x768 --same-as LVDS |
/trunk/Bash/screen2.sh |
---|
Property changes: |
Added: svn:executable |
## -0,0 +1 ## |
+* |
\ No newline at end of property |
Added: svn:mime-type |
## -0,0 +1 ## |
+text/plain |
\ No newline at end of property |
Index: trunk/Bash/screen3.sh |
=================================================================== |
--- trunk/Bash/screen3.sh (nonexistent) |
+++ trunk/Bash/screen3.sh (revision 10) |
@@ -0,0 +1,5 @@ |
+#!/bin/sh |
+ |
+kdialog --passivepopup "Uaktywniam oba ekrany w trybie domyślnej rozdzielczości " --title "Wciśnięty przycisk Screen" |
+ |
+xrandr --output LVDS --auto --output VGA-0 --auto --right-of LVDS |
/trunk/Bash/screen3.sh |
---|
Property changes: |
Added: svn:executable |
## -0,0 +1 ## |
+* |
\ No newline at end of property |
Added: svn:mime-type |
## -0,0 +1 ## |
+text/plain |
\ No newline at end of property |
Index: trunk/Bash/screenlets-restart.sh |
=================================================================== |
--- trunk/Bash/screenlets-restart.sh (nonexistent) |
+++ trunk/Bash/screenlets-restart.sh (revision 10) |
@@ -0,0 +1,45 @@ |
+#! /bin/bash |
+ |
+TEMPFILE=/tmp/screenlets.running.${USER}.tmp |
+ |
+if [ "${1}" = "stop" ]; then |
+ #Wrtie all curently running screnlets to temp file excluding screenlets deamon and manager |
+ |
+ ps aux | grep ${USER} | grep python | grep screenlets | sed '/screenlets-daemon.py/d; /screenlets-manager.py/d' | \ |
+ awk '{printf $2","; n=10;while(++n<NF) printf $n " "; printf "%s\n",$NF}'> ${TEMPFILE} |
+ |
+ #Read all file lines and close all running screenlets |
+ |
+ echo "I'm closing all running screenlets" |
+ while read line |
+ do |
+ PID=$(echo $line | awk -F, '{print $1}') |
+ kill -9 $PID |
+ done < ${TEMPFILE} |
+ |
+elif [ "${1}" = "start" ]; then |
+ #Check if the temporary file exists |
+ |
+ if (test -r ${TEMPFILE}) then |
+ |
+ #Read the temporary file and lunch screenlets using their lunching cammand |
+ |
+ echo "Starting screelets using a temporary list file" |
+ while read line |
+ do |
+ COMMAND=$(echo $line | awk -F, '{print $2}') |
+ $COMMAND &> /dev/null & |
+ sleep 10 |
+ done < ${TEMPFILE} |
+ |
+ #Removing the temporary file |
+ |
+ rm ${TEMPFILE} |
+ |
+ else |
+ echo "Seems there is no temp file or you have no rights to access it" |
+ fi |
+else |
+ echo "Usage ./screnlets-restart.sh start | stop" |
+fi |
+ |
/trunk/Bash/screenlets-restart.sh |
---|
Property changes: |
Added: svn:executable |
## -0,0 +1 ## |
+* |
\ No newline at end of property |
Added: svn:mime-type |
## -0,0 +1 ## |
+text/plain |
\ No newline at end of property |
Index: trunk/Bash/webbtn.sh |
=================================================================== |
--- trunk/Bash/webbtn.sh (nonexistent) |
+++ trunk/Bash/webbtn.sh (revision 10) |
@@ -0,0 +1,5 @@ |
+#!/bin/sh |
+ |
+kdialog --passivepopup "Uruchamiam przeglądarkę Chromium" --title "Wciśnięty przycisk WWW" |
+ |
+/usr/bin/chromium |
/trunk/Bash/webbtn.sh |
---|
Property changes: |
Added: svn:executable |
## -0,0 +1 ## |
+* |
\ No newline at end of property |
Added: svn:mime-type |
## -0,0 +1 ## |
+text/plain |
\ No newline at end of property |
Index: trunk/Bash/wireless-led.sh |
=================================================================== |
--- trunk/Bash/wireless-led.sh (nonexistent) |
+++ trunk/Bash/wireless-led.sh (revision 10) |
@@ -0,0 +1,3 @@ |
+#/bin/sh |
+ |
+echo $1 > /sys/devices/platform/asus_laptop/wlan |
/trunk/Bash/wireless-led.sh |
---|
Property changes: |
Added: svn:executable |
## -0,0 +1 ## |
+* |
\ No newline at end of property |
Added: svn:mime-type |
## -0,0 +1 ## |
+text/plain |
\ No newline at end of property |
Index: trunk/Bash/wireless-toggle.sh |
=================================================================== |
--- trunk/Bash/wireless-toggle.sh (nonexistent) |
+++ trunk/Bash/wireless-toggle.sh (revision 10) |
@@ -0,0 +1,51 @@ |
+#Function to toggle wireless interfaces originaly created by Paul Sladen for Ubuntu acpi-support package |
+for DEVICE in /sys/class/net/* ; do |
+ if [ -d $DEVICE/wireless ] ; then |
+ # $DEVICE is a wireless device. |
+ |
+ FOUND= |
+ # Yes, that's right... the new interface reverses the truth values. |
+ ON=1 |
+ OFF=0 |
+ for CONTROL in $DEVICE/device/rfkill/rfkill*/state; do |
+ if [ -w "$CONTROL" ]; then |
+ FOUND=1 |
+ |
+ if [ "$(cat "$CONTROL")" = "$ON" ] ; then |
+ # It's powered on. Switch it off. |
+ echo -n "$OFF" > "$CONTROL" |
+ else |
+ # It's powered off. Switch it on. |
+ echo -n "$ON" > "$CONTROL" |
+ fi |
+ fi |
+ done |
+ # it might be safe to assume that a device only supports one |
+ # interface at a time; but just in case, we short-circuit |
+ # here to avoid toggling the power twice |
+ if [ -n "$FOUND" ]; then |
+ continue |
+ fi |
+ |
+ ON=0 |
+ OFF=1 # 1 for rf_kill, 2 for power/state |
+ for CONTROL in $DEVICE/device/rf_kill $DEVICE/device/power/state ; do |
+ if [ -w $CONTROL ] ; then |
+ # We have a way of controlling the device, lets try |
+ if [ "`cat $CONTROL`" = 0 ] ; then |
+ # It's powered on. Switch it off. |
+ if echo -n $OFF > $CONTROL ; then |
+ break |
+ else |
+ OFF=2 # for power/state, second time around |
+ fi |
+ else |
+ # It's powered off. Switch it on. |
+ if echo -n $ON > $CONTROL ; then |
+ break |
+ fi |
+ fi |
+ fi |
+ done |
+ fi |
+ done |
/trunk/Bash/wireless-toggle.sh |
---|
Property changes: |
Added: svn:executable |
## -0,0 +1 ## |
+* |
\ No newline at end of property |
Added: svn:mime-type |
## -0,0 +1 ## |
+text/plain |
\ No newline at end of property |
Index: trunk/Bash/wireless.sh |
=================================================================== |
--- trunk/Bash/wireless.sh (nonexistent) |
+++ trunk/Bash/wireless.sh (revision 10) |
@@ -0,0 +1,43 @@ |
+#!/bin/sh |
+#Function to check status originaly created by Paul Sladen for Ubuntu acpi-support package |
+isAnyWirelessPoweredOn() |
+{ |
+ for DEVICE in /sys/class/net/* ; do |
+ if [ -d $DEVICE/wireless ]; then |
+ # Hurray for stable interfaces... now the rfkill is scarcely |
+ # associated with the network device at all (!) |
+ for RFKILL in $DEVICE/device/rfkill/rfkill*/state; do |
+ if [ -r "$RFKILL" ] && [ "$(cat "$RFKILL")" -eq 1 ] |
+ then |
+ return 0 |
+ fi |
+ done |
+ # if any of the wireless devices are turned on then return success |
+ if [ -r $DEVICE/device/power/state ] && [ "`cat $DEVICE/device/power/state`" -eq 0 ] |
+ then |
+ return 0 |
+ fi |
+ if [ -r $DEVICE/device/rf_kill ] && [ "`cat $DEVICE/device/rf_kill`" -eq 0 ] |
+ then |
+ return 0 |
+ fi |
+ fi |
+ done |
+ |
+ # otherwise return failure |
+ return 1 |
+} |
+ |
+if (isAnyWirelessPoweredOn); then |
+ kdialog --passivepopup "Wyłączam Interfejsy bezprzewodowe" --title "Wciśnięty przycisk Wifi" |
+else |
+ kdialog --passivepopup "Włączam Interfejsy bezprzewodowe" --title "Wciśnięty przycisk Wifi" |
+fi |
+ |
+sudo /usr/local/bin/wireless-toggle.sh |
+ |
+if (isAnyWirelessPoweredOn); then |
+ sudo /usr/local/bin/wireless-led.sh 1 |
+else |
+ sudo /usr/local/bin/wireless-led.sh 0 |
+fi |
/trunk/Bash/wireless.sh |
---|
Property changes: |
Added: svn:executable |
## -0,0 +1 ## |
+* |
\ No newline at end of property |
Added: svn:mime-type |
## -0,0 +1 ## |
+text/plain |
\ No newline at end of property |