summaryrefslogtreecommitdiff
path: root/dwm/lc
diff options
context:
space:
mode:
authorjulian T <julian@jtle.dk>2019-02-02 17:23:53 +0100
committerjulian T <julian@jtle.dk>2019-02-02 17:23:53 +0100
commit489aeecfdd9d8938669e25961f43df287c4e9bcd (patch)
treeb2560dde94fb1b9a5e851ab82e0d609fdd9304a2 /dwm/lc
parentadc0806cdda2673910483a4266265eb9103da1c8 (diff)
Moved to stow
Diffstat (limited to 'dwm/lc')
-rwxr-xr-xdwm/lc81
1 files changed, 81 insertions, 0 deletions
diff --git a/dwm/lc b/dwm/lc
new file mode 100755
index 0000000..9691d45
--- /dev/null
+++ b/dwm/lc
@@ -0,0 +1,81 @@
+#!/bin/bash
+
+Menu="Program Info System File"
+System="update poweroff syspend set-keyboard"
+Info="battery"
+Program="cups-website vim emacs htop"
+Commonfiles=".vimrc .zshrc"
+All="$System $Info $Program"
+
+handle_stuff() {
+
+# Dmemu listing
+ if [ "$1" = "--list" ]; then
+ printf "Program\nInfo\nSystem"
+ fi
+ if [ "$1" = "--dmenu" ]; then
+ ./lc $(echo $Menu $All | tr " " "\n" | dmenu -i -p Launch)
+ fi
+ if [ "$1" = "System" ]; then
+ ./lc $(echo $System | tr " " "\n" | dmenu -i -p Launch)
+ fi
+ if [ "$1" = "Info" ]; then
+ ./lc $(echo $Info | tr " " "\n" | dmenu -i -p Launch)
+ fi
+ if [ "$1" = "Program" ]; then
+ ./lc $(echo $Program | tr " " "\n" | dmenu -i -p Launch)
+ fi
+ if [ "$1" = "File" ]; then
+ st -e nvim $(echo $Commonfiles | tr " " "\n" | dmenu -i -p Launch)
+ fi
+
+# System info
+ if [ "$1" = "-b" ] || [ "$1" = "battery" ]; then
+ notify-send "Battery information" "$(acpi | grep 1:)"
+ fi
+
+# System maintenance
+ if [ "$1" = "-u" ] || [ "$1" = "update" ]; then
+ st -e sudo pacman -Syu
+ fi
+ if [ "$1" = "--xk" ] || [ "$1" = "set-keyboard" ]; then
+ setxkbmap -layout us -variant altgr-intl
+ xmodmap .Xmodmap
+ fi
+
+# POWER COMMANDS
+ if [ "$1" = "-s" ] || [ "$1" = "suspend" ]; then
+ systemctl suspend
+ fi
+ if [ "$1" = "-p" ] || [ "$1" = "poweroff" ]; then
+ poweroff
+ fi
+
+# Mics
+
+# Launch
+ if [ "$1" = "-v" ] || [ "$1" = "vim" ]; then
+ st -e nvim
+ fi
+ if [ "$1" = "--emacs" ] || [ "$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
+
+# Calc
+ if [ "$(echo $1 | head -c 1)" = "=" ]; then
+ calc="$(echo $1 | cut -c 2-)"
+ notify-send "Result" "$calc = $(echo $calc | bc)"
+ fi
+}
+
+
+for var in "$@"
+do
+ handle_stuff "$var" &
+done