Code Monkey home page Code Monkey logo

Comments (6)

nwg-piotr avatar nwg-piotr commented on May 27, 2024 1

I'll try detecting several mostly used emulators, and save the first found one's name to ~/.config/nwg-launchers/nwggrid/term txt file for further use. The user will be able to replace it with their preferred terminal.

from nwg-launchers.

epsilon-0 avatar epsilon-0 commented on May 27, 2024 1

will do tonight.

from nwg-launchers.

nwg-piotr avatar nwg-piotr commented on May 27, 2024 1

It turns out that there's a much better way to check the command availability, which I was unaware of (stupid me!). Now we can check any terminal we want.

from nwg-launchers.

nwg-piotr avatar nwg-piotr commented on May 27, 2024

It's unsupported, at least for now. TBH I know no universal method to check the default terminal emulator. Ideas?

from nwg-launchers.

epsilon-0 avatar epsilon-0 commented on May 27, 2024

There is none...
This a big hole in freedesktop sepcifications of .desktop files.
This (among many other such threads) was the state of setting and finding terminal application:
https://xdg.freedesktop.narkive.com/bL3IsaJQ/spec-to-define-the-default-terminal#post11

How gnome does the finding is just cancerous
https://gitlab.gnome.org/GNOME/glib/-/blob/master/gio/gdesktopappinfo.c#L2548

My simple solution (though not universal or "adhering to [nonexistent] standards"): add it as a option in the config file.
Something like - terminal_exec_command: "alacritty -e ", which will run - alacritty -e "{command from Exec=}"

Because the current "solution" that everyone uses is to add the above alacritty -e to the start of the Exec= command.
This was it is atleast centralized and easily configurable.

Freedesktop specifications are a swiss cheese block, this one is just another hole.

from nwg-launchers.

nwg-piotr avatar nwg-piotr commented on May 27, 2024

I've added a function to detect the installed terminal emulator. It loops though 6 <terminal> -v commands, until one of them returns exit code 0, and saves the terminal name to the ~/.config/nwg-launchers/nwggrid/term file. In case it doesn't happen, the xterm name is being saved, regardless of whether it is installed or not. In both cases users may edit the term file content to use their favorite terminal emulator.

If you know any other terminal emulator with a command, which returns 0 exit code and terminates, it may be added to the list. AFAIK st, sakura and gnome-terminal have no such command (st and sakura return 1).

If you'd like to test changes, please build from the term branch.

from nwg-launchers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.