Subversion Repositories My Stuff

Compare Revisions

Ignore whitespace Rev 9 → Rev 10

/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: dockeroff.sh
===================================================================
--- dockeroff.sh (nonexistent)
+++ 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
+
+
/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: dockeron.sh
===================================================================
--- dockeron.sh (nonexistent)
+++ 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
/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: mail.sh
===================================================================
--- mail.sh (nonexistent)
+++ mail.sh (revision 10)
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+kdialog --passivepopup "Uruchamiam program KMail" --title "Wciśnięty przycisk Email"
+
+/usr/bin/kmail
/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: mailledoff.sh
===================================================================
--- mailledoff.sh (nonexistent)
+++ mailledoff.sh (revision 10)
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+echo 0 > /sys/class/leds/asus\:\:mail/brightness
+
/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: mailledon.sh
===================================================================
--- mailledon.sh (nonexistent)
+++ mailledon.sh (revision 10)
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+echo 1 > /sys/class/leds/asus\:\:mail/brightness
+
/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: media-start.sh
===================================================================
--- media-start.sh (nonexistent)
+++ 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
/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: performance.sh
===================================================================
--- performance.sh (nonexistent)
+++ 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}
/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: screen1.sh
===================================================================
--- screen1.sh (nonexistent)
+++ 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
/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: screen2.sh
===================================================================
--- screen2.sh (nonexistent)
+++ 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
/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: screen3.sh
===================================================================
--- screen3.sh (nonexistent)
+++ 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
/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: screenlets-restart.sh
===================================================================
--- screenlets-restart.sh (nonexistent)
+++ 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
+
/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: webbtn.sh
===================================================================
--- webbtn.sh (nonexistent)
+++ 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
/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: wireless-led.sh
===================================================================
--- wireless-led.sh (nonexistent)
+++ wireless-led.sh (revision 10)
@@ -0,0 +1,3 @@
+#/bin/sh
+
+echo $1 > /sys/devices/platform/asus_laptop/wlan
/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: wireless-toggle.sh
===================================================================
--- wireless-toggle.sh (nonexistent)
+++ 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
/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: wireless.sh
===================================================================
--- wireless.sh (nonexistent)
+++ 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
/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