mabox-colorizer/bin/randomizer

110 lines
2.8 KiB
Plaintext
Raw Permalink 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 () {
2023-09-08 12:34:28 +02:00
LINES=$(tail -n +2 /usr/share/mabox-colorizer/colorschemes/conky.csv|wc -l)
N=$(( ( RANDOM % $LINES ) + 2 ))
#notify-send.sh "$LINES" "$N"
conkyctl applyscheme_all sys $N
2022-12-19 22:22:23 +01:00
}
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"
2023-05-10 23:50:21 +02:00
ALLRESET="Resetuj wszystko"
2022-12-19 22:22:23 +01:00
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"
2023-05-10 23:50:21 +02:00
ALL="All above"
ALLRESET="Reset All above"
2022-12-19 22:22:23 +01:00
RESET_TO_DEFAULT="Reset to default settings..."
HELP="Main Window and Help"
;;
2023-07-25 00:21:05 +02:00
*)
2022-12-19 22:22:23 +01:00
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"
2023-05-10 23:50:21 +02:00
ALLRESET="Reset 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()")
2023-05-10 23:50:21 +02:00
out+=(" $ALL,randomizer all;$me")
2022-12-19 22:22:23 +01:00
out+=("^sep($RESET_TO_DEFAULT)")
out+=("$MENUS,jgctl resetMBcolors;$me")
out+=("$OBWD,obtctl resetMBcolors;$me")
out+=("Conky,conkyctl resetcolorsall;$me")
out+=("^sep()")
2023-05-10 23:50:21 +02:00
out+=("<big>󰁯</big> $ALLRESET,randomizer resetall;$me")
if [[ "$1" != "c" ]];then
2022-12-19 22:22:23 +01:00
out+=("^sep(Colorizer)")
2023-05-10 23:50:21 +02:00
out+=(" Colorizer - $HELP,ycolorizer")
out+=("Colorizer - Rootmenu,colorizer -s")
out+=("^sep(Colorizer modules)")
out+=("OpenBox,colorizer-ob -s")
out+=("Menus,colorizer-menus -s")
out+=("Conky,colorizer-conky -s")
out+=("^sep()")
out+=("Cava,colorizer-cava -s")
out+=("PyRadio,colorizer-pyradio -s")
2022-12-19 22:22:23 +01:00
2023-05-10 23:50:21 +02:00
fi
2022-12-19 22:22:23 +01:00
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