initial commit

This commit is contained in:
2018-03-01 00:47:14 +01:00
commit 304f883c1e
45 changed files with 2651 additions and 0 deletions

3
scripts/autostart.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
nextcloud &

13
scripts/battery.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
STATUS="$(cat /sys/class/power_supply/BAT1/status)"
BAT="$(cat /sys/class/power_supply/BAT1/capacity)"
OUTPUT="♥ "
if [ "$STATUS" == "charging" ]
then
OUTPUT=$OUTPUT"l"
fi
echo "$OUTPUT$BAT%"

11
scripts/bin/spotify Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
spotify=/usr/bin/spotify
if [[ -x $spotify && -x /usr/bin/blockify ]];
then
blockify &
block_pid=$!
$spotify
trap "kill -9 $block_pid" SIGINT SIGTERM EXIT
fi

37
scripts/lock.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
lock_icon="$HOME/.dotfiles/screen-lock.png"
scrot /tmp/screen.png
convert /tmp/screen.png -scale 20% -scale 500% /tmp/screen.png
if [[ -f $lock_icon ]]
then
# placement x/y
PX=0
PY=0
# lockscreen image info
R=$(file $lock_icon | grep -o '[0-9]* x [0-9]*')
RX=$(echo $R | cut -d' ' -f 1)
RY=$(echo $R | cut -d' ' -f 3)
SR=$(xrandr --query | grep ' connected' | sed 's/primary //' | cut -f3 -d' ')
for RES in $SR
do
# monitor position/offset
SRX=$(echo $RES | cut -d'x' -f 1) # x pos
SRY=$(echo $RES | cut -d'x' -f 2 | cut -d'+' -f 1) # y pos
SROX=$(echo $RES | cut -d'x' -f 2 | cut -d'+' -f 2) # x offset
SROY=$(echo $RES | cut -d'x' -f 2 | cut -d'+' -f 3) # y offset
PX=$(($SROX + $SRX/2 - $RX/2))
PY=$(($SROY + $SRY/2 - $RY/2))
convert /tmp/screen.png $lock_icon -geometry +$PX+$PY -composite -matte /tmp/screen.png
echo "done"
done
fi
# dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop
i3lock -e -n -u -i /tmp/screen.png
# Turn the screen off after a delay.
sleep 60; pgrep i3lock && xset dpms force off

22
scripts/notify_brightness.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
brightness=$((`xbacklight|cut -f1 -d"."` + 1 ))
echo $brightness
if [ $brightness -lt 10 ]
then
status="notification-display-brightness-off"
elif [ $brightness -lt "30" ]
then
status="notification-display-brightness-low"
elif [ $brightness -lt "60" ]
then
status="notification-display-brightness-medium"
elif [ $brightness -lt "95" ]
then
status="notification-display-brightness-high"
else
status="notification-display-brightness-full"
fi
notify-send " " -i $status -h int:value:$brightness -h string:x-canonical-private-synchronous:brightness

62
scripts/notify_examples.sh Executable file
View File

@ -0,0 +1,62 @@
#!/bin/sh
notify-send "Take note" "The next example will test the icon-only layout-case" -i dialog-info
sleep 2
notify-send "Eject" -i notification-device-eject -h string:x-canonical-private-icon-only:
sleep 2
notify-send "WiFi signal found" -i notification-network-wireless-medium
sleep 2
notify-send "WiFi signal lost" -i notification-network-wireless-disconnected
sleep 2
notify-send "Volume" -i notification-audio-volume-medium -h int:value:75 -h string:x-canonical-private-synchronous:
sleep 2
notify-send "Volume" -i notification-audio-volume-low -h int:value:30 -h string:x-canonical-private-synchronous:
sleep 2
notify-send "Brightness" -i notification-display-brightness-high -h int:value:101 -h string:x-canonical-private-synchronous:
sleep 2
notify-send "Brightness" -i notification-keyboard-brightness-medium -h int:value:45 -h string:x-canonical-private-synchronous:
sleep 2
notify-send "Testing markup" "Some <b>bold</b>, <u>underlined</u>, <i>italic</i> text. Note, you should not see any marked up text."
sleep 2
notify-send "Jamshed Kakar" "Hey, what about this restaurant? http://www.blafasel.org
Would you go from your place by train or should I pick you up from work? What do you think?"
sleep 2
notify-send "English bubble" "The quick brown fox jumps over the lazy dog." -i network
sleep 2
notify-send "Bubble from Germany" "Polyfon zwitschernd aßen Mäxchens Vögel Rüben, Joghurt und Quark." -i gnome-system
sleep 2
notify-send "Very russian" "Съешь ещё этих мягких французских булок, да выпей чаю." -i dialog-info
sleep 2
notify-send "More from Germany" "Oje, Qualm verwölkt Dix zig Farbtriptychons." -i gnome-globe
sleep 2
notify-send "Filter the world 1/3" "<a href=\"http://www.ubuntu.com/\">Ubuntu</a>
Don't rock the boat
Kick him while he&apos;s down
\"Film spectators are quiet vampires.\"
Peace &amp; Love
War & Peace
Law &#38; Order
Love &#x26; War
7 > 3
7 &gt; 3"
sleep 2
notify-send "Filter the world 2/3" "7 &#62; 3
7 &#x3e; 3
14 < 42
14 &lt; 42
14 &#60; 42
14 &#x3c; 42
><
<>
< this is not a tag >
<i>Not italic</i>"
sleep 2
notify-send "Filter the world 3/3" "<b>So broken</i>
<img src=\"foobar.png\" />Nothing to see
<u>Test</u>
<b>Bold</b>
<span>Span</span>
<s>E-flat</s>
<sub>Sandwich</sub>
<small>Fry</small>
<tt>Testing tag</tt>"

29
scripts/notify_sound.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
volume=$(amixer sget Master | grep % | cut -f 7 -d " " | grep "[0-9]*" -o | head -1)
muted=$(amixer sget Master | grep % | cut -f 8 -d " " | head -1 | grep "off" -o)
echo $volume
if [ $muted == "off" ]
then
notify-send " " -i notification-audio-volume-muted -h int:value:0 -h string:x-canonical-private-synchronous:audio
exit
fi
if [ $volume -eq 0 ]
then
status="notification-audio-volume-muted"
elif [ $volume -lt 20 ]
then
status="notification-audio-volume-off"
elif [ $volume -lt "50" ]
then
status="notification-audio-volume-low"
elif [ $volume -lt "80" ]
then
status="notification-audio-volume-medium"
else
status="notification-audio-volume-high"
fi
notify-send " " -i $status -h int:value:$volume -h string:x-canonical-private-synchronous:audio

View File

@ -0,0 +1,99 @@
#!/bin/bash
# CHANGELOG
# [Quentin PÂRIS] (2012-05-05 14-45)
# Wine version set to 1.5.3, Outlook 2010 compatiblity
# [Quentin PÂRIS] (2012-05-05 15-05)
# Check winbind presence on Linux, required to install
# Adding gettext support
# [Quentin PÂRIS] (2012-05-12 18-36)
# Requires 4.0.18
# [SuperPlumus] (2013-06-09 14-44)
# gettext
# [Quentin PÂRIS] (2014-07-21 17-09)
# Updating with the latest WineHQ version
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
PREFIX="Office2010"
WINEVERSION="2.12"
TITLE="Microsoft Office 2010"
POL_GetSetupImages "http://files.playonlinux.com/resources/setups/Office/top.jpg" "http://files.playonlinux.com/resources/setups/Office/left.png" "$TITLE"
POL_SetupWindow_Init
POL_SetupWindow_SetID 801
POL_SetupWindow_presentation "$TITLE" "Microsoft" "http://www.microsoft.com" "Quentin PÂRIS" "$PREFIX"
POL_RequiredVersion 4.0.18 || POL_Debug_Fatal "$TITLE won't work with $APPLICATION_TITLE $VERSION\nPlease update"
if [ "$POL_OS" = "Linux" ]; then
wbinfo -V || POL_Debug_Fatal "Please install winbind before installing $TITLE"
fi
POL_Debug_Init
POL_System_SetArch "x86"
POL_SetupWindow_InstallMethod "LOCAL,DVD"
if [ "$INSTALL_METHOD" = "DVD" ]; then
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "x86/setup.exe" "setup.exe"
SetupIs="$CDROM_SETUP"
cd "$CDROM"
else
POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE"
SetupIs="$APP_ANSWER"
fi
POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WINEVERSION"
if [ "$POL_OS" = "Mac" ]; then
# Samba support
POL_Call POL_GetTool_samba3
source "$POL_USER_ROOT/tools/samba3/init"
fi
POL_Wine_WaitBefore "$TITLE"
[ "$CDROM" ] && cd "$CDROM"
if [ ! "$(file $SetupIs | grep 'x86-64')" = "" ]; then
POL_Debug_Fatal "$(eval_gettext "The 64bits version is not compatible! Sorry")";
fi
POL_Wine "$SetupIs"
POL_Wine_WaitExit "$TITLE"
# See http://forum.winehq.org/viewtopic.php?f=8&t=23126&p=95555#p95555
POL_Wine_OverrideDLL "native,builtin" "riched20"
# Fix a crash when loading a file
POL_Call POL_Install_msxml6
POL_Shortcut "WINWORD.EXE" "Microsoft Word 2010" "" "" "Office;WordProcessor;"
POL_Shortcut "EXCEL.EXE" "Microsoft Excel 2010" "" "" "Office;Spreadsheet;"
POL_Shortcut "POWERPNT.EXE" "Microsoft Powerpoint 2010" "" "" "Office;Presentation;"
POL_Shortcut "ONENOTE.EXE" "Microsoft OneNote 2010" "" "" "Network;InstantMessaging;" # No category for collaborative work?
POL_Shortcut "OUTLOOK.EXE" "Microsoft Outlook 2010" "" "" "Network;Email;" # Calendar;ContactManagement; ? :p
POL_Extension_Write doc "Microsoft Word 2010"
POL_Extension_Write docx "Microsoft Word 2010"
POL_Extension_Write xls "Microsoft Excel 2010"
POL_Extension_Write xlsx "Microsoft Excel 2010"
POL_Extension_Write ppt "Microsoft Powerpoint 2010"
POL_Extension_Write pptx "Microsoft Powerpoint 2010"
if [ "$POL_OS" = "Mac" ]; then
POL_Shortcut_InsertBeforeWine "Microsoft Word 2010" "source \"$POL_USER_ROOT/tools/samba3/init\""
POL_Shortcut_InsertBeforeWine "Microsoft Excel 2010" "source \"$POL_USER_ROOT/tools/samba3/init\""
POL_Shortcut_InsertBeforeWine "Microsoft Powerpoint 2010" "source \"$POL_USER_ROOT/tools/samba3/init\""
POL_Shortcut_InsertBeforeWine "Microsoft OneNote 2010" "source \"$POL_USER_ROOT/tools/samba3/init\""
POL_Shortcut_InsertBeforeWine "Microsoft Outlook 2010" "source \"$POL_USER_ROOT/tools/samba3/init\""
fi
POL_SetupWindow_message "$(eval_gettext '$TITLE has been installed successfully\n\nIf an installation Windows prevent your programs from running, you must remove and reinstall $TITLE')" "$TITLE"
POL_SetupWindow_Close
exit

10
scripts/toggle_monitor.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
left=HDMI-0
right=DVI-I-3
#if xrandr | grep "$right disconnected"; then
if ! xrandr --listmonitors | grep "$right"; then
xrandr --output "$right" --primary --auto --output "$left" --left-of "$right" --auto
else
xrandr --output "$right" --off --output "$left" --auto
fi

View File

@ -0,0 +1,6 @@
#!/bin/bash
device=$(xinput | grep Touchpad | grep -o "id=[0-9]*" | cut -f 2 -d "=")
prop=$(xinput list-props $device | grep "Tapping Enabled" | head -n 1 | grep -o "([0-9]*)" | grep -o "[0-9]*")
xinput set-prop $device $prop 1

44
scripts/tunes.sh Executable file
View File

@ -0,0 +1,44 @@
#!/bin/bash
# https://community.spotify.com/t5/Help-Desktop-Linux-Windows-Web/Conky-Spotify-quot-Now-Playing-quot-scripts/m-p/812541#M88825
SYMBOL="♫ "
ARTIST="$(dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 2 "artist"|egrep -v "artist"|egrep -v "array"|cut -b 27-|cut -d '"' -f 1|egrep -v ^$)"
TITLE="$(dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 1 "title"|egrep -v "title"|cut -b 44-|cut -d '"' -f 1|egrep -v ^$)"
#TIME="$(dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 2 "time"|cut -d " " -f 3|cut -c 6-)"
#if [ ! -f "/tmp/tunes_time" ] ; then
# TIME_OLD=0
#else
# TIME_OLD=$(cat /tmp/tunes_time)
#fi
#
#if [ $TIME == $TIME_OLD ]
# then
# exit 0
#fi
#echo "$TIME" > /tmp/tunes_time
if [ -n "$ARTIST" ]
then
index=$(expr index "$ARTIST" -)
if [ $index -gt 0 ]
then
length=$((${#ARTIST} - $index + 2))
ARTIST=${ttest::-$length}
fi
OUTPUT="$SYMBOL $ARTIST - $TITLE"
if [ ${#OUTPUT} -gt 35 ]
then
OUTPUT="$SYMBOL $TITLE"
fi
else
OUTPUT=""
fi
echo "$OUTPUT"