Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #awful.spawn.with_shell("theme_terminals.sh '" .. string.sub(theme_gtk.bg_color,0,7) .. "' '" .. string.sub(theme_gtk.fg_color,0,7) .. "'" )
- [ -z "$1" ] && bg="#3e3e3e" && fg="#fefefe" || bg="$1"
- [ -z "$2" ] && fg="#fefefe" || fg="$2"
- # lxterminal
- sed -i -r "s/bgcolor=.*$/bgcolor=$bg/" $HOME/.config/lxterminal/lxterminal.conf
- sed -i -r "s/fgcolor=.*$/fgcolor=$fg/" $HOME/.config/lxterminal/lxterminal.conf
- # Xterm
- sed -i -r "s/XTerm\*background\:.*$/XTerm*background: $bg/" $HOME/.Xdefaults
- sed -i -r "s/XTerm\*foreground\:.*$/XTerm*foreground: $fg/" $HOME/.Xdefaults
- xrdb -merge $HOME/.Xdefaults
- # sakura
- hex2srgb(){
- hex=$(echo "${1^^}" | sed 's/#//g')
- a=$(echo $hex | cut -c-2)
- b=$(echo $hex | cut -c3-4)
- c=$(echo $hex | cut -c5-6)
- r=$(echo "ibase=16; $a" | bc)
- g=$(echo "ibase=16; $b" | bc)
- b=$(echo "ibase=16; $c" | bc)
- sed -i -r "s/$2.*$/$2=rgb($r,$g,$b)/" $3
- }
- hex2srgb $fg "colorset1_fore" $HOME/.config/sakura/sakura.conf
- hex2srgb $bg "colorset1_back" $HOME/.config/sakura/sakura.conf
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement