Pokemon-Terminal icon indicating copy to clipboard operation
Pokemon-Terminal copied to clipboard

Added compatibility with xfce4-terminal

Open tran-simon opened this issue 7 years ago • 10 comments

It should work if the xfce4-terminal config files are stored at ~/.config/xfce4/terminal/terminalrc

tran-simon avatar Sep 15 '17 21:09 tran-simon

I had to had a bash script named "xfce4TerminalChangeBackground.sh" since I never really used python before, so I didn't know how to do replace the line containing the path to the background image in the terminalrc config file in python.

If someone knows how to replace a line from a file in python, feel free to remove this script.

tran-simon avatar Sep 15 '17 21:09 tran-simon

there's already an implementation at #67, but I'm not fan of both methods of setting the file (calling shell scripts/commands where it could be done in pure python)

you should also check out how they detect xfce4 terminal. Calling ps recursively is a really ugly hack imo.

sylveon avatar Sep 16 '17 02:09 sylveon

I managed to change the file completely in python.

I didn't find a way to detect the the xfce4 terminal.

Maybe you could ask the user to enter which terminal he's using at the first launch and then store it in a config file or something?

tran-simon avatar Sep 20 '17 17:09 tran-simon

Seems fine to me. Although I'm no Python expert so someone better than me might want to take a look.

To detect xfce4-terminal you can use the following from #67:

    def is_available():
        return "xfce4-terminal" in os.environ.get('COLORTERM', "").lower()

Also you didn't implement clear. It's still the code from the Terminology implementation that's in there.

sylveon avatar Sep 20 '17 18:09 sylveon

I tried your command to detect xfce4-terminal, it didn't work for me

Also, I'm not sure what the clear method is supposed to do. Should it reset the terminal to default, or set some colour instead of the picture?

tran-simon avatar Sep 20 '17 19:09 tran-simon

clear() resets the terminal back to default.

The snippet I posted is Python code that would go in place of your is_available() function, and it's working for me: image

sylveon avatar Sep 21 '17 00:09 sylveon

Has this been resolved? What else needs to be done?

samuelhnrq avatar Oct 10 '17 13:10 samuelhnrq

What needs to be implemented is the clear method and a better detection method, like the one I suggested.

sylveon avatar Oct 10 '17 14:10 sylveon

Due to the latest PR being merged, this will be need to be redone for the new model @ThePotatoGod99

https://github.com/LazoCoder/Pokemon-Terminal/pull/138

sylveon avatar Jan 07 '18 18:01 sylveon

I tried "xfce4-terminal" in os.environ.get('COLORTERM', "").lower() and it did not work on my Arch Machine.

fionera avatar Apr 10 '18 13:04 fionera