Notices


Reply
Thread Tools
Posts: 637 | Thanked: 445 times | Joined on Dec 2009 @ Kaliningrad, Russia
#1
Hello maemers!
Looks like there is no easy noob-way to make a shortcut on the desktop on the Harmattan device as it is on n900.
Like:
1. insert a command to run application or command like "ping"
2. insert a way to icon
3. put some line to write a geek words or commands
4. ????
5. PROFIT

Anybody here to handle this? Any one? Please?

Last edited by Kroll; 2013-11-23 at 18:50.
 
Mikkosssss's Avatar
Posts: 645 | Thanked: 519 times | Joined on Apr 2012 @ Finland
#2
You can do it manually by making following text file:
Code:
[Desktop Entry]
Type=Application
Name=Name of your shortcut
Exec=Command that you want to do 
Icon=/patch/to/your/icon.png
And name it something.desktop

Then place it to /home/user/.local/share/applications
__________________
────────────────────
Try:My N9 bootvideo
 

The Following 5 Users Say Thank You to Mikkosssss For This Useful Post:
Posts: 637 | Thanked: 445 times | Joined on Dec 2009 @ Kaliningrad, Russia
#3
Yes, this is what I was talking about! There is no noob way
Anyway, thanks, Mikkosssss.
 
Posts: 637 | Thanked: 445 times | Joined on Dec 2009 @ Kaliningrad, Russia
#4
Originally Posted by Mikkosssss View Post
You can do it manually by making following text file:
Code:
[Desktop Entry]
Type=Application
Name=Name of your shortcut
Exec=Command that you want to do 
Icon=/patch/to/your/icon.png
And name it something.desktop

Then place it to /home/user/.local/share/applications
How can I make a shortcut to run a command or application as a root?
 
Mikkosssss's Avatar
Posts: 645 | Thanked: 519 times | Joined on Apr 2012 @ Finland
#5
Using scripts.

Code:
Exec=/home/user/execroot.sh /home/user/yourscript.sh
Execroot.sh is script that lets you use root command once (or thats how I get it )
Heres code for it:

Code:
#!/bin/sh

if [ $# -ne 1 ]
then
        echo "Usage: $0 command"
        exit 1
fi

echo rootme | devel-su -c "$1"
Then yourscript.sh can be like this:

Code:
#!/bin/sh

My command
After you make script you need to chmod it or it wont work:
Code:
chmod +x /home/user/yourscript.sh
Also do it to execroot.sh

Edit: Also scripts wont work In MyDocs-> So place them in /home/user/
__________________
────────────────────
Try:My N9 bootvideo

Last edited by Mikkosssss; 2013-11-10 at 11:01.
 

The Following 2 Users Say Thank You to Mikkosssss For This Useful Post:
coderus's Avatar
Posts: 6,436 | Thanked: 12,699 times | Joined on Nov 2011 @ Ängelholm, Sweden
#6
you can launch script everywhere.
Code:
sh /home/user/MyDocs/shell-script.sh
perl /home/user/MyDocs/perl-script.pl
python /home/user/MyDocs/python-script.py
__________________
Telegram | Openrepos | GitHub | Revolut donations
 

The Following 2 Users Say Thank You to coderus For This Useful Post:
Mikkosssss's Avatar
Posts: 645 | Thanked: 519 times | Joined on Apr 2012 @ Finland
#7
Even if its FAT32?
__________________
────────────────────
Try:My N9 bootvideo
 
coderus's Avatar
Posts: 6,436 | Thanked: 12,699 times | Joined on Nov 2011 @ Ängelholm, Sweden
#8
you dont understand. you not need to set executable to script. you can execute shell, or perl, or python, whatever with option reading and executing script command from file. its same what operating system does when executing your script file if it have executable flag and shebang line (#!/bin/sh i.e.).

for example:
you have /home/user/MyDocs/script.sh
Code:
#!/bin/sh
echo "Hello!"
you cant set chmod +x as usual, but you always can launch shell with your script
Code:
sh /home/user/MyDocs/script.sh
in this way your script dont need to be executable.
__________________
Telegram | Openrepos | GitHub | Revolut donations
 

The Following 4 Users Say Thank You to coderus For This Useful Post:
Posts: 637 | Thanked: 445 times | Joined on Dec 2009 @ Kaliningrad, Russia
#9
Are u sure that execroot.sh script is correct?
Attached Images
 
 
Mikkosssss's Avatar
Posts: 645 | Thanked: 519 times | Joined on Apr 2012 @ Finland
#10
Originally Posted by Kroll View Post
Are u sure that execroot.sh script is correct?
Are you sure that you copied it correct?
But heres my that works everyday...

Code:
#!/bin/sh

if [ $# -ne 1 ]
then
        echo "Usage: $0 command"
        exit 1
fi

echo rootme | devel-su -c "$1"
__________________
────────────────────
Try:My N9 bootvideo
 

The Following User Says Thank You to Mikkosssss For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 20:00.