You are not logged in.
Hello everyone!
I have been struggling with this problem for a while but I haven't found any clarifying information, so I humbly ask for your help. I am using the amazing i3wm as my regular desktop environment, everything is working fine except for some key binding that require superuser privileges. For instance
bindsym $mod+F9 exec --no-startup-id gksudo bash ~/.config/i3/mount.sh where mount.sh is an small script intended to mount an USB key (needs to be elaborated, this is just a test)
#!/bin/bash
sudo mkdir /mnt/MyDrive
sudo mount /dev/sdc /mnt/MyDrive
when I press the keys combination I get the gksudo window, but nothing happens after input the password (the device is not mounted). I tested from the command line
gksudo bash mount.sh and it worked, so I think is an i3's issue. Thanks in advance.
Last edited by Panadestein (2017-04-23 21:25:18)
python -c 'import this' | awk 'NR == 5'
Offline
I'd bet something about the "~" does not work and it's not getting translated into your user's home.
Offline
I would suggest few alternative approaches/improvements that would make things simpler
1. put gksudo in your script so you execute only ~/.config/i3/mount.sh from i3
2. put mount.sh in $HOME/bin/mount.sh, and have $HOME/bin in your path, so you don't need to specify paths for all your personal scripts.
3. Even better is to get udevil, and use "udevil mount <your drive>", without using sudo.
4. If you are running script with gksudo, why you are having sudo in your script. (gksudo * sudo)
Arch is home!
https://github.com/Docbroke
Offline
I would suggest few alternative approaches/improvements that would make things simpler
1. put gksudo in your script so you execute only ~/.config/i3/mount.sh from i3
2. put mount.sh in $HOME/bin/mount.sh, and have $HOME/bin in your path, so you don't need to specify paths for all your personal scripts.
3. Even better is to get udevil, and use "udevil mount <your drive>", without using sudo.
4. If you are running script with gksudo, why you are having sudo in your script. (gksudo * sudo)
Thanks for your reply! I found all your suggestions very helpful, and yes, I think I will use udevil mount <device> , using the ideas on this post
https://bbs.archlinux.org/viewtopic.php?id=185712 . With respect to the 4th suggestion, of course is not necessary to put sudo on the script, it was an stupid mistake.
python -c 'import this' | awk 'NR == 5'
Offline