Xfce Forum

Sub domains
 

You are not logged in.

#1 2024-03-05 10:44:54

disp8571
Member
Registered: 2024-01-24
Posts: 5

[SOLVED] Set Encoding: 'UTF-8' with a config file / bash script?

xfce4-terminal 1.0.4

I am looking for a solution to set the value of:
Edit > Preferences > Advanced > Encoding > Default character encoding
to: UTF-8

without the UI, instead with a command or by any config file / setting.

Is there any solution to modify this via a bash script?

Last edited by disp8571 (2024-03-05 13:39:55)

Offline

#2 2024-03-05 11:00:55

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,056

Re: [SOLVED] Set Encoding: 'UTF-8' with a config file / bash script?

Version 1.0.4 still uses the rc config file, so try:

sed -i '/Encoding/d' ~/.config/xfce4/terminal/terminalrc

As of 1.1.0, xfce4-terminal transitioned to xfconf, so you would use:

xfconf-query -c xfce4-terminal -p /encoding -s ""

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2024-03-05 13:32:49

disp8571
Member
Registered: 2024-01-24
Posts: 5

Re: [SOLVED] Set Encoding: 'UTF-8' with a config file / bash script?

guided by this hint:
https://unix.stackexchange.com/questions/419753
I found a solution.

Quick answer:
echo "Encoding=UTF-8" | tee --append "~/.config/xfce4/terminal/terminalrc"

Explanation:
check the actual content of 'terminalrc'
cat "~/.config/xfce4/terminal/terminalrc"
Use the UI to do any setting you want to be modified by your script afterwards, i.e. change the 'Encoding' value.
check again the content of terminalrc
cat "~/.config/xfce4/terminal/terminalrc"
now you should see the corresponding setting(s) within the xfce4-terminal configuration file (terminalrc).

Remark:
You can also use this approach to set your color setting ;-)

This solves also my previous issue:
Xfce4-Terminal Config | Bash script: Set (nord) theme as default
https://forum.xfce.org/viewtopic.php?id=17248

Offline

Board footer

Powered by FluxBB