maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Solution] Create shortcut Harmattan (https://talk.maemo.org/showthread.php?t=91753)

Kroll 2013-11-09 10:16

[Solution] Create shortcut Harmattan
 
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?

Mikkosssss 2013-11-09 11:10

Re: [Request] Shortcut creator Harmattan
 
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

Kroll 2013-11-09 12:31

Re: [Request] Shortcut creator Harmattan
 
Yes, this is what I was talking about! There is no noob way :)
Anyway, thanks, Mikkosssss.

Kroll 2013-11-10 10:11

Re: [Request] Shortcut creator Harmattan
 
Quote:

Originally Posted by Mikkosssss (Post 1385269)
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 2013-11-10 10:57

Re: [Request] Shortcut creator Harmattan
 
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 :p)
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/

coderus 2013-11-10 11:05

Re: [Request] Shortcut creator Harmattan
 
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


Mikkosssss 2013-11-10 11:25

Re: [Request] Shortcut creator Harmattan
 
Even if its FAT32?

coderus 2013-11-10 15:19

Re: [Request] Shortcut creator Harmattan
 
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.

Kroll 2013-11-21 16:26

Re: [Request] Shortcut creator Harmattan
 
1 Attachment(s)
Are u sure that execroot.sh script is correct?

Mikkosssss 2013-11-21 16:45

Re: [Request] Shortcut creator Harmattan
 
Quote:

Originally Posted by Kroll (Post 1387950)
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"



All times are GMT. The time now is 11:08.

vBulletin® Version 3.8.8