From a0d2ace1f2191fa770bd7575c020b3ec0d55af0c Mon Sep 17 00:00:00 2001 From: CoolnsX Date: Thu, 1 Jul 2021 21:23:58 +0530 Subject: [PATCH] added scripts --- bluetooth | 19 +++++++++++++++++++ launch.sh | 17 +++++++++++++++++ pi.sh | 13 +++++++++++++ screenlock.sh | 8 ++++++++ startup.sh | 7 +++++++ wifi | 9 +++++++++ 6 files changed, 73 insertions(+) create mode 100755 bluetooth create mode 100755 launch.sh create mode 100755 pi.sh create mode 100755 screenlock.sh create mode 100755 startup.sh create mode 100755 wifi diff --git a/bluetooth b/bluetooth new file mode 100755 index 0000000..7c4ac39 --- /dev/null +++ b/bluetooth @@ -0,0 +1,19 @@ +#!/bin/bash +if rfkill list bluetooth | grep -q 'yes$' ; then + sudo rfkill unblock 1 + sudo rfkill unblock bluetooth + notify-send "bluetooth on" + sleep 3 + notify-send "bluetooth connecting" + bluetoothctl power on + sleep 1 + bluetoothctl connect FC:58:FA:C8:40:46 + notify-send "bluetooth connected : Infinity Glide 120" +else + bluetoothctl disconnect FC:58:FA:C8:40:46 + notify-send "bluetooth disconnected : Infinity Glide 120" + sleep 1 + bluetoothctl power off + sudo rfkill block 1 + notify-send "bluetooth off" +fi diff --git a/launch.sh b/launch.sh new file mode 100755 index 0000000..e6528ad --- /dev/null +++ b/launch.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env sh + +# Terminate already running bar instances +killall -q polybar + +# custom script +rm $HOME/wallpapers/x.png +conky -c "/home/tanveer/.conky/Rock and Roll/Rock/Hermoso_Rc" & +conky -c "/home/tanveer/.conky/Rock and Roll/Rock 1/.conkyrc" & +sleep 2 +maim --hidecursor -d 1 $HOME/wallpapers/x.png #screenshot of wallpaper with conky running +killall -q conky & +xwallpaper --stretch $HOME/wallpapers/x.png & #apply that screenshot as wallpaper + +# Launch polybar +polybar example & + diff --git a/pi.sh b/pi.sh new file mode 100755 index 0000000..e4259d8 --- /dev/null +++ b/pi.sh @@ -0,0 +1,13 @@ +#!/bin/bash +if ps aux | grep "picom$" ; then + killall -q picom + sleep 1 + notify-send "picom vsync on" + picom --vsync & +else + killall -q picom + sleep 1 + picom & + notify-send "picom vsync off" +fi + diff --git a/screenlock.sh b/screenlock.sh new file mode 100755 index 0000000..efa9f98 --- /dev/null +++ b/screenlock.sh @@ -0,0 +1,8 @@ +#!/bin/sh + revert() { + xset dpms 0 0 0 + } + trap revert HUP INT TERM + xset +dpms dpms 5 5 5 + slock + revert diff --git a/startup.sh b/startup.sh new file mode 100755 index 0000000..ee88be4 --- /dev/null +++ b/startup.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env sh + +sleep 5 +synclient TapButton1=1 +synclient HorizEdgeScroll=1 +synclient RBCornerButton=3 + diff --git a/wifi b/wifi new file mode 100755 index 0000000..81d9aa3 --- /dev/null +++ b/wifi @@ -0,0 +1,9 @@ +#!/bin/bash +if rfkill list wifi | grep -q 'yes$' ; then + sudo rfkill unblock 0 + notify-send "wifi on" +else + sudo rfkill block 0 + notify-send "wifi off" +fi +