Nice! This is a nice example of how community really expands our Linux knowledge. We have a similar thread with alias, BUT it does not include that custom history command. I’m gonna use that. Thanks for sharing!
Commands that let you run an app with elevated permissions seem a never ending source of bugs and problems:
gksu - deprecated (not on modern systems anymore)
su-to-root - just does not work most of the time (not yet examined why)
pkexec - does not work in a lot of cases due to missing environment variables
Therefore, I kind of “reintroduced” a gksu to my system but not the one mentioned above. I introduced it as an alias:
alias gksu="pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS"
Be careful though !Only use it if you really need it and only use it with applications you fully trust ! (which, ofcourse, counts for any privilege elevating tool)