qterminal icon indicating copy to clipboard operation
qterminal copied to clipboard

How do you load a profile?

Open jasmith79 opened this issue 6 years ago • 22 comments

First, let me say I know open source can be rough, and I appreciate your work. Qterminal is unquestionably one of the most feature-rich terminal emulators available on linux. On to the title of my question...

I cannot find anything in the documentation on this. The --help just says the -p/--profile option loads specific settings. There's nothing in any of the menus about profiles. The man pages are basically the same as --help. Glancing at the source code, looks like it expects a filename. I noticed that there's an ini file created at

~/.config/qterminal.org/qterminal.ini

But attempting to load this file or another ini file with stuff changed by using

qterminal -p path/to/file

Opens a terminal with a size of 0x0. As does qterminal -p name-of-file.

Expected Behavior

I expect to be able to load per-terminal window options like transparency, colors, etc.

Current Behavior

I can only modify windows by hand or by editing the main ini file which I have to do all over again the next time I need to reopen one.

Possible Solution

Put something in the docs (e.g. man pages, github wiki) about how to accomplish this task, or remove the option.

Context

I want to be able to open terminal windows with specific setups from shell scripts rather than massaging my terminal windows into the state I want by hand (which considering I usually have 6-8 open at any given time is quite annoying).

System Information
  • Distribution & Version: Linux Mint 19
  • Kernel: 4.15.0-20
  • Qt Version: 5.9.5
  • qtermwidget Version: 0.8.0-4
  • Package version: 0.8.0

jasmith79 avatar Oct 11 '18 20:10 jasmith79

Put something in the docs (e.g. man pages, github wiki) about how to accomplish this task

good idea, we accept patches

or remove the option.

erm, no, not really - but one can help to make the option better

maybe you should start with a current version - if your distribution don't provide one - ask for or bad luck

agaida avatar Oct 11 '18 20:10 agaida

@agaida if I knew how to load a profile properly, I would happily submit a patch for the man pages. Looking back through the changelog I didn't see anything about profiles since it's first inception in 0.6.0 in 2014, but if moving from 0.8 to 0.9 will make this work I certainly don't mind compiling from source.

jasmith79 avatar Oct 11 '18 20:10 jasmith79

sorry, i was to sparse - your submitted bug is legit - it is a bug :sunglasses: - i just checked back. And i don't see the need for advanced documentation of this behaviour, but i see the urge fixing that. And now to something completly different: It's fine that you run LXQt on Mint - normal or debian editon? But that will introduce a second problem - even if we fix this soon (i guess we will) you will not notice that until Mint will provide these packages - that means: We have to release, i upload it to debian sid, ubuntu catch up/it goes to testing - somewhen ubuntu/debian will relese and Mint catch up - so it will maybe a long time until the fix reach you in Mint.

agaida avatar Oct 11 '18 21:10 agaida

@yan12125 @tsujan - we should make it work asap - even if none of us is using it, it is a valid and important feature and should just work - it works partly right now, but there are some not needed glitches in the config file handling, i guess a tribute to the past and Qt's config file handling capabilities.

agaida avatar Oct 11 '18 21:10 agaida

I agree that this could be a good feature. @yan12125, do you have time to implement it?

tsujan avatar Oct 11 '18 21:10 tsujan

it is implemented - it just don't work right. Will dig a bit into.

agaida avatar Oct 11 '18 21:10 agaida

it is implemented - it just don't work right.

Then it's a bug to fix.

tsujan avatar Oct 11 '18 21:10 tsujan

@agaida if you folks get this fixed, I'll just compile from source. I'll also try to throw an updated deb in my PPA. Thanks all for the quick response.

jasmith79 avatar Oct 11 '18 22:10 jasmith79

@jasmith79 - ok, i have a suggestion until it is fixed :D - just did a bit of laying hands on it and whisper some healing formulas

  • copy a working configuration from ${HOME}/.config/qterminal.org/qterminal.ini to ~/.config/foo.conf and ~/.config/bar.conf (i really mean it)
  • start qterminal -p foo and change some configurations, close it
  • start qterminal -p bar and change some different configurations. close it
  • compare the files and use swear words at wish.

God damn, we should really fix it, but don't break the MS Windows configuration handling if possible .

Edit: Why using a derivative of a derivative if rockstable debian/sid or siduction exists?

agaida avatar Oct 11 '18 22:10 agaida

@jasmith79 - if fixed you could just take the (in)official packaging from https://salsa.debian.org/lxqt-team/qterminal and https://salsa.debian.org/lxqt-team/qtermwidgets (experimental-snapshots) - i guess you will need to adjust the lxqt-build-tools version and be done with.

agaida avatar Oct 11 '18 22:10 agaida

@agaida foo.conf and bar.conf do indeed work exactly as expected thank you. I am assuming that putting stuff directly in ~/.config is not the way it's supposed to work (since many many applications use it). As a side note, since none of you seem to be using this feature I see a potential problem:

There are some settings (like the hotkey for the quake terminal) that should probably be global rather than specific to a given profile if one can load different profiles per window. Not sure what the solution to that would look like, and may not be worth the resources to fix anyways (since it's a more advanced use case, with great power comes great responsibility, etc.)

jasmith79 avatar Oct 12 '18 11:10 jasmith79

@jasmith79 you are right :D (call it historical grown remnant)

agaida avatar Oct 12 '18 20:10 agaida

Sorry, but I don't have much time for now unless simple tasks like changing the path from ~/.config/foo.conf to ~/.config/qterminal/foo.conf

yan12125 avatar Oct 13 '18 10:10 yan12125

Now the expected behavior should work

Geo25rey avatar Oct 29 '18 11:10 Geo25rey

I just wanted to switch to qterminal and hit this bug... At least the workaround works. :)

morfikov avatar Oct 20 '19 22:10 morfikov

I tried editing ${HOME}/.config/qterminal.org/qterminal.ini to make my qterminal normally start up using linux emulation (I get really tired of mousing around each time I start it) and discovered it was owned by root. Of course I changed ownership in order to edit it, and it started up with linux emulation the next time I tried it. But it leaves some questions. Why is it owned by root? Is that intentional by the original developers, or is it just a mishap in the long chain through Debian and Devuan to installation and possible abuse on my laptop? -- hendrik

hendrikboom3 avatar Jan 06 '20 15:01 hendrikboom3

Why is it owned by root? Is that... or is it just a mishap...

Or you may have caused it by using sudo qterminal.... sudo shouldn't be used with GUI apps

tsujan avatar Jan 06 '20 15:01 tsujan

It's one thing that this bug is still open, it's quite another that it isn't even documented anywhere! I never would have thought that the argument to "-p" was supposed to be "the name of a file in ~/.config without the .conf extension that it should have." The help text of "Load qterminal with specific options" was vague enough that I thought MAYBE something like "-p fontFamily=Iosevka" or "-p General.fontFamily=Iosevka" might be a possibility (since I was wanting to be able to specify an individual preference on the command-line in the first place), when the more obvious meaning of "a filename or file path" didn't work. And this bug is how many years old? Should I submit a pull request with more specific wording in the help text? I haven't been involved in the project enough (or at all) to write the man page it should have.

clsn avatar Oct 16 '22 01:10 clsn

Should I submit a pull request with more specific wording in the help text?

We should discuss if we like to stick to ~/.config/foo.conf or better change the behavior to use ~/.config/qterminal.org/foo.ini which IMO would be more coherent.

I see that starting it with qterminal -p myconf at the first default setting modified the file ~/.config/myconf.conf will be created.

stefonarch avatar Oct 16 '22 08:10 stefonarch

better change the behavior to use ~/.config/qterminal.org/foo.ini

It's a good direction, but we need to design carefully so that workflows for existing users are not broken silently.

On ther other hand, improving helping texts can be done in parallel. Pull requests are welcome!

yan12125 avatar Oct 16 '22 10:10 yan12125

so that workflows for existing users are not broken

Good point, easiest way is to just improve the help.

Alternatively

  1. Check if foo.conf already exists in ~/.config/
  2. if yes migrate it
  3. if not create it in ~/.config/qterminal.org

stefonarch avatar Oct 16 '22 15:10 stefonarch

Migration is good!

yan12125 avatar Oct 16 '22 17:10 yan12125