Thursday, October 10, 2019

Automatically Mount Partition on Fedora

Make sure you can run a graphical application as root (please refer to the previous post) or you logged in as root on a graphical session.

Run gnome-disks:
> gnome-disks --gapplication-service

Select the partition and click on the Settings button.

Right-click and select: "Edit Mount Options..."

Configure at will. Remember to choose a "Display Name".

Reference
  1. How To Auto-mount Partitions On Startup Using Gnome Disks

Running a Graphical Application as root on Fedora

If you, as a regular user, want to run a graphical application with root privileges, you can do the following from your account:

First check you belong to the wheel group (you can invoke sudo).

Create a file with the following script in a file named, for example, wsudo:

#!/bin/bash
# -*- ENCODING: UTF-8 -*-
#small script to enable root access to x-windows system 
xhost +SI:localuser:root
notify-send "ALERT: Enable root user on xhost"
beesu $1
#disable root access after application terminates
xhost -SI:localuser:root
#print access status
notify-send "Disable root user on xhost"

Export the display:
> export DISPLAY=:0.0

then run the graphical application like this:
> ~/bin/wsudo appname

You will be prompted for your password and you're done!