From 30c35bcc08e030aceee325b72d4a3b5c62d19cf9 Mon Sep 17 00:00:00 2001 From: Julian T Date: Wed, 12 Jun 2019 21:37:28 +0200 Subject: Moved, added and deleted scripts. Zsh corrections --- dwm/Scripts/lc | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++ dwm/Scripts/runStat.sh | 6 ++++ dwm/lc | 91 -------------------------------------------------- 3 files changed, 97 insertions(+), 91 deletions(-) create mode 100755 dwm/Scripts/lc create mode 100644 dwm/Scripts/runStat.sh delete mode 100755 dwm/lc (limited to 'dwm') diff --git a/dwm/Scripts/lc b/dwm/Scripts/lc new file mode 100755 index 0000000..9c21fb4 --- /dev/null +++ b/dwm/Scripts/lc @@ -0,0 +1,91 @@ +#!/bin/bash + +Commands="update poweroff suspend set-keyboard caps-lock battery cups-website vim emacs htop scrot overleaf-render overleaf win pass wall stat mic" +statScripts="ram.sh status.sh net.sh mic.sh" + +handle_stuff() { + if [ "$1" = "--dmenu" ]; then + ./lc $(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 + +# 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 ~/Scripts/passmenu --type + fi + + if [ "$1" = "stat" ]; then + sh /home/julian/Scripts/$(echo $statScripts | tr " " "\n" | dmenu -i -p "stat") + 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 $* & diff --git a/dwm/Scripts/runStat.sh b/dwm/Scripts/runStat.sh new file mode 100644 index 0000000..52b0536 --- /dev/null +++ b/dwm/Scripts/runStat.sh @@ -0,0 +1,6 @@ +elements="ram.sh status.sh mic.sh" + +if [ $1 = "dmenu" ]; then + sh $(echo $elements | tr " " "\n" | dmenu -i -p ":") +fi + diff --git a/dwm/lc b/dwm/lc deleted file mode 100755 index 9c21fb4..0000000 --- a/dwm/lc +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash - -Commands="update poweroff suspend set-keyboard caps-lock battery cups-website vim emacs htop scrot overleaf-render overleaf win pass wall stat mic" -statScripts="ram.sh status.sh net.sh mic.sh" - -handle_stuff() { - if [ "$1" = "--dmenu" ]; then - ./lc $(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 - -# 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 ~/Scripts/passmenu --type - fi - - if [ "$1" = "stat" ]; then - sh /home/julian/Scripts/$(echo $statScripts | tr " " "\n" | dmenu -i -p "stat") - 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 $* & -- cgit v1.2.3