437 lines
16 KiB
Bash
Executable File
437 lines
16 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# . .
|
|
# | |
|
|
# ,-. |-. |- ,-: ,-. ;-.
|
|
# | | | | | | | |-' | |
|
|
# `-' `-' `-' `-| `-' ' '
|
|
# `-'
|
|
# Openbox Theme Generator
|
|
|
|
file=$HOME/.colors/ln
|
|
wb(){
|
|
{
|
|
fill_color
|
|
cat <<EOF
|
|
|
|
# Menu
|
|
menu.border.width: 10
|
|
menu.overlap.x: -20
|
|
menu.overlap.y: -20
|
|
|
|
menu.border.color: #${get_colors_bg}
|
|
menu.separator.color: #${get_colors_bg}
|
|
|
|
menu.title.bg: flat solid
|
|
menu.title.bg.color: #${get_colors_bg}
|
|
menu.title.text.color: #$(get_colors 4)
|
|
menu.title.text.justify: Center
|
|
|
|
menu.items.bg: flat solid
|
|
menu.items.bg.color: #${get_colors_bg}
|
|
|
|
menu.items.text.color: #$(get_colors 7)
|
|
menu.items.disabled.text.color: #${get_colors_bg}
|
|
|
|
menu.items.active.bg: flat solid
|
|
menu.items.active.bg.color: #${get_colors_bg}
|
|
menu.items.active.text.color: #$(get_colors 4)
|
|
|
|
# Active window
|
|
window.active.border.color: #$(get_colors 4)
|
|
|
|
window.active.title.bg: solid flat
|
|
window.active.title.bg.color: #$(get_colors 4)
|
|
window.active.title.separator.color: #$(get_colors 4)
|
|
window.active.text.justify: center
|
|
|
|
window.active.label.bg: parentrelative
|
|
window.active.label.text.color: #$(get_colors 4)
|
|
|
|
window.active.handle.bg: flat solid
|
|
window.active.handle.bg.color: #$(get_colors 4)
|
|
|
|
window.active.grip.bg: flat solid
|
|
window.active.grip.bg.color: #$(get_colors 4)
|
|
|
|
window.active.button.unpressed.bg: parentrelative
|
|
window.active.button.unpressed.bg.color: #${get_colors_bg}
|
|
|
|
window.active.button.iconify.unpressed.image.color: #$(get_colors 7)
|
|
window.active.button.iconify.pressed.image.color: #$(get_colors 3)
|
|
window.active.button.iconify.hover.image.color: #$(get_colors 3)
|
|
|
|
window.active.button.max.unpressed.image.color: #$(get_colors 7)
|
|
window.active.button.max.pressed.image.color: #$(get_colors 2)
|
|
window.active.button.max.hover.image.color: #$(get_colors 2)
|
|
|
|
window.active.button.close.unpressed.image.color: #$(get_colors 7)
|
|
window.active.button.close.pressed.image.color: #$(get_colors 1)
|
|
window.active.button.close.hover.image.color: #$(get_colors 1)
|
|
|
|
window.active.button.shade.unpressed.image.color: #$(get_colors 7)
|
|
window.active.button.shade.pressed.image.color: #$(get_colors 5)
|
|
window.active.button.shade.hover.image.color: #$(get_colors 5)
|
|
|
|
window.active.button.desk.unpressed.image.color: #$(get_colors 7)
|
|
window.active.button.desk.pressed.image.color: #$(get_colors 6)
|
|
window.active.button.desk.hover.image.color: #$(get_colors 6)
|
|
|
|
window.active.button.pressed.bg: parentrelative
|
|
window.active.button.pressed.bg.color: #$(get_colors 7)
|
|
|
|
window.active.button.disabled.bg: parentrelative
|
|
window.active.button.disabled.bg.color: #${get_colors_bg}
|
|
window.active.button.disabled.image.color: #${get_colors_bg}
|
|
|
|
window.active.button.toggled.bg: parentrelative
|
|
window.active.button.toggled.image.color: #$(get_colors 5)
|
|
|
|
window.active.button.toggled.pressed.bg: parentrelative
|
|
window.active.button.toggled.pressed.image.color: #$(get_colors 7)
|
|
|
|
# Inactive window
|
|
window.inactive.border.color: #$(get_colors 5)
|
|
|
|
window.inactive.title.bg: flat solid
|
|
window.inactive.title.bg.color: #$(get_colors 5)
|
|
window.inactive.title.separator.color: #$(get_colors 5)
|
|
window.inactive.text.justify: center
|
|
|
|
window.inactive.label.bg: parentrelative
|
|
window.inactive.label.text.color: #$(get_colors 5)
|
|
|
|
window.inactive.handle.bg: flat solid
|
|
window.inactive.handle.bg.color: #$(get_colors 5)
|
|
|
|
window.inactive.grip.bg: flat solid
|
|
window.inactive.grip.bg.color: #$(get_colors 5)
|
|
|
|
window.inactive.button.unpressed.bg: parentrelative
|
|
window.inactive.button.unpressed.bg.color: #${get_colors_bg}
|
|
|
|
window.inactive.button.iconify.unpressed.image.color: #$(get_colors 7)
|
|
window.inactive.button.iconify.pressed.image.color: #$(get_colors 3)
|
|
window.inactive.button.iconify.hover.image.color: #$(get_colors 3)
|
|
|
|
window.inactive.button.max.unpressed.image.color: #$(get_colors 7)
|
|
window.inactive.button.max.pressed.image.color: #$(get_colors 2)
|
|
window.inactive.button.max.hover.image.color: #$(get_colors 2)
|
|
|
|
window.inactive.button.close.unpressed.image.color: #$(get_colors 7)
|
|
window.inactive.button.close.pressed.image.color: #$(get_colors 1)
|
|
window.inactive.button.close.hover.image.color: #$(get_colors 1)
|
|
|
|
window.inactive.button.shade.unpressed.image.color: #$(get_colors 7)
|
|
window.inactive.button.shade.pressed.image.color: #$(get_colors 5)
|
|
window.inactive.button.shade.hover.image.color: #$(get_colors 5)
|
|
|
|
window.inactive.button.desk.unpressed.image.color: #$(get_colors 7)
|
|
window.inactive.button.desk.pressed.image.color: #$(get_colors 6)
|
|
window.inactive.button.desk.hover.image.color: #$(get_colors 6)
|
|
|
|
window.inactive.button.pressed.bg: parentrelative
|
|
window.inactive.button.pressed.bg.color: #$(get_colors 4)
|
|
|
|
window.inactive.button.disabled.bg: parentrelative
|
|
window.inactive.button.disabled.bg.color: #${get_colors_bg}
|
|
window.inactive.button.disabled.image.color: #${get_colors_bg}
|
|
|
|
window.inactive.button.toggled.bg: parentrelative
|
|
window.inactive.button.toggled.image.color: #$(get_colors 4)
|
|
|
|
window.inactive.button.toggled.pressed.bg: parentrelative
|
|
window.inactive.button.toggled.pressed.image.color: #$(get_colors 4)
|
|
|
|
# OSD
|
|
osd.border.width: 3
|
|
osd.border.color: #${get_colors_bg}
|
|
|
|
osd.bg: flat solid
|
|
osd.bg.color: #${get_colors_bg}
|
|
osd.label.bg: flat solid
|
|
osd.label.bg.color: #${get_colors_bg}
|
|
osd.label.text.color: #$(get_colors 7)
|
|
|
|
osd.hilight.bg: flat solid
|
|
osd.hilight.bg.color: #$(get_colors 4)
|
|
|
|
osd.unhilight.bg: flat solid
|
|
osd.unhilight.bg.color: #$(get_colors 8)
|
|
|
|
osd.button.unpressed.bg: flat border
|
|
osd.button.unpressed.bg.color: #$(get_colors 8)
|
|
osd.button.unpressed.*.border.color: #${get_colors_bg}
|
|
|
|
osd.button.pressed.bg: flat border
|
|
osd.button.pressed.bg.color: #$(get_colors 8)
|
|
osd.button.pressed.*.border.color: #${get_colors_bg}
|
|
|
|
osd.button.focused.bg: flat solid border
|
|
osd.button.focused.bg.color: #${get_colors_bg}
|
|
osd.button.focused.*.border.color: #${get_colors_bg}
|
|
|
|
osd.button.focused.box.color: #$(get_colors 4)
|
|
|
|
# Fonts
|
|
window.active.label.text.font: shadow=n
|
|
window.inactive.label.text.font: shadow=n
|
|
menu.items.font: shadow=n
|
|
menu.title.text.font: shadow=n
|
|
|
|
# Everything else
|
|
border.width: 0
|
|
padding.width: 15
|
|
padding.height: 10
|
|
window.handle.width: 0
|
|
window.client.padding.width: 0
|
|
window.label.text.justify: center
|
|
|
|
EOF
|
|
} > ~/.local/bin/my-obtgen/openbox-3/themerc
|
|
cp ~/.local/bin/my-obtgen/openbox-3/* ~/.themes/myobtheme/openbox-3/
|
|
check_theme
|
|
}
|
|
|
|
nrml(){
|
|
{
|
|
fill_color
|
|
cat <<EOF
|
|
|
|
# Menu
|
|
menu.border.width: 10
|
|
menu.overlap.x: -20
|
|
menu.overlap.y: -20
|
|
|
|
menu.border.color: #${get_colors_bg}
|
|
menu.separator.color: #${get_colors_bg}
|
|
|
|
menu.title.bg: flat solid
|
|
menu.title.bg.color: #${get_colors_bg}
|
|
menu.title.text.color: #$(get_colors 4)
|
|
menu.title.text.justify: Center
|
|
|
|
menu.items.bg: flat solid
|
|
menu.items.bg.color: #${get_colors_bg}
|
|
|
|
menu.items.text.color: #$(get_colors 7)
|
|
menu.items.disabled.text.color: #${get_colors_bg}
|
|
|
|
menu.items.active.bg: flat solid
|
|
menu.items.active.bg.color: #${get_colors_bg}
|
|
menu.items.active.text.color: #$(get_colors 4)
|
|
|
|
# Active window
|
|
window.active.border.color: #$(get_colors 4)
|
|
|
|
window.active.title.bg: solid flat
|
|
window.active.title.bg.color: #${get_colors_bg}
|
|
window.active.title.separator.color: #${get_colors_bg}
|
|
window.active.text.justify: center
|
|
|
|
window.active.label.bg: parentrelative
|
|
window.active.label.text.color: #${get_colors_bg}
|
|
|
|
window.active.handle.bg: flat solid
|
|
window.active.handle.bg.color: #$(get_colors 4)
|
|
|
|
window.active.grip.bg: flat solid
|
|
window.active.grip.bg.color: #$(get_colors 4)
|
|
|
|
window.active.button.unpressed.bg: parentrelative
|
|
window.active.button.unpressed.bg.color: #${get_colors_bg}
|
|
|
|
window.active.button.iconify.unpressed.image.color: #$(get_colors 3)
|
|
window.active.button.iconify.pressed.image.color: #$(get_colors 3)
|
|
window.active.button.iconify.hover.image.color: #$(get_colors 3)
|
|
|
|
window.active.button.max.unpressed.image.color: #$(get_colors 2)
|
|
window.active.button.max.pressed.image.color: #$(get_colors 2)
|
|
window.active.button.max.hover.image.color: #$(get_colors 2)
|
|
|
|
window.active.button.close.unpressed.image.color: #$(get_colors 1)
|
|
window.active.button.close.pressed.image.color: #$(get_colors 1)
|
|
window.active.button.close.hover.image.color: #$(get_colors 1)
|
|
|
|
window.active.button.shade.unpressed.image.color: #$(get_colors 5)
|
|
window.active.button.shade.pressed.image.color: #$(get_colors 5)
|
|
window.active.button.shade.hover.image.color: #$(get_colors 5)
|
|
|
|
window.active.button.desk.unpressed.image.color: #$(get_colors 6)
|
|
window.active.button.desk.pressed.image.color: #$(get_colors 6)
|
|
window.active.button.desk.hover.image.color: #$(get_colors 6)
|
|
|
|
window.active.button.pressed.bg: parentrelative
|
|
window.active.button.pressed.bg.color: #${get_colors_bg}
|
|
|
|
window.active.button.disabled.bg: parentrelative
|
|
window.active.button.disabled.bg.color: #${get_colors_bg}
|
|
window.active.button.disabled.image.color: #${get_colors_bg}
|
|
|
|
window.active.button.toggled.bg: parentrelative
|
|
window.active.button.toggled.image.color: #$(get_colors 4)
|
|
|
|
window.active.button.toggled.pressed.bg: parentrelative
|
|
window.active.button.toggled.pressed.image.color: #$(get_colors 4)
|
|
|
|
# Inactive window
|
|
window.inactive.border.color: #$(get_colors 5)
|
|
|
|
window.inactive.title.bg: flat solid
|
|
window.inactive.title.bg.color: #${get_colors_bg}
|
|
window.inactive.title.separator.color: #${get_colors_bg}
|
|
window.inactive.text.justify: center
|
|
|
|
window.inactive.label.bg: parentrelative
|
|
window.inactive.label.text.color: #${get_colors_bg}
|
|
|
|
window.inactive.handle.bg: flat solid
|
|
window.inactive.handle.bg.color: #$(get_colors 5)
|
|
|
|
window.inactive.grip.bg: flat solid
|
|
window.inactive.grip.bg.color: #$(get_colors 5)
|
|
|
|
window.inactive.button.unpressed.bg: parentrelative
|
|
window.inactive.button.unpressed.bg.color: #${get_colors_bg}
|
|
|
|
window.inactive.button.iconify.unpressed.image.color: #$(get_colors 8)
|
|
window.inactive.button.iconify.pressed.image.color: #$(get_colors 3)
|
|
window.inactive.button.iconify.hover.image.color: #$(get_colors 3)
|
|
|
|
window.inactive.button.max.unpressed.image.color: #$(get_colors 8)
|
|
window.inactive.button.max.pressed.image.color: #$(get_colors 2)
|
|
window.inactive.button.max.hover.image.color: #$(get_colors 2)
|
|
|
|
window.inactive.button.close.unpressed.image.color: #$(get_colors 8)
|
|
window.inactive.button.close.pressed.image.color: #$(get_colors 1)
|
|
window.inactive.button.close.hover.image.color: #$(get_colors 1)
|
|
|
|
window.inactive.button.shade.unpressed.image.color: #$(get_colors 8)
|
|
window.inactive.button.shade.pressed.image.color: #$(get_colors 5)
|
|
window.inactive.button.shade.hover.image.color: #$(get_colors 5)
|
|
|
|
window.inactive.button.desk.unpressed.image.color: #$(get_colors 8)
|
|
window.inactive.button.desk.pressed.image.color: #$(get_colors 6)
|
|
window.inactive.button.desk.hover.image.color: #$(get_colors 6)
|
|
|
|
window.inactive.button.pressed.bg: flat solid
|
|
window.inactive.button.pressed.bg.color: #$(get_colors 4)
|
|
|
|
window.inactive.button.disabled.bg: flat solid
|
|
window.inactive.button.disabled.bg.color: #${get_colors_bg}
|
|
window.inactive.button.disabled.image.color: #${get_colors_bg}
|
|
|
|
window.inactive.button.toggled.bg: parentrelative
|
|
window.inactive.button.toggled.image.color: #$(get_colors 4)
|
|
|
|
window.inactive.button.toggled.pressed.bg: parentrelative
|
|
window.inactive.button.toggled.pressed.image.color: #$(get_colors 4)
|
|
|
|
# OSD
|
|
osd.border.width: 3
|
|
osd.border.color: #${get_colors_bg}
|
|
|
|
osd.bg: flat solid
|
|
osd.bg.color: #${get_colors_bg}
|
|
osd.label.bg: flat solid
|
|
osd.label.bg.color: #${get_colors_bg}
|
|
osd.label.text.color: #$(get_colors 7)
|
|
|
|
osd.hilight.bg: flat solid
|
|
osd.hilight.bg.color: #$(get_colors 4)
|
|
|
|
osd.unhilight.bg: flat solid
|
|
osd.unhilight.bg.color: #$(get_colors 8)
|
|
|
|
osd.button.unpressed.bg: flat border
|
|
osd.button.unpressed.bg.color: #$(get_colors 8)
|
|
osd.button.unpressed.*.border.color: #${get_colors_bg}
|
|
|
|
osd.button.pressed.bg: flat border
|
|
osd.button.pressed.bg.color: #$(get_colors 8)
|
|
osd.button.pressed.*.border.color: #${get_colors_bg}
|
|
|
|
osd.button.focused.bg: flat solid border
|
|
osd.button.focused.bg.color: #${get_colors_bg}
|
|
osd.button.focused.*.border.color: #${get_colors_bg}
|
|
|
|
osd.button.focused.box.color: #$(get_colors 4)
|
|
|
|
# Fonts
|
|
window.active.label.text.font: shadow=n
|
|
window.inactive.label.text.font: shadow=n
|
|
menu.items.font: shadow=n
|
|
menu.title.text.font: shadow=n
|
|
|
|
# Everything else
|
|
border.width: 5
|
|
padding.width: 15
|
|
padding.height: 10
|
|
window.handle.width: 0
|
|
window.client.padding.width: 0
|
|
window.label.text.justify: center
|
|
|
|
EOF
|
|
} > ~/.local/bin/myobtheme/openbox-3/themerc
|
|
cp -r ~/.local/bin/myobtheme/ ~/.themes/
|
|
check_theme
|
|
}
|
|
|
|
fill_color(){
|
|
get_colors(){
|
|
grep "color$1 *:" $file | awk -F\# '{print $2}' | head -1
|
|
}
|
|
get_colors_bg=`grep "background *:" $file | awk -F\# '{print $2}' | head -1`
|
|
}
|
|
|
|
check_theme(){
|
|
if [[ $(cat $HOME/.config/openbox/rc.xml | grep "myobtheme") ]]; then
|
|
notify-send "Done. now you can try your theme :)"
|
|
openbox --reconfigure
|
|
elif [[ $(find /usr/lib -type d -name lxappearance | xargs ls -R | grep ob) ]]; then
|
|
lxappearance >/dev/null 2>&1
|
|
elif [[ $(which obconf) ]]; then
|
|
obconf >/dev/null 2>&1
|
|
fi
|
|
}
|
|
|
|
help(){
|
|
cat <<-EOF
|
|
|
|
888 888
|
|
888 888
|
|
888 888
|
|
.d88b. 88888b. 888888 .d88b. .d88b. 88888b.
|
|
d88""88b888 "88b888 d88P"88bd8P Y8b888 "88b
|
|
888 888888 888888 888 88888888888888 888
|
|
Y88..88P888 d88PY88b. Y88b 888Y8b. 888 888
|
|
"Y88P" 88888P" "Y888 "Y88888 "Y8888 888 888
|
|
888
|
|
Y8b d88P
|
|
"Y88P"
|
|
|
|
Openbox Theme Generator
|
|
|
|
Usage : obtgen [options #optional]
|
|
|
|
Avaible options
|
|
--wal Generate color from pywal cache
|
|
--wb Generate borderless theme
|
|
--help Show help
|
|
|
|
EOF
|
|
}
|
|
|
|
if [[ "$(echo "$@" | grep '\--wal')" && "$(echo "$@" | grep '\--wb')" ]]; then
|
|
file=$HOME/.cache/wal/colors.Xresources
|
|
wb
|
|
elif [[ "$(echo "$@" | grep '\--wb')" ]]; then
|
|
wb
|
|
elif [[ "$(echo "$@" | grep '\--wal')" ]]; then
|
|
file=$HOME/.cache/wal/colors.Xresources
|
|
nrml
|
|
elif [[ "$(echo "$@" | grep '\--help')" ]]; then
|
|
help
|
|
else
|
|
nrml
|
|
fi |