mabox-colorizer/bin/randomizer

105 lines
2.6 KiB
Plaintext
Raw Normal View History

2022-12-19 22:22:23 +01:00
#!/bin/bash
# randomizer
ob () {
obtctl randomizer
}
menu () {
mb-setvar jgmenu_theme=$(basename -s .colorrc $(ls ~/.config/mabox/jgobthemes/*.colorrc | shuf -n 1))
case "$1" in
show) colorizer-menus -s;;
*):;;
esac
}
conky () {
#set random saved colorscheme
COLORIZERDIR="$HOME/.config/colorizer"
CONKYTHEMEDIR="$COLORIZERDIR/conky/themes"
if [ ! -d "$CONKYTHEMEDIR" ];then
mkdir -p "$CONKYTHEMEDIR"
rsync -a /usr/share/mabox-colorizer/themes/conky/* ${CONKYTHEMEDIR}/
fi
RAND_FILENAME=$(ls ~/.config/colorizer/conky/themes/*.colors|shuf -n 1)
RAND_THEME=${RAND_FILENAME##*/}
#notify-send.sh "$RAND_THEME"
conkyctl settheme_all ${RAND_THEME}
}
wp () {
: # Może niepotrzebne tu
}
all () {
ob
conky
2022-12-25 19:48:00 +01:00
[[ "$1" == "show" ]] && menu show || menu
2022-12-19 22:22:23 +01:00
}
resetall () {
conkyctl resetcolorsall
obtctl resetMBcolors
2022-12-25 19:48:00 +01:00
[[ "$1" == "show" ]] && jgctl resetMBcolors show || jgctl resetMBcolors
2022-12-19 22:22:23 +01:00
}
pipemenu () {
me=""
[[ "$1" == "l" ]] && me="mb-jgtools places"
[[ "$1" == "c" ]] && me="colorizer -s"
#notify-send.sh "Me $me"
case "$LANG" in
pl*)
SETRANDOM="Ustaw losowy motyw dla..."
MENUS="Menu i Panele boczne"
OBWD="Dekoracja okien Openbox"
ALL="Wszystko"
RESET_TO_DEFAULT="Resetuj do ustawień domyślnych..."
HELP="Okno Główne i Pomoc"
;;
es*)
SETRANDOM="Set random colorscheme for..."
2022-12-20 09:46:47 +01:00
MENUS="Menus and Panels"
2022-12-19 22:22:23 +01:00
OBWD="OpenBox Window Decoration"
ALL="All"
RESET_TO_DEFAULT="Reset to default settings..."
HELP="Main Window and Help"
;;
en*)
SETRANDOM="Set random colorscheme for..."
2022-12-20 09:46:47 +01:00
MENUS="Menus and Panels"
2022-12-19 22:22:23 +01:00
OBWD="OpenBox Window Decoration"
2022-12-20 09:46:47 +01:00
ALL="All above"
2022-12-19 22:22:23 +01:00
RESET_TO_DEFAULT="Reset to default settings..."
HELP="Main Window and Help"
;;
esac
out+=("^sep($SETRANDOM)")
out+=("$MENUS,randomizer menu;$me")
out+=("$OBWD,randomizer ob;$me")
out+=("Conky,randomizer conky;$me")
out+=("^sep()")
out+=("$ALL,randomizer all;$me")
out+=("^sep($RESET_TO_DEFAULT)")
out+=("$MENUS,jgctl resetMBcolors;$me")
out+=("$OBWD,obtctl resetMBcolors;$me")
out+=("Conky,conkyctl resetcolorsall;$me")
out+=("^sep()")
out+=("$ALL,randomizer resetall;$me")
out+=("^sep(Colorizer)")
out+=("Colorizer - $HELP,ycolorizer")
printf '%s\n' "${out[@]}"
}
case "$1" in
ob) ob;;
menu) menu "${2}";;
conky) conky;;
wp) wp;;
2022-12-25 19:48:00 +01:00
all) all "$2";;
resetall)resetall "$2";;
2022-12-19 22:22:23 +01:00
l|c|*) pipemenu "$1";;
esac