diff options
author | Julian T <julian@jtle.dk> | 2019-11-19 21:06:33 +0100 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2019-11-19 21:06:40 +0100 |
commit | f0ac6c36a9b11ace64fe07c614942b2b056ee450 (patch) | |
tree | bd8e035ee5ccf91afb0d7e85e44961eeabdce909 /scripts/Scripts | |
parent | f73c79bb22bba63b1a555388c1fb13a5c98bfbc0 (diff) |
Moved lc script
Diffstat (limited to 'scripts/Scripts')
-rwxr-xr-x | scripts/Scripts/lc | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/scripts/Scripts/lc b/scripts/Scripts/lc new file mode 100755 index 0000000..f54980c --- /dev/null +++ b/scripts/Scripts/lc @@ -0,0 +1,100 @@ +#!/bin/bash + +LOGFILE=.lc.log + +Commands="common update poweroff suspend set-keyboard caps-lock battery cups-website vim emacs htop scrot overleaf-render overleaf win pass wall stat mic mail" +statScripts="ram.sh status.sh net.sh mic.sh" + +handle_stuff() { + if [ "$1" = "--dmenu" ]; then + $0 $(echo $Commands | tr " " "\n" | dmenu -i -p ":") + fi + + if [ "$1" = "edit" ] || [ "$1" = "e" ]; then + notify-send "$*" + st -e nvim $(echo $* | cut -d" " -f2-) + fi + +# System info + if [ "$1" = "b" ] || [ "$1" = "battery" ]; then + notify-send "Battery information" "$(acpi | grep 1:)" + fi + +# System maintenance + if [ "$1" = "sk" ] || [ "$1" = "set-keyboard" ]; then + setxkbmap -layout us -variant altgr-intl + xcape -e "Control_R=Escape" + xmodmap .Xmodmap + fi + +# POWER COMMANDS + if [ "$1" = "s" ] || [ "$1" = "suspend" ]; then + systemctl suspend + fi + if [ "$1" = "poweroff" ]; then + poweroff + fi + +# Mics + if [ "$1" = "p" ] || [ "$1" = "scrot" ]; then + scrot /tmp/%Y-%m-%d-%T-screenshot.png + fi + + if [ "$1" = "overleaf-render" ]; then + st sh ~/Documents/overleafRenderer/compile.sh + fi + + if [ "$1" = "caps-lock" ] || [ "$1" = "cl" ]; then + xdotool key Caps_Lock + fi + + if [ "$1" = "win" ]; then + vboxmanage startvm "Windows xp" + fi + if [ "$1" = "wall" ]; then + feh --bg-tile Pictures/defaultWall.* + fi + if [ "$1" = "mic" ]; then + amixer set Capture toggle + fi + if [ "$1" = "mail" ]; then + Scripts/mailSync + dunstify "Mail" "$(notmuch count tag:unread and tag:inbox) unread mail" + fi + +# Launch + if [ "$1" = "vi" ] || [ "$1" = "vim" ]; then + st -e nvim + fi + if [ "$1" = "emacs" ]; then + st -e emacs + fi + if [ "$1" = "ht" ] || [ "$1" = "htop" ]; then + st -e htop + fi + if [ "$1" = "cups" ] || [ "$1" = "cups-website" ]; then + firefox "http://localhost:631/" + fi + if [ "$1" = "overleaf" ]; then + firefox -p Sharelatex --no-remote + fi + if [ "$1" = "pass" ]; then + bash $HOME/Scripts/passmenu --type + fi + + if [ "$1" = "stat" ]; then + sh /home/julian/Scripts/$(echo $statScripts | tr " " "\n" | dmenu -i -p "stat") + fi + if [ "$1" = "common" ]; then + python Scripts/commondocs.py ~/commondocs.json $(python Scripts/commondocs.py ~/commondocs.json | dmenu) + fi + +# Calc + if [ "$(echo $1 | head -c 1)" = "=" ]; then + calc="$(echo $1 | cut -c 2-)" + notify-send "Result" "$calc = $(echo $calc | bc)" + fi +} + + +handle_stuff $* 2>&1 | tee -a $LOGFILE |