Views:
2,470β
Votes: 5β
β
Solution
Tags:
gksudo
pkexec
Link:
π See Original Answer on Ask Ubuntu β§ π
URL:
https://askubuntu.com/q/1026821
Title:
Replacing gksudo with pkexec: editor doesn't start in current folder
ID:
/2018/04/21/Replacing-gksudo-with-pkexec_-editor-doesn_t-start-in-current-folder
Created:
April 21, 2018
Upload:
September 15, 2024
Layout: post
TOC:
false
Navigation: false
Copy to clipboard: false
As mentioned in comments, gksu
was βorphanedβ in 16.04 but you can still install it with:
sudo apt install gksu
That said I made a wrapper script for pkexec
a long time ago that might be of some interest:
#!/bin/bash
# Usage: gsu gedit file1
# -OR- gsu natuilus /dirname
COMMAND="$1" # extract gedit or nautilus
ABSOLUTE_NAME=$(realpath "$2")
pkexec "$COMMAND" "$ABSOLUTE_NAME"
#log-file "$ABSOLUTE_NAME" ~/bin/log-gsu-"$COMMAND"
I named the wrapper gsu
as a short form of gksu
. The log-file
script is a separate project which I commented out in the script for this answer.
You need to setup gedit
and nautilus
policy kits before you can use this script as the comments reference. In your case you would need to setup a policy kit for leafpad
.
Hope this helps!