toggle script & .local/bin support

This commit is contained in:
Cheri 2021-02-13 14:49:36 +02:00 committed by vibikim
parent 38e7cddb84
commit 79f275dfcd
6 changed files with 70 additions and 22 deletions

18
bin/dmenukaomoji Executable file
View file

@ -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

9
bin/toggle Executable file
View file

@ -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

View file

@ -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'

View file

@ -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

View file

@ -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

View file

@ -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