Skip to content

Instantly share code, notes, and snippets.

@stokito
Created September 12, 2019 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stokito/e89cdf05591b4faefabccd55d7b6b5be to your computer and use it in GitHub Desktop.
Save stokito/e89cdf05591b4faefabccd55d7b6b5be to your computer and use it in GitHub Desktop.
The one-liner to open a file in editor (pluma). It will show a file chose dialog and if the file is owned by root it will ask for a sudo password
FILE=$(zenity --file-selection); echo $FILE; if [ -w "$FILE" ]; then pluma "$FILE"; else pkexec pluma "$FILE"; fi;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment