I'd like to read small text file, located at:
/sys/kernel/debug/vgaswitcheroo/switch without root permissions. It contains information about graphic cards (dedicated ATI Radeon and integrated Intel HD3000).
I wrote a simple script displaying infomation I need, but it works only with root privileges. I already tried changing file & folder permissions, but when I restart my computer, the problem remains. Is it possible to permanently change that file permissions or owner?
Why do I need that? To bind that script with keyboard shortcut and get following Ubuntu 'dialog' after pressing key combination:
What is inside
switch file? As I said before, it's just simple text file, with following content:
#!/bin/bash CONTENT=`cat /sys/kernel/debug/vgaswitcheroo/switch | cut -d ':' -f 1-4 ` DISPLAY=:0 notify-send -t 4000 -i /home/Greg/Pictures/ati_radeon.png "GPU status" "$CONTENT" echo "$CONTENT"
/etc/sudoers.tmp content, without comments starting with #. It starts with
nano editor, but I don't think it's relevant.
Defaults env_reset Defaults mail_badpass Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" root ALL=(ALL:ALL) ALL Greg ALL=(ALL:ALL) ALL Greg ALL= NOPASSWD: /home/Greg/Scripts/status-radeon.sh