I'm using Canvas
GTK theme and have all colors of that theme on my system.
I want to use one of those Canvas themes randomly each time I open an application.
I know I can use env GTK_THEME
to open an application with different theme but the problem with that is the title bar is still the main theme on some applications like libre office, not the theme that I specified in env GTK_THEME
.
Beside this problem, I don't know how to do this when every new application launch, so I wrote this script:
#!/bin/bash
theme_names=("Canvas" "Canvas-red" "Canvas-pink" "Canvas-indigo" "Canvas-blue" "Canvas-indigo" "Canvas-yellow")
theme_length=${#theme_names[@]}
rand_value=$(( $RANDOM % theme_length ))
theme_name=${theme_names[$rand_value]}
echo "$1 is opening with $theme_name theme\n"
echo "script is running: env GTK_THEME=$theme_name $1"
env GTK_THEME=$theme_name $1
and then I can run it with ./myscript.sh gedit
and the application can have random theme each time I run the script.
How can I apply this script globally? and is there anyway to solve title bar issue?
0 Answers