From 0a5a7a95a8d65b27acf85f5d801ebabc04817716 Mon Sep 17 00:00:00 2001 From: vibikim Date: Sat, 1 Aug 2020 22:13:25 +0300 Subject: [PATCH] moving forward --- bspwm/display.sh | 12 ++++++++++++ bspwm/power.sh | 29 +++++++++++++++++++++++++++++ bspwm/wacom.sh | 12 ++++++++++++ 3 files changed, 53 insertions(+) create mode 100755 bspwm/display.sh create mode 100755 bspwm/power.sh create mode 100755 bspwm/wacom.sh diff --git a/bspwm/display.sh b/bspwm/display.sh new file mode 100755 index 0000000..8b9c4e2 --- /dev/null +++ b/bspwm/display.sh @@ -0,0 +1,12 @@ +#!/bin/dash + +choices="arandr\nLVDS_off\ndual\nLVDS_on" + +chosen=$(echo "$choices" | dmenu -i) + +case "$chosen" in + arandr) arandr ;; + LVDS_off) xrandr --output LVDS-1-1 --off & ;; + dual) xrandr --output DP-4 --auto --output LVDS-1-1 --right-of DP-4 ;; + LVDS_on) xrandr --output LVDS-1-1 --auto ;; +esac diff --git a/bspwm/power.sh b/bspwm/power.sh new file mode 100755 index 0000000..e45084e --- /dev/null +++ b/bspwm/power.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +sure() { + options="Yes + No" + + chosen=`echo "$options" | dmenu -i -p "Are you sure?" -sb red -sf black` + case "$chosen" in + Yes) exec $1 ;; + No) exit ;; + esac + } +options="shutdown +reboot +hibernate +sleep" + +chosen=`echo "$options" | dmenu -i` + +case "$chosen" in + shutdown) + sure "systemctl poweroff" ;; + reboot) + sure "systemctl reboot" ;; + hibernate) + sure "systemctl hibernate" ;; + sleep) + systemctl suspend ;; +esac diff --git a/bspwm/wacom.sh b/bspwm/wacom.sh new file mode 100755 index 0000000..daefb96 --- /dev/null +++ b/bspwm/wacom.sh @@ -0,0 +1,12 @@ +#!/bin/sh +#TODO option to get existing area and shrink it + +choices="4:3\nMain screen\nSecond screen" + +chosen=$(echo -e "$choices" | dmenu -i) + +case "$chosen" in + 4:3) xsetwacom set "Wacom Intuos S 2 Pen stylus" Area 0 0 11400 8550 ;; + Main screen) xsetwacom set "Wacom Intuos S 2 Pen stylus" MapToOutput HEAD-0 ;; + second screen) xsetwacom set "Wacom Intuos S 2 Pen stylus" MapToOutput HEAD-1 ;; +esac