Xfce Forum

Sub domains
 

You are not logged in.

#1 2011-10-19 15:06:08

Nilak
Member
Registered: 2011-10-19
Posts: 11

[Solved] How to change terminal transparency level with a command?

Hello

I use xfce4.8 and Fedora 15.


I Try to change the transparency level of my terminal with a shortkey but i dont find this command...

How to do it?

Applications > Settings > Settings Manager > Window Manager Tweaks > Compositor > Enable display compositing

Best regards,

Last edited by Nilak (2015-01-06 13:34:48)

Offline

#2 2011-10-20 08:20:31

mmassonnet
Moderator
From: the milky way galaxy
Registered: 2006-07-30
Posts: 99
Website

Re: [Solved] How to change terminal transparency level with a command?

Terminal reads/saves its configuration inside ~/.config/Terminal/terminalrc. This file can be modified at any time and Terminal will automatically pick up the new settings.

So a command like this should work:

sed -i s/BackgroundDarkness=.*/BackgroundDarkness=0,6/ ~/.config/Terminal/terminalrc

BackgroundDarkness is a value between 0 (transparent) and 1 (opaque).

Remember to make a copy of your terminalrc file before tweaking it ;-)

PS : if you are using Xfwm, you can press Alt and scroll your mousewheel over the title bar, and nope, there is no keyboard shortcut for this, but it should be possible to use a third-party command/script for doing so


Mike

Offline

#3 2011-10-20 14:59:59

Nilak
Member
Registered: 2011-10-19
Posts: 11

Re: [Solved] How to change terminal transparency level with a command?

Thanks for your post,

I  didnt know this trick with alt + scrool but it's not perfect because you can just minimize the value... So I can enter 1 for BackgroundDarkness but i should in each time use your trick for minize the value and I never use a terminal with BackgroundDarkness=1...

Yesterday, I tried to write a bash script. I knew BackgroundDarkness value with cat and sed but I dont know how to calculate a new value because cat + sed give a string and not an integer...

$OLD = cat .config/Terminal/terminalrc | grep BackgroundDarkness  |sed 's/BackgroundDarkness=//'
$NEW = $OLD + 0.05
sed -i s/BackgroundDarkness=.*/BackgroundDarkness=$NEW/ ~/.config/Terminal/terminalrc


cat .config/Terminal/terminalrc | grep BackgroundDarkness

BackgroundDarkness=0.800000+0.05


I dont know how to do... hmm

Best regards,

Offline

#4 2011-10-21 10:05:57

mmassonnet
Moderator
From: the milky way galaxy
Registered: 2006-07-30
Posts: 99
Website

Re: [Solved] How to change terminal transparency level with a command?

$ OLDVAL=0.8
$ echo $OLDVAL + .05 | bc
.85
$ NEWVAL=`echo $OLDVAL + 0.05 | bc`
$ echo $NEWVAL
.85

There might be other ways that the use of the bc command.


Mike

Offline

#5 2011-10-21 13:04:04

Nilak
Member
Registered: 2011-10-19
Posts: 11

Re: [Solved] How to change terminal transparency level with a command?

Thanks for your post.

You are awesome, now i can change my transparency level with a shortkey! It's amazing!


Best regards

Offline

#6 2018-08-25 21:26:16

yakovcha
Member
Registered: 2018-08-25
Posts: 1

Re: [Solved] How to change terminal transparency level with a command?

Thank you for sharing knowledge.

Created script for myself (xfce 4.12, Debian 9.4) for cycling opacity. Maybe will be helpful for someone else.

CONFIG_FILE=~/.config/xfce4/terminal/terminalrc
OLD_VALUE=`sed -n 's/DropdownOpacity=\(.*\)/\1/p' $CONFIG_FILE`

case $OLD_VALUE in
40)   NEW_VALUE=80  ;;
90)   NEW_VALUE=100 ;;
100)  NEW_VALUE=40  ;;
*)    NEW_VALUE=100 ;;
esac

sed -i  "s/DropdownOpacity.*/DropdownOpacity=$NEW_VALUE/" $CONFIG_FILE

Thanks,

Offline

Board footer

Powered by FluxBB