How to include password in shorcut

  • Thread starter Deleted member 151145
  • Start date


have a look here

2022-12-27_12-53.png

note the pink stripe pointing to nopasswdlogin
 
Is there any 'joy' to be had by playing around in "users and groups"

Just a wild thought from the blue

Now, that is something I never thought of. It is worth throwing in the mix of how to resolve this thing. As soon as I'm done responding to all the posts I'm going to look at bleachbit-root.desktop and see if I can echo that line in that file. I've already backed that file up in case I do Bork it. I'll holler back when I've tried it.
 
I'd head to /usr/share/applications and open "BleachBit (as root)" with a text editor.

I'd then look to see where it called the file and try echoing the password with that section.

It'd be one of the two following lines, I think:

Code:
TryExec=pkexec
Exec=pkexec bleachbit

I just finished trying those suggestions. I tried changing just one of the lines at a time, then changed them both and it didn't work.

What is REALLY frustrating me right now is the fact that I can launch a terminal and issue the command below and it works perfectly, but if I create a launcher it does nothing. Since it DOES work from within a terminal, there HAS TO BE a way to create a launcher that will do the same thing.

echo mypassword | sudo -S myprogram

.
 
Alright, try this:

Open your terminal.

Code:
sudo su
visudo

Add this:

Code:
#bleachbit as root
kgiii  ALL = NOPASSWD: /usr/bin/bleachbit

Change 'kgiii' to your username.

Press CTRL + X
Press Y
Press Enter

Now, I'm not sure about the next step, 'cause I haven't rebooted...

Try opening bleachbit as root from your existing application menu shortcut.
 
OK. Did that. I don't think it was necessary, but I shut the laptop completely down and let it sit for 60 seconds, then powered it back up. Went straight to the Menu > System > Bleachbit (as root). The password prompt popped up. I should probably remove those entries, but since I'm actively looking for a different distro and Bleachbit (as root) runs just fine, I'll just leave it as is. Can't be hurting too much.

Thanks for that suggestion, but it no happiness here. :(
 
You can try it again, but this time try specifying the path to the 'as root' .desktop file.

I tried that a couple of times, but it gave me an error.

In your current configuration, exactly as you have it after adding those lines, what happens in your terminal if you type 'sudo bleachbit'? Or, better still:

Code:
sudo bleachbit &
 
You can try it again, but this time try specifying the path to the 'as root' .desktop file.

I tried that a couple of times, but it gave me an error.

In your current configuration, exactly as you have it after adding those lines, what happens in your terminal if you type 'sudo bleachbit'? Or, better still:

Code:
sudo bleachbit &

That opened Bleachbit (as root) right up. I just tried creating a deskto launcher with that command and it does the same, exact thing using the command I found does - nothing. No terminal opens or even flashes, no kind of error message, just nothing.

I might play around trying that command later this evening. Maybe I'll fall into something. I still can hardly believe that no one this forum is running a distro that includes Menu entries for File Manager and File Manager As Root. I need to know what the command is that opens the File Manager as Root.
.
 
WOOHOO!!! I have it working!

MAKE SURE THAT YOU CAN 'sudo bleachbit' in the terminal and NOT have to enter a password. (from the directions above)

Code:
sudo chmod o+x /usr/bin/bleachbit

Now, make your desktop 'bleachbit.desktop'.

Code:
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=sudo bleachbit
Name=bleachbit
Comment=bleachbit
Icon=

You can add an icon. Just add the path.

Make your bleachbit.desktop executable:

Code:
sudo chmod o+x /path/to/bleachbit.desktop

Now, double click on the shortcut!

ZV4IC8e.png
 
Last edited:
Final format:

Code:
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=sudo bleachbit
Name=Bleachbit (As Root)
Comment=bleachbit
Icon=bleachbit
 
So, I found the answer. I just put it in the wrong thread, due to multitasking and needing to hurry during dinner time.


Read that and the post immediately behind it. It works. It works in a real OS and works in a VM.

Sorry 'bout putting it in the wrong thread. I could copy/paste and put it here, but the link should work like a champion.
 
See what you have done, now @lonewolf - you've confused us, must be the Stephen King avatar :)
 
I cheated and *copied* the two salient posts to this thread.

Yay for moderation tools!

They still exist in the other thread, so that the conversation there isn't disrupted. I mostly copied them over here for the next person who comes along and wants to know how to do this.
 

Members online


Top