I occasionally need to know the names of programs. I asked here about “Run as Administrator” being added to the context menu (like in Windows), and the response was basically “can’t be easily done”. an example is if I wish to edit a config file it cannot be done without accessing the terminal. Knowing the name “gedit” is the real name of “text editor” is useful information in this use-case.

I am not afraid of the terminal, but I would never prefer it over a GUI. is there a way to find a program name/install location from right-clicking-details (or something)? So then I could open a terminal and “sudo programname”?

(As an aside, I prefer Linux overall, but every distro I’ve tried has a strong sense that if you’re using the GUI you don’t need or deserve admin controls. Program names in the menus are almost always different from their names in the terminal, and many what I would consider normal system settings, like the ability to act as an administrator, find where a program is installed are terminal only.)

This is Ubuntu with all the default stuff


EDIT: I always expect a degree of hostility and talking-down from the desktop Linux community, but the number of people in this thread telling me I am using my own computer that I bought with my own money in a way they don’t prefer while ignoring my question is just absurd and frankly should be deeply embarrassing for all of us. I have strongly defended the desktop Linux community for decades, but this experience has left a sour taste in my mouth.

Thank you to the few of you who tried to assist without judgement or assumptions.

EDIT: As usual, it can be easily done.

  • SavvyWolf@pawb.social
    link
    fedilink
    English
    arrow-up
    22
    ·
    9 months ago

    Out of interest, what is your use case? I’ve not seen a gui app that requires root that doesn’t prompt for it when you start it up.

    • Jediwan@lemy.lolOP
      link
      fedilink
      arrow-up
      7
      arrow-down
      2
      ·
      edit-2
      9 months ago

      It’s just useful to know the name of the app sometimes. With ubuntu default options, “Text Editor” (in the GUI menu), is “gedit” for example. “File Browser” is “Nautilus”. These things are actually not easy to learn if you aren’t deep into the Linux world.

      On Windows, I would never need to know that the “File browser window” is called “explorer”.

      • lemmyreader@lemmy.ml
        link
        fedilink
        English
        arrow-up
        9
        arrow-down
        2
        ·
        9 months ago

        With ubuntu default options, “Text Editor” (in the GUI menu), is “gedit” for example. “File Browser” is “Nautilus”. These things are actually not easy to learn if you aren’t deep into the Linux world.

        Agreed. That is unfortunately the way GNOME Desktop Environment has been going since years. For example Epiphany web browser is now known as “Web”. Not only that, GNOME started to remove window buttons like Maximize. With GNOME tweaks tool these window buttons can be enabled again, but I personally don’t find the GNOME changes a huge improvement.

        • Jediwan@lemy.lolOP
          link
          fedilink
          arrow-up
          6
          ·
          9 months ago

          I actually don’t mind the straightforward names! When I was a Linux newbie it was very helpful to get going. but it would be nice to have advanced info more readily available instead of assuming I “don’t need it” as so frequently happens. I’m in the awkward space where I am by any measure an advanced power user, but not like systems admin level where I am more comfortable in the command line.

      • Nibodhika@lemmy.world
        link
        fedilink
        arrow-up
        6
        arrow-down
        1
        ·
        9 months ago

        That doesn’t answer the question, you can have multiple file browsers or text editors installed. The question everyone is asking and you haven’t answered here nor on the other thread is “why do you need to run a program with sudo”? Which program do you need to run with sudo and why?

        • Jediwan@lemy.lolOP
          link
          fedilink
          arrow-up
          2
          arrow-down
          5
          ·
          9 months ago

          The question in this thread is about identifying program names.

          • bigmclargehuge@lemmy.world
            link
            fedilink
            arrow-up
            16
            arrow-down
            1
            ·
            9 months ago

            https://xyproblem.info/

            People want to know because you’re asking how to do something that (whether you like it or not) is unorthodox and can cause issues. People want to know if the ROOT of your issue is solvable via orthodox means that won’t cause issues.

            Even in your other post, you were asking how to run a program with sudo via a context menu, but you didn’t say why you needed to. You aren’t giving us info on the root of your problem OR end goal, only the means you want to use to get there. There could easily be a simple way to achieve your goal, but via different means. People want to help but it can be difficult for them to give directions when they don’t have a point of origin or a destination.

            Not trying to be an ass, just trying to give some insight as to why you may not be getting the answers you hoped for, and why some people might seem like they’re actively avoiding giving them to you.

            • Nibodhika@lemmy.world
              link
              fedilink
              arrow-up
              6
              ·
              9 months ago

              Found one answer from him that sort of explains it all, it’s more of an XYZ problem now.

              • X: He couldn’t delete files on a remote share

              So he ran whatever program with sudo, and copied files over from there. Now he had lots of files owned by root, so he needed to runs text editors, file browsers and everything else with sudo because he didn’t own the files and didn’t realized that. He was annoyed about having to run everything with sudo so he created the first thread asking how to make a menu entry to be able to keep insisting on his solution to the X problem, so he asked for the Y problem (how to add a menu entry to run things as root).

              Someone answered him how to do it, but in the example the menu entry added is for using a specific program instead of the default one, so now (problem Z) he wants to know how to find the default program for open a file so he can use that tutorial to create the menu to allow him to keep opening random things with root (which is the original cause of all oh his headaches to begin with)

            • Jediwan@lemy.lolOP
              link
              fedilink
              arrow-up
              3
              ·
              edit-2
              9 months ago

              Thanks, I’m aware of the XY problem and do appreciate everyone’s concern. I am not trying to run a random app as root. That would be absurd.

          • breadsmasher@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            9 months ago

            Do you have a desktop icon or something other link named like “ProgramA” but when you run it, its executing under a different process name?

            As in I could create a shortcut to nano called “text thing”, and when I open that, it runs nano.

            Is that what youre asking? How to find the target program name from a shortcut or other desktop icon?

            • Jediwan@lemy.lolOP
              link
              fedilink
              arrow-up
              3
              arrow-down
              1
              ·
              9 months ago

              Do you have a desktop icon or something other link named like “ProgramA” but when you run it, its executing under a different process name?

              Yes. I have been using Linux daily for a few years now and it remains my biggest frustration knowing what is running and where it might be installed.

              Two examples are gedit is called “Text Editor” and nautilus is called “File Browser”. Gparted is called “Partition Editor”.

              Is that what youre asking? How to find the target program name from a shortcut or other desktop icon?

              Yes. But without using the terminal. I am not anti-terminal, I’m just looking for a faster way.

      • boredsquirrel@slrpnk.net
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        9 months ago

        Thats also GNOME. Apps having random names, sometimes different package names and different displayed (and translated!) Names. It sucks> extremely.

        If you right click apps, instead of showing you the entry (like in Plasma) you can only open it in gnome software.

        Some stupid names to make stuff easier:

        • nautilus: files
        • totem: video player
        • epiphany: web
        • loupe: new, extremely minimal but secure image viewer; eog being the old one
        • evolution: email and calendar
        • evince: pdf viewer
        • cheese: webcam (but there is a new app that replaces it)
        • seahorse: password managee
      • d3Xt3r@lemmy.nzM
        link
        fedilink
        arrow-up
        3
        arrow-down
        1
        ·
        edit-2
        9 months ago

        On Windows, I would never need to know that the “File browser window” is called “explorer”

        I do though. That knowledge is pretty handy for launching apps via the Run dialog, which I find faster than using the Start Menu with its horrible search. And this has become even more important to me with recent versions of Windows getting rid of the classic Control Panel UI, as you can still access the old applets without needing to put up with the horrid Metro UI. For instance, I find the network settings applet far more convenient and easy to use, so I just launch it via ncpa.cpl. Or if I want to get to the old System applet to change the hosname/page file size etc, I can get to it by running sysdm.cpl. Or getting to Add/Remove programs via appwiz.cpl, and so on.

        Also, knowing the actual commands opens up many scripting and automation possibilities, or say you just want to create a custom shortcut to a program/applet somewhere. There are several useful applets you can launch via rundll32 for instance.

  • bizdelnick@lemmy.ml
    link
    fedilink
    arrow-up
    11
    ·
    9 months ago

    Use bash-completion, it is much faster than clicking menus.

    every distro I’ve tried has a strong sense that if you’re using the GUI you don’t need or deserve admin controls

    GUI tools are not suited to be run as root in general. Few ones that are have special measures taken to prevent gaining privileges by another process, e. g. run a background non-GUI process as root and GUI communicating with it as an ordinary user. Such tools (package managers, system tweakers etc.) are usually configured to get required privileges via polkit (e. g. pkexec synaptic to run GUI package manager in Debian). Don’t use sudo to run GUI programs!

    • Jediwan@lemy.lolOP
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      9 months ago

      Thank you for the advice I will take it under consideration.You seem educated in this area, do you know of an easy way to identify the real name of a program without the terminal?

  • bigmclargehuge@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    edit-2
    9 months ago

    Find the .desktop file for the desired program (should be in /usr/share/applications) Right click, properties, then somewhere in that window, it should show the exact command that the .desktop file invokes when launched. In that command should be the actual program name (ie, /usr/bin/firefox-esr, firefox-esr is your program name).

    Alternatively, right click, “Open With”, choose a text editor, then you’ll see a couple lines of information. One of those lines of info should be that command as well.

    Edit, to be fair, I’m also not a fan of Gnome’s obfuscation of program names. It may make sense for very new users, but I also found it counterproductive in certain use cases

  • 柊 つかさ@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    9 months ago

    but every distro I’ve tried has a strong sense that if you’re using the GUI you don’t need or deserve admin controls

    It’s not that you don’t need or deserve it. The thing is terminal tools are already available. To get the same stuff with GUI someone is going to have to make that stuff. Most people with the skill to make things like that probably don’t care enough about GUI to be inspired to make such tools. Since using the terminal is easy and natural to them. When it comes to FOSS, since people work on it in their free time with no payment, they are likely to only put significant effort in things that they would use themselves.

    • Jediwan@lemy.lolOP
      link
      fedilink
      arrow-up
      4
      arrow-down
      3
      ·
      9 months ago

      The thing is terminal tools are already available.

      Right, after many years of Linux, I get the feeling that developers assume that if you don’t like text-based input, you are not responsible enough to configure your own computer. It strikes me as a hacky workaround to the problem of different knowledge levels among users. This is not a criticism of any particular developer, and I have a deep respect for them all. It’s just an observation. UAC is not much better, and Apple’s “solution” is even worse.

      • Buddahriffic@lemmy.world
        link
        fedilink
        arrow-up
        9
        ·
        9 months ago

        While it wouldn’t surprise me if some devs do assume that, I think you’re mistaking apathy for malice in the general case. If there isn’t a way to do something through a GUI that can be done through a terminal, it only implies that no one has decided that creating a GUI to do that was worth the effort.

        It’s not (necessarily) that devs want to block users from changing things, it’s more of a case that no one has cared enough to put the time and effort in to enabling that GUI access. They either use the terminal or don’t configure it ideally themselves because that configuration hasn’t been important enough to take their attention.

        Though I added that necessarily in brackets there because the Linux community is historically known for RTFM-style gatekeeping even for users who are trying to learn how to use the terminal, so I don’t doubt that there are some terminal purists who would attempt to block attempts to add GUI configuration to depots they have influence over.

        But just keep in mind it takes time and effort to make things. And, personally, as a dev (not a Linux dev but a software dev that uses Linux), I hate making GUIs. In my experience, unless you’re willing to spend a long time positioning, sizing, and centering, they look like crap. Maybe there’s a better framework for it these days, but I’d rather be writing algorithms and solving interesting problems than doing graphical design.

        • Jediwan@lemy.lolOP
          link
          fedilink
          arrow-up
          3
          ·
          9 months ago

          That’s a really good point. I also know that making GUIs sucks and there’s a reason UX devs make the big bucks.

        • Jediwan@lemy.lolOP
          link
          fedilink
          arrow-up
          1
          arrow-down
          1
          ·
          9 months ago

          Yes! Exactly why it bugs me when options are left out of the GUI out of what I can only assume is a sense of concern the user might use them “incorrectly”.

      • atzanteol@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        5
        ·
        9 months ago

        Right, after many years of Linux, I get the feeling that developers assume that if you don’t like text-based input, you are not responsible enough to configure your own computer.

        Many of us prefer the cli for administration. It’s not “punishing” you - it’s how things are more often done with Linux.

        • Jediwan@lemy.lolOP
          link
          fedilink
          arrow-up
          1
          ·
          9 months ago

          Oh I know, no disrespect to my terminal-peeps. to clarify, I was speaking purely about the “noob friendly” distros.

  • ouch@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    9 months ago

    Running GUI programs as root is going to introduce you into a world of pain. But you have been warned now, so if you proceed, let the pain become a learning experience, young padawan.

    • TCB13@lemmy.world
      link
      fedilink
      English
      arrow-up
      9
      arrow-down
      2
      ·
      9 months ago

      So much for…

      The Linux desktop is amazing, it does all the annoying things Windows does while not delivering anything Windows does right.

  • boredsquirrel@slrpnk.net
    link
    fedilink
    arrow-up
    8
    arrow-down
    1
    ·
    9 months ago

    KDE Plasma.

    Really, GNOME is not a good Desktop for poweruser tasks like that. Either oversimplified GUI or terminal.

    • Jediwan@lemy.lolOP
      link
      fedilink
      arrow-up
      2
      ·
      9 months ago

      I like GNOME for it’s extensions, but haven’t tried KDE since before Plasma. Is it highly customizable on par with GNOME?

      • boredsquirrel@slrpnk.net
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        9 months ago

        Honestly. The Fedora change proposal sounded kinda odd for me, but really?? GNOME sucks?

        GNOME lacks support for so much, so that either straight to Terminal with all the complications, or random Extensions (arbitrary code!) that will break on updates, or just “dont use it”.

  • infeeeee@lemm.ee
    link
    fedilink
    arrow-up
    6
    ·
    edit-2
    9 months ago

    You can create a new desktop file, where you add pkexec in the Exec line.

    Desktop files are in /usr/share/applications. Find your app there. Copy it’s desktop file file to the user’s application directory, it’s ~/.local/share/applications expanded: /home/username/.local/share/applications/. Rename this new desktop file, and in the line starting with Exec add pkexec at the beginning of the command string. pkexec is the graphical equivalent of sudo(kindof). Also change the Name in the file, so you can find it in your menu. (The difference you mention comes from here. On the gui this Name parameter is visible, while on the terminal you call the command from Exec).

    When you save the new desktop file, it should show up in your Application menu. If you start this new app, pkexec should bring up a graphical password prompt.

    If you use gnome you can edit desktop files with alacarte, it may work with other DEs: https://gitlab.gnome.org/GNOME/alacarte

    More info, these things are unrelated to your distro, it should work the same way everywhere:

  • mub@lemmy.ml
    link
    fedilink
    arrow-up
    3
    ·
    9 months ago

    I understand your pain. Most things you need to configure are either in your home direct under .config or they prompt for admin if they need it. However, not everything has a convenient gui interface to make config changes. This is mostly ok because configuration is usually done once and then never touched again.This is how Linux works, it just isn’t a like for like replacement for windows, though it can achieve the same goals.

    I like a better gui for adjusting audio devices, specifically the sample and bit rates. I haven’t found anything that can do it in a straightforward gui.

  • GamingChairModel@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    9 months ago

    every distro I’ve tried has a strong sense that if you’re using the GUI you don’t need or deserve admin controls

    It’s more that GUI programs can’t be trusted with root privileges. They’re not designed for that, and can break things in unpredictable ways.

  • bleepbloopbop [they/them]@hexbear.net
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    9 months ago

    https://github.com/brunonova/nautilus-admin

    This is unmaintained, so it may not work with the latest ubuntu, but it is an extension to the default ubuntu file manager that does some of what you want

    As for your title question, unfortunately ubuntu/gnome don’t seem to make this easy. On some DEs you can just right click and go find the shortcut properties sorta like on windows. Others have noted some good reasons why GUI apps shouldn’t run as root, but you’re right that sometimes it’s necessary, or simply the easiest/most expedient way to do things.

    You can accomplish what you ask using a little shell script though, which you could bind to a keyboard shortcut or something. I may elaborate further but basically:

    readlink /proc/"$( xprop _NET_WM_PID | sed 's/_NET_WM_PID(CARDINAL) = //')"/exe

    and then clicking on the window you want to ID will attempt to identify the binary it’s running. then you could either display it in a popup using zenity, or write it directly to the clipboard using xclip (or wl-copy I think for wayland distros)

    I really like setting up little shortcut scripts like this with zenity for user input, and usually the notification tray or clipboard for output

  • MonkderDritte@feddit.de
    link
    fedilink
    arrow-up
    2
    ·
    9 months ago

    Right click on program in menu and choose “edit” or something? Don’t know if your particular DE supports that, though.

  • Successful_Try543@feddit.de
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    8 months ago

    If you are interested in editing text files as root directly from nautilus, the package nautilus-admin may be helpful. Link

    As I am using KDE, I know that Kate, the KDE text editor, prompts for the sudo password when saving an edited text files that is owned by root. I don’t know if Gedit does the same.

    • Jediwan@lemy.lolOP
      link
      fedilink
      arrow-up
      2
      ·
      8 months ago

      Oh my gosh I can’t believe after 56 comments from so called “experts” you bring up such a simple solution. Thank you!

  • eshep@social.trom.tf
    link
    fedilink
    arrow-up
    1
    ·
    8 months ago

    @flork Granted it’s listed in a mimeapps.list file, you should easily be able to pull the program name out of there by querying against the file in question’s mimetype.

    And while “can’t be easily done” may be generally true, don’t call it quits; some file managers may offer less “not easy” than others. Don’t end your customization exploration because the file manager you currently use can’t do what you want, try fiddlin round with some others. The process for each file manager is going to be different, and getting the name of the program for any filetype is also going to differ depending on the syntax required for altering each different file manager.

  • bloodfart@lemmy.ml
    link
    fedilink
    arrow-up
    1
    arrow-down
    1
    ·
    9 months ago

    From this and your other thread I’m getting the idea that you should switch desktop environments. Gnome doesn’t provide that functionality in the context menu by default and tends to obfuscate program names in order to be more straightforward.

    Install kde. See how it treats you. It’s a lot more windowsy than gnome.

    Usually when gnome users run into something they can’t do with the gui they’ll either go without it or use the command line to do it. That’s the way macos users are too.

    If you don’t wanna use the command line you gotta have a de that doesn’t treat it as an acceptable fallback.

    I’m just gonna respond to your other thread here as well. The problem you ought to be trying to solve isn’t running a gui program sudo (which is a bad idea for all the reasons everyone else in that thread listed), but why you’re not being prompted for credentials when you try to do something that needs them.

    One of the examples you gave is a network share file access and it could be (I’m guessing because decades ago I did this too) that you have admin credentials on your local machine that match the ones your network share is looking for. If that’s the case, it’s bad, fix it.

    • Jediwan@lemy.lolOP
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      9 months ago

      It’s a lot more windowsy than gnome.

      Is it as easily customizable now? The thing I hate about Windows and love about GNOME is that I can configure the UI to look like almost anything with a few clicks and there is a great community creating great extensions. I haven’t tried KDE in many years but I found it more limiting than even Windows last time I tried it.

      • bloodfart@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        8 months ago

        I don’t know what you want to customize, but it seemed really customizable to me.

        So you understand who you’re talking to: I use lxqt and the only customized thing about it is taskbar on the left side of the screen.