diff options
author | xero <x@xero.nu> | 2014-03-08 22:05:02 -0500 |
---|---|---|
committer | xero <x@xero.nu> | 2014-03-08 22:05:02 -0500 |
commit | b58ff155f74cbe76f51aa0074d8d2218de774613 (patch) | |
tree | c38b8ac4eab2ae476de312e80c8913db8b264334 | |
parent | 9ae724da88a69ab938ee1f899949441cb97b84a7 (diff) | |
download | dotfiles_ascii-b58ff155f74cbe76f51aa0074d8d2218de774613.tar.xz dotfiles_ascii-b58ff155f74cbe76f51aa0074d8d2218de774613.zip |
reorganize scripts, and system automation scripts for hybrid graphics, touchpad management, and file comparison
-rwxr-xr-x | code/fun/2spooky.lua (renamed from fun/2spooky.lua) | 0 | ||||
-rwxr-xr-x | code/fun/colors (renamed from fun/colors) | 0 | ||||
-rwxr-xr-x | code/fun/colorscheme (renamed from fun/colorscheme) | 0 | ||||
-rwxr-xr-x | code/fun/dna (renamed from fun/dna) | 0 | ||||
-rwxr-xr-x | code/fun/ghosts (renamed from fun/ghosts) | 0 | ||||
-rwxr-xr-x | code/fun/invaders (renamed from fun/invaders) | 0 | ||||
-rwxr-xr-x | code/fun/pacman (renamed from fun/pacman) | 0 | ||||
-rwxr-xr-x | code/fun/pipes (renamed from fun/pipes) | 0 | ||||
-rwxr-xr-x | code/fun/pipesx (renamed from fun/pipesx) | 0 | ||||
-rwxr-xr-x | code/fun/rain (renamed from fun/rain) | 0 | ||||
-rwxr-xr-x | code/fun/screenfetch (renamed from fun/screenfetch) | 0 | ||||
-rwxr-xr-x | code/fun/skull (renamed from fun/skull) | 0 | ||||
-rwxr-xr-x | code/fun/slendy (renamed from fun/slendy) | 0 | ||||
-rwxr-xr-x | code/sys/gfx-intel.sh | 9 | ||||
-rwxr-xr-x | code/sys/gfx-off.sh | 9 | ||||
-rwxr-xr-x | code/sys/gfx-on.sh | 9 | ||||
-rwxr-xr-x | code/sys/gfx-radeon.sh | 9 | ||||
-rwxr-xr-x | code/sys/gfx-status.sh | 39 | ||||
-rw-r--r-- | code/sys/hash-compare.sh | 17 | ||||
-rwxr-xr-x | code/sys/toggle-touchpad.sh | 20 |
20 files changed, 112 insertions, 0 deletions
diff --git a/fun/2spooky.lua b/code/fun/2spooky.lua index a0ebc5d..a0ebc5d 100755 --- a/fun/2spooky.lua +++ b/code/fun/2spooky.lua diff --git a/fun/colors b/code/fun/colors index c8d527b..c8d527b 100755 --- a/fun/colors +++ b/code/fun/colors diff --git a/fun/colorscheme b/code/fun/colorscheme index ad8ab40..ad8ab40 100755 --- a/fun/colorscheme +++ b/code/fun/colorscheme diff --git a/fun/ghosts b/code/fun/ghosts index 2cf1727..2cf1727 100755 --- a/fun/ghosts +++ b/code/fun/ghosts diff --git a/fun/invaders b/code/fun/invaders index 0ca2036..0ca2036 100755 --- a/fun/invaders +++ b/code/fun/invaders diff --git a/fun/pacman b/code/fun/pacman index 51697cc..51697cc 100755 --- a/fun/pacman +++ b/code/fun/pacman diff --git a/fun/pipes b/code/fun/pipes index 5cc366e..5cc366e 100755 --- a/fun/pipes +++ b/code/fun/pipes diff --git a/fun/pipesx b/code/fun/pipesx index 02ed325..02ed325 100755 --- a/fun/pipesx +++ b/code/fun/pipesx diff --git a/fun/screenfetch b/code/fun/screenfetch index 70fc4d8..70fc4d8 100755 --- a/fun/screenfetch +++ b/code/fun/screenfetch diff --git a/fun/skull b/code/fun/skull index 91deff5..91deff5 100755 --- a/fun/skull +++ b/code/fun/skull diff --git a/fun/slendy b/code/fun/slendy index 766e06c..766e06c 100755 --- a/fun/slendy +++ b/code/fun/slendy diff --git a/code/sys/gfx-intel.sh b/code/sys/gfx-intel.sh new file mode 100755 index 0000000..c68b0c5 --- /dev/null +++ b/code/sys/gfx-intel.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +integrated=$(echo IGD | sudo tee /sys/kernel/debug/vgaswitcheroo/switch) + +notify-send -t 5000 \ +-i "/home/xero/.config/awesome/greyhash/gfx.png" \ +' gfx status +░░▒▒▓▓▓████▓▓▓▒▒░░' \ +" intel powered on"
\ No newline at end of file diff --git a/code/sys/gfx-off.sh b/code/sys/gfx-off.sh new file mode 100755 index 0000000..31f3eb9 --- /dev/null +++ b/code/sys/gfx-off.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +integrated=$(echo OFF | sudo tee /sys/kernel/debug/vgaswitcheroo/switch) + +notify-send -t 5000 \ +-i "/home/xero/.config/awesome/greyhash/gfx.png" \ +' gfx status +░░▒▒▓▓▓████▓▓▓▒▒░░' \ +"unused powered off"
\ No newline at end of file diff --git a/code/sys/gfx-on.sh b/code/sys/gfx-on.sh new file mode 100755 index 0000000..44accdf --- /dev/null +++ b/code/sys/gfx-on.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +integrated=$(echo ON | sudo tee /sys/kernel/debug/vgaswitcheroo/switch) + +notify-send -t 5000 \ +-i "/home/xero/.config/awesome/greyhash/gfx.png" \ +' gfx status +░░▒▒▓▓▓████▓▓▓▒▒░░' \ +" both powered on"
\ No newline at end of file diff --git a/code/sys/gfx-radeon.sh b/code/sys/gfx-radeon.sh new file mode 100755 index 0000000..070d161 --- /dev/null +++ b/code/sys/gfx-radeon.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +integrated=$(echo DIS | sudo tee /sys/kernel/debug/vgaswitcheroo/switch) + +notify-send -t 5000 \ +-i "/home/xero/.config/awesome/greyhash/gfx.png" \ +' gfx status +░░▒▒▓▓▓████▓▓▓▒▒░░' \ +"radeon powered on"
\ No newline at end of file diff --git a/code/sys/gfx-status.sh b/code/sys/gfx-status.sh new file mode 100755 index 0000000..d8e621a --- /dev/null +++ b/code/sys/gfx-status.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +pci_integrated=$(lspci | grep VGA | sed -n '1p' | cut -f 1 -d " ") +pci_discrete=$(lspci | grep VGA | sed -n '2p' | cut -f 1 -d " ") + +integrated=$(cat /sys/kernel/debug/vgaswitcheroo/switch | grep $pci_integrated | grep -o -P ':.:...:') +discrete=$(cat /sys/kernel/debug/vgaswitcheroo/switch | grep $pci_discrete | grep -o -P ':.:...:') + +name_integrated=$(lspci | grep VGA | sed -n '1p' | sed -e "s/.* VGA compatible controller[ :]*//g" | sed -e "s/ Corporation//g" | sed -e "s/ Technologies Inc//g" | sed -e 's/\[[0-9]*\]: //g' | sed -e 's/\[[0-9:a-z]*\]//g' | sed -e 's/(rev [a-z0-9]*)//g' | sed -e "s/ Integrated Graphics Controller//g") +name_discrete=$(lspci | grep VGA | sed -n '2p' | sed -e "s/.* VGA compatible controller[ :]*//g" | sed -e "s/ Corporation//g" | sed -e "s/ Technologies Inc//g" | sed -e 's/\[[0-9]*\]: //g' | sed -e 's/\[[0-9:a-z]*\]//g' | sed -e 's/(rev [a-z0-9]*)//g' | sed -e "s/ Integrated Graphics Controller//g") + +if [ "$integrated" = ":+:Pwr:" ] +then +integrated_condition="on" +elif [ "$integrated" = ": :Pwr:" ] +then +integrated_condition="on" +elif [ "$integrated" = ": :Off:" ] +then +integrated_condition="off" +fi + +if [ "$discrete" = ":+:Pwr:" ] +then +discrete_condition="on" +elif [ "$discrete" = ": :Pwr:" ] +then +discrete_condition="on" +elif [ "$discrete" = ": :Off:" ] +then +discrete_condition="off" +fi + +notify-send -t 5000 \ +-i "/home/xero/.config/awesome/greyhash/gfx.png" \ +' gfx status +░░▒▒▓▓███▓▓▒▒░░' \ +" intel = $integrated_condition + radeon = $discrete_condition"
\ No newline at end of file diff --git a/code/sys/hash-compare.sh b/code/sys/hash-compare.sh new file mode 100644 index 0000000..49dad54 --- /dev/null +++ b/code/sys/hash-compare.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ "$#" -ne 2 ]; then + echo "please supply two files to diff" +else + sum1=$(md5sum $1) + sum2=$(md5sum $2) + + hash1="${sum1/$1/}" + hash2="${sum2/$2/}" + + if [ "$hash1" == "$hash2" ]; then + echo "identical" + else + echo "different" + fi +fi diff --git a/code/sys/toggle-touchpad.sh b/code/sys/toggle-touchpad.sh new file mode 100755 index 0000000..2381a86 --- /dev/null +++ b/code/sys/toggle-touchpad.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# enable/disable touchpad +# find your touchpad name: +# egrep -i 'synap|alps|etps' /proc/bus/input/devices +PAD='SynPS/2 Synaptics TouchPad' +A=`xinput list-props "$PAD" | sed -n -e 's/.*Device Enabled ([0-9][0-9]*):\t\(.*\)/\1/p' ` +if [ $A -eq 1 ]; then +xinput set-int-prop "$PAD" "Device Enabled" 8 0 +notify-send -t 5000 \ +' touchpad +░░▒▒▓▓██▓▓▒▒░░' \ +' disabled' +else +xinput set-int-prop "$PAD" "Device Enabled" 8 1 +notify-send -t 5000 \ +' touchpad +░░▒▒▓▓██▓▓▒▒░░' \ +' enabled' +fi |