Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: DF in Unity side menu  (Read 1057 times)

malimbar04

  • Bay Watcher
    • View Profile
DF in Unity side menu
« on: May 18, 2011, 09:05:12 pm »

I posted a while ago that I was having trouble in Ubuntu 11.04 getting a launcher into the side panel of Unity. Recommendations were all over the place, including making a C++ program to launch the script that launches the program.

then I figured out the easy answer - you can right click on teh desktop to create a launcher for anything. I put the launcher for the DF script in a safe place (the documents folder for now), and then dragged that into the menu. Works like a charm :). It still runs df as a separate (question-mark icon) instance, but I'm ok with that if I get my pretty launcher.
Logged
No! No! I will not massacre my children. Instead, I'll make them corpulent on crappy mass-produced quarry bush biscuits and questionably grown mushroom alcohol, and then send them into the military when they turn 12...

Azrathud

  • Bay Watcher
    • View Profile
Re: DF in Unity side menu
« Reply #1 on: May 18, 2011, 11:23:11 pm »

Or, you know, you could use a terminal to start it. Just cd( the command to 'change directory') to the directory where your binary is:
Code: [Select]
cd ~/df_linux Then you need to run your excutable which is, by default, named df:
Code: [Select]
./df That works pretty fast, especially if you're using the tab key to autocomplete file directories for you.


You could even set up a script in '/usr/bin' to start it just by typing 'dorf' or something into the terminal(df is already taken.) Bash searches '/usr/bin/' and a few other folders to see if there's anything relevant to anything you enter into the terminal. You will need root permissions to do anything in '/usr/bin' so 'sudo' and, subsequently, your password will be used. Just cd to '/usr/bin':
Code: [Select]
cd /usr/bin
And make a new file there with sudo(I like vim but most people will be using nano.):
Code: [Select]
sudo nano dorf
Then, in the file, type the directory path of your file with 'cd', and the command to run df:
Code: [Select]
cd /home/azrathud/df_linux; ./df
Now you will need to close and save the file and then change the permissions of the file so it can be executed like this:
Code: [Select]
sudo chmod +x dorf
Close the terminal and open a new one. Viola! You can open df by typing 4 characters. Mapping the terminal to a shortcut also makes it faster.(I do this for minecraft and LCS too)


I don't know about unity(I'm sticking with an older version of Ubuntu until the annoying sound problems cease to persist.) But I imagine you could type:
Code: [Select]
cd /home/{username}/df_linux;./df into a file with the extension '.sh' like 'dorf.sh' which means it's for the shell(the terminal) and then drag it into unity.

edit:editing /usr/bin with chmod requires permissions
« Last Edit: May 18, 2011, 11:55:44 pm by Azrathud »
Logged

malimbar04

  • Bay Watcher
    • View Profile
Re: DF in Unity side menu
« Reply #2 on: May 19, 2011, 10:53:59 pm »

Or, you know, you could use a terminal to start it. Just cd( the command to 'change directory') to the directory where your binary is:
Code: [Select]
cd ~/df_linux Then you need to run your excutable which is, by default, named df:
Code: [Select]
./df That works pretty fast, especially if you're using the tab key to autocomplete file directories for you.


You could even set up a script in '/usr/bin' to start it just by typing 'dorf' or something into the terminal(df is already taken.) Bash searches '/usr/bin/' and a few other folders to see if there's anything relevant to anything you enter into the terminal. You will need root permissions to do anything in '/usr/bin' so 'sudo' and, subsequently, your password will be used. Just cd to '/usr/bin':
Code: [Select]
cd /usr/bin
And make a new file there with sudo(I like vim but most people will be using nano.):
Code: [Select]
sudo nano dorf
Then, in the file, type the directory path of your file with 'cd', and the command to run df:
Code: [Select]
cd /home/azrathud/df_linux; ./df
Now you will need to close and save the file and then change the permissions of the file so it can be executed like this:
Code: [Select]
sudo chmod +x dorf
Close the terminal and open a new one. Viola! You can open df by typing 4 characters. Mapping the terminal to a shortcut also makes it faster.(I do this for minecraft and LCS too)


I don't know about unity(I'm sticking with an older version of Ubuntu until the annoying sound problems cease to persist.) But I imagine you could type:
Code: [Select]
cd /home/{username}/df_linux;./df into a file with the extension '.sh' like 'dorf.sh' which means it's for the shell(the terminal) and then drag it into unity.

edit:editing /usr/bin with chmod requires permissions
So... everytime I want to run df I just open up a separate program, type in some commands, and hide the terminal while the game actually runs? Yeah... I could do that if I was masochistic.
wait, that's actually pretty cool (and very dwarfy) - making the entire thing into keystrokes. Granted, what I can do right now is super-4 and it opens DF.

 For some reason shell commands can't be dragged into the unity bar, which is why I had trouble originally (the script that comes with is a shell script, so no need to make one). Instead, it accepts launcher files, like the kind that are made when you attach a launcher to the old top menu. The revelation was that right-clicking on the desktop can make these, and then I dragged that into the unity bar.
« Last Edit: May 19, 2011, 11:08:10 pm by malimbar04 »
Logged
No! No! I will not massacre my children. Instead, I'll make them corpulent on crappy mass-produced quarry bush biscuits and questionably grown mushroom alcohol, and then send them into the military when they turn 12...

Azrathud

  • Bay Watcher
    • View Profile
Re: DF in Unity side menu
« Reply #3 on: May 21, 2011, 05:55:01 am »

snip
So... everytime I want to run df I just open up a separate program, type in some commands, and hide the terminal while the game actually runs? Yeah... I could do that if I was masochistic.
wait, that's actually pretty cool (and very dwarfy) - making the entire thing into keystrokes. Granted, what I can do right now is super-4 and it opens DF.

 For some reason shell commands can't be dragged into the unity bar, which is why I had trouble originally (the script that comes with is a shell script, so no need to make one). Instead, it accepts launcher files, like the kind that are made when you attach a launcher to the old top menu. The revelation was that right-clicking on the desktop can make these, and then I dragged that into the unity bar.

Hehe. You can remove the terminal from the equation by typing something like
Code: [Select]
screen -S dwarf And then open DF in there and then hit Ctrl+a, Ctrl+d and then exit out of the terminal. You could incorporate that even into that bash file that could be made in /usr/bin/

I used a similar method to get clickable shortcuts on my desktop for Ubuntu.. when I used those. :b
Logged