From 4e2b136715b6c4736f6a54e5cd8f5061f9965704 Mon Sep 17 00:00:00 2001 From: vibikim Date: Sat, 13 Feb 2021 14:49:36 +0200 Subject: [PATCH] toggle script & .local/bin support --- bin/dmenukaomoji | 18 ++++++++++++++++++ bin/toggle | 9 +++++++++ bspwm/bspwmrc | 1 + bspwm/display.sh | 4 ++-- install.sh | 47 ++++++++++++++++++++++++++++++++--------------- sxhkd/sxhkdrc | 13 ++++++++----- 6 files changed, 70 insertions(+), 22 deletions(-) create mode 100755 bin/dmenukaomoji create mode 100755 bin/toggle diff --git a/bin/dmenukaomoji b/bin/dmenukaomoji new file mode 100755 index 0000000..55497ea --- /dev/null +++ b/bin/dmenukaomoji @@ -0,0 +1,18 @@ +#!/bin/sh + +# The famous "get a menu of kaomojis to copy" script. + +# Must have xclip installed to even show menu. +xclip -h 2>/dev/null || exit 1 + +chosen=$(dmenu -i -l 20 < ~/.local/share/kaomoji | sed "s/ .*//") + +[ "$chosen" != "" ] || exit + +# If you run this command with an argument, it will automatically insert the character. +if [ -n "$1" ]; then + xdotool key Shift+Insert +else + echo "$chosen" | tr -d '\n' | xclip -selection clipboard + notify-send "'$chosen' copied to clipboard." & +fi diff --git a/bin/toggle b/bin/toggle new file mode 100755 index 0000000..b75fef8 --- /dev/null +++ b/bin/toggle @@ -0,0 +1,9 @@ +#!/bin/sh + +if [ -z "`pgrep -x $1`" ]; then + $@ & + notify-send $1 "is now enabled" +else + notify-send $1 "is now disabled" + pkill $1 +fi diff --git a/bspwm/bspwmrc b/bspwm/bspwmrc index df1d7ce..1cdd059 100755 --- a/bspwm/bspwmrc +++ b/bspwm/bspwmrc @@ -99,6 +99,7 @@ bspc rule -a Blueman-manager state=floating bspc rule -a Arandr state=floating bspc rule -a Galculator state=floating bspc rule -a Nitrogen state=floating +bspc rule -a Emacs state=tiled bspc rule -a Screenkey manage=off bspc rule -a Navigator desktop='^1' bspc rule -a discord desktop='^4' diff --git a/bspwm/display.sh b/bspwm/display.sh index 188a919..cdc6dd3 100755 --- a/bspwm/display.sh +++ b/bspwm/display.sh @@ -1,12 +1,12 @@ #!/bin/dash -choices="arandr\nLVDS_off\ndual\nLVDS_on" +choices="arandr\nLVDS_off\nLVDS_on\ndual" 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 VGA-1-1 --right-of DP-4 ;; LVDS_on) xrandr --output LVDS-1-1 --auto ;; + dual) xrandr --output VGA-0 --mode 1024x768 --pos 1920x312 --rotate normal --output LVDS-0 --off --output DP-0 --off --output DP-1 --off --output DP-2 --off --output DP-3 --off --output DP-4 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DP-5 --off --output LVDS-1-1 --off --output VGA-1-1 --off ;; esac diff --git a/install.sh b/install.sh index a20b001..c330ec2 100755 --- a/install.sh +++ b/install.sh @@ -2,27 +2,44 @@ # run this function for files that go directily into the home directory gohome() { - ln -sf $PWD/$1 ~/ + ln -sfv $PWD/$1 ~/ } # run this function for files that go into the .config file goconfig() { - ln -sf $PWD/$1 ~/.config/ + ln -sfv $PWD/$1 ~/.config/ } +# run this function for files that go into the .local/bin file +gobin() { + ln -sfv $PWD/$1 ~/.local/bin/ +} -gohome .bashrc -gohome .profile -gohome .Xresources +echo "This script will make symbolic links to all the dotfiles." +echo "Be sure to be cd-ed in the directory where the dotfiles repo resides (where this script is located ofc)\n" +echo "Type \"y\" if you do so we can continue" +read choice -goconfig bspwm -goconfig dunst -goconfig polybar -goconfig sxhkd -goconfig picom.conf -goconfig nvim -goconfig lf -goconfig emacs +if [ "$choice" = "y" ] +then + gohome .bashrc + gohome .profile + gohome .Xresources + + goconfig bspwm + goconfig dunst + goconfig polybar + goconfig sxhkd + goconfig picom.conf + goconfig nvim + goconfig lf + goconfig emacs + + gobin bin/dmenukaomoji + gobin bin/toggle + + #install fonts + echo "Copying polybar fonts" + cp -ruv $PWD/polybar/fonts/* ~/.local/share/fonts +fi -#install fonts -cp -r $PWD/polybar/fonts/* ~/.local/share/fonts diff --git a/sxhkd/sxhkdrc b/sxhkd/sxhkdrc index ba41f7d..8ace282 100644 --- a/sxhkd/sxhkdrc +++ b/sxhkd/sxhkdrc @@ -1,6 +1,6 @@ #restart sxhkd super + alt + x - killall -q sxhkd && sleep 1 && sxhkd & + killall -q sxhkd && sleep 1 && sxhkd && notify-send "sxhkd restarted & ### # LAUNCH APPS ### @@ -34,6 +34,13 @@ super + shift + e $TERMINAL -e nvim -c Ex +# Toggle stuff + +super + ctrl + alt + s + toggle redshift -l 44:26 +super + ctrl + alt + p + toggle picom --experimental-backends + ### # MISC ### @@ -50,10 +57,6 @@ super + ctrl + k super + alt + c sleep 1; xset dpms force off -# Toggle redshift -super + alt + s - ~/.config/bspwm/toggleredshift.sh - # dmenu display selector super + p ~/.config/bspwm/display.sh