From 1ff834e2b06761b083df9959d6c3d6bd2a94d2de Mon Sep 17 00:00:00 2001 From: Shubham Saini Date: Tue, 1 Dec 2020 20:21:04 +0000 Subject: mah thinkpad --- bin/.local/bin/bat_check.sh | 14 -------------- bin/.local/bin/dotstow | 21 --------------------- bin/.local/bin/gitit | 10 ---------- bin/.local/bin/light | 19 ------------------- bin/.local/bin/lock | 6 ------ bin/.local/bin/record | 10 ---------- bin/.local/bin/screenshot | 16 ---------------- bin/.local/bin/shut | 11 ----------- bin/.local/bin/statusbar | 45 --------------------------------------------- bin/.local/bin/temp | 2 -- bin/.local/bin/unblock | 8 -------- 11 files changed, 162 deletions(-) delete mode 100755 bin/.local/bin/bat_check.sh delete mode 100755 bin/.local/bin/dotstow delete mode 100755 bin/.local/bin/gitit delete mode 100755 bin/.local/bin/light delete mode 100755 bin/.local/bin/lock delete mode 100755 bin/.local/bin/record delete mode 100755 bin/.local/bin/screenshot delete mode 100755 bin/.local/bin/shut delete mode 100755 bin/.local/bin/statusbar delete mode 100755 bin/.local/bin/temp delete mode 100755 bin/.local/bin/unblock (limited to 'bin/.local') diff --git a/bin/.local/bin/bat_check.sh b/bin/.local/bin/bat_check.sh deleted file mode 100755 index 547b976..0000000 --- a/bin/.local/bin/bat_check.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -while true -do - battery_level=$(cat /sys/class/power_supply/BAT0/capacity) - state=$(cat /sys/class/power_supply/BAT0/status) - if [ $battery_level -ge 90 ] && [ $state == "Charging" ]; then - notify-send 'Pull the plug!' $battery_level% - elif [ $battery_level -le 30 -a $battery_level -ge 20 ] && [ $state == "Discharging" ]; then - notify-send 'Plug me!' $battery_level% - elif [ $battery_level -le 20 ] && [ $state == "Discharging" ]; then - notify-send -u critical 'Plug me NOW!' $battery_level% - fi - sleep 300 # 300 seconds or 5 minutes -done diff --git a/bin/.local/bin/dotstow b/bin/.local/bin/dotstow deleted file mode 100755 index bcadc5e..0000000 --- a/bin/.local/bin/dotstow +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# This script will Stow all the dotfiles located in the ~/dotfiles folder. -# The -R flag is used to force a 'restow' which will remove any existing symlinks before attempting to Stow. - -echo "Stowing Dotfiles..."; - -cd ~/dotfiles -for file in ~/dotfiles/*; do - # Only run Stow on the directories in the dotfiles folder and not the individual files. - # Using 'basename' strips the filepath from the directory name. - if [ -d ${file} ]; then - stow -R $(basename $file) - echo "$(basename $file) stowed."; - fi -done - -# Return back to the your PWD from before you ran the script -cd ~- - -echo 'All stowed'; diff --git a/bin/.local/bin/gitit b/bin/.local/bin/gitit deleted file mode 100755 index 5d576c2..0000000 --- a/bin/.local/bin/gitit +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -set -e -printf "\033[0;32mDeploying updates to server...\033[0m\n" -git add . -msg="changes" -if [ -n "$*" ]; then - msg="$*" -fi -git commit -m "$msg" -git push origin master diff --git a/bin/.local/bin/light b/bin/.local/bin/light deleted file mode 100755 index b34150f..0000000 --- a/bin/.local/bin/light +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# brightness wrapper - -case "$1" in - u*) - for f in /sys/class/backlight/*; do - echo $(($(<$f/brightness)+5*$(<$f/max_brightness)/100)) > $f/brightness; - done - ;; - d*) - for f in /sys/class/backlight/*; do - echo $(($(<$f/brightness)-5*$(<$f/max_brightness)/100)) > $f/brightness; - done - ;; - *) - echo "choose u or d" - ;; -esac - diff --git a/bin/.local/bin/lock b/bin/.local/bin/lock deleted file mode 100755 index d7dc632..0000000 --- a/bin/.local/bin/lock +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -scrot /tmp/screen.png -convert /tmp/screen.png -scale 10% -scale 1000% /tmp/screen.png -[[ -f $1 ]] && convert /tmp/screen.png $1 -gravity center -composite -matte /tmp/screen.png -i3lock -u -i /tmp/screen.png -rm /tmp/screen.png diff --git a/bin/.local/bin/record b/bin/.local/bin/record deleted file mode 100755 index f254e20..0000000 --- a/bin/.local/bin/record +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -ffmpeg -f x11grab \ --s 1366x768 \ --an -i :0.0 \ --c:v libvpx \ --b:v 5M \ --crf 10 \ --quality realtime \ --y ~/record.mkv diff --git a/bin/.local/bin/screenshot b/bin/.local/bin/screenshot deleted file mode 100755 index 56310fc..0000000 --- a/bin/.local/bin/screenshot +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -screenshot() { - case $1 in - f*) - scrot -m -e 'mv $f ~/scrots' - ;; - w*) - sleep 1 - scrot -s -e 'mv $f ~/scrots' - ;; - *) - ;; - esac; -} - -screenshot $1 diff --git a/bin/.local/bin/shut b/bin/.local/bin/shut deleted file mode 100755 index 1fb1295..0000000 --- a/bin/.local/bin/shut +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -RET=$(echo -e "shutdown\nreboot\nsleep\nlock\ncancel" | dmenu -l 5 -p "Sayonara" -nb "#000000" -nf "#bfbfbf" -sb "#84a0c6" -sf "#000000" -fn "Hermit:size=10:antialias=true:autohint=true") - -case $RET in - shutdown) doas poweroff ;; - reboot) doas reboot ;; - sleep) xset s activate & doas zzz;; - lock) xset s activate ;; - *) ;; -esac diff --git a/bin/.local/bin/statusbar b/bin/.local/bin/statusbar deleted file mode 100755 index c506244..0000000 --- a/bin/.local/bin/statusbar +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -# Color definitions. -export BLK="\e[30m" -export RED="\e[31m" -export GRN="\e[32m" -export YLW="\e[33m" -export BLU="\e[34m" -export PUR="\e[35m" -export CYN="\e[36m" -export RST="\e[0m" - -# Other formatting. -export BLD="\e[1m" -export DIM="\e[2m" -export ITA="\e[3m" -export UND="\e[4m" -export FLS="\e[5m" -export REV="\e[7m" -export INV="\e[8m" -export STR="\e[9m" - -vol(){ - vol=$(pulsemixer --get-volume | awk '{print $1}') - echo -e "vol $vol%" -} - -bat() { - power=$(cat /sys/class/power_supply/BAT0/capacity) - echo -e "bat $power%" -} - -dte() { - dte=$(date +"%A, %B %d") - echo -e "date $dte" -} - -tie() { - tme=$(date +"%I:%M %p") - echo -e "time $tme" -} -while :; do - echo "$(vol) $(bat) $(tie) $(dte)" - sleep 2 -done diff --git a/bin/.local/bin/temp b/bin/.local/bin/temp deleted file mode 100755 index fec8439..0000000 --- a/bin/.local/bin/temp +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -paste <(cat /sys/class/thermal/thermal_zone*/type) <(cat /sys/class/thermal/thermal_zone*/temp) | column -s $'\t' -t | sed 's/\(.\)..$/.\1°C/' diff --git a/bin/.local/bin/unblock b/bin/.local/bin/unblock deleted file mode 100755 index 257c4fb..0000000 --- a/bin/.local/bin/unblock +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -#whitelist escape -set -e -printf "\033[0;35mSetting wlo1 down....\033[0m\n" -sudo ip link set wlo1 down -printf "\033[0;36mChanging MAC address....\033[0m\n" -sudo macchanger --mac=FC:77:74:C7:71:71 wlo1 -printf "\033[0;32mEnjoy....\033[0m\n" -- cgit v1.2.3