Creating an Application Launcher for GNOME 3 in Ubuntu - gnome

I have Ubuntu 12.04 LTS installed on my machine. I also have installed GNOME 3. I then installed the IDE IntelliJ without issue. However I installed it to a custom location and now the only way to run it is through the terminal via "./idea.sh". I would like to create an application launcher so I can launch IntelliJ via the applications list in the GNOME 3 windows manager. How would I do such a thing via the terminal, not through a 3rd part utility. I would also prefer to have the correct icon for the launcher, not a generic one. Thank you for the help.

Run Intellij, then go to Tools > Create Desktop Entry.

create a file called intellij.desktop in the directory /usr/share/applications/
my file looks like this
[Desktop Entry]
Name=IntelliJ IDEA Community Edition
Comment=Free Java, Groovy, Scala and Android applications development
Exec=/path/to/your/bin/idea.sh
Path=/path/to/your/bin
Terminal=false
Icon=intellij-idea-ce
Type=Application
Categories=Development;IDE
for more details check this website, http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
edit: mlissner (Thank you!) mentioned that intelliJ in particular implemented a feature to add that Icon/Launcher automatically. Just open IntelliJ IDE, go to Tools and click Create Desktop Entry...

On Ubuntu 20 (Focal Fossa), create a launcher with alacarte.
The generated .desktop file is automatically placed in ~/.local/share/applications.
Move it from there to /usr/share/applications/ if it is to be accessible to all the computer's users.

You can create launcher using following steps
step 1) Install gnome-panel
sudo apt-get install --no-install-recommends gnome-panel
step 2) run gnome-desktop-item-edit
gnome-desktop-item-edit ~/.local/share/applications --create-new
step 3) fill the required values in widget

Related

Using Visual Studio Code on Windows with Ubuntu-Bash and NodeJS

I'm trying to figure out how to do my web development on Windows using the relatively new Windows Subsystem for Linux (Bash on Ubuntu on Windows) in conjunction with Visual Studio Code. I've configured the IDE to use the Bash in its integrated terminal, and I've set the project up such that the files are accessible in both the Linux and Windows file system.
The last thing I want to get set up is to get the IDE set up with NodeJS, but not NodeJS for Windows. I want it to use an installation of NodeJS in the Linux Subsystem. Does anyone know if it's possible to point VS Code to the Node installation in the Linux Subsystem?
This was a stumbling block for me too, until I found out that the real problem is that there's a pathing issue with WSL that creates a conflict if you already have NPM installed for Windows. Hopefully you've already figured this out yourself, but for anyone else who hits this, I'm copying in an excerpt from my longer guide on Visual C + WSL that's specific to this problem alone.
Given what you've said, I'll assume you already have node and NPM already installed in WSL's Ubuntu.
Using your favorite CLI editor (such as nano, vim, emacs, cat and sed… etc), open your ~/.profile
nano ~/.profile
Note: do NOT attempt to edit Linux files using Windows tools. (Thanks to #david-c-rankin's comment for the official link with the bold red text explaining this) If you don't want to use a CLI editor for this in the terminal, see the bottom of the answer this is excerpted from for a link on how to get a GUI one running.
Currently, the default bash PATH variable in WSL is
PATH="$HOME/bin:$HOME/.local/bin:$PATH"
Which is injecting the windows path after the first two binary directories. Unfortunately, this doesn't result in /usr/bin being used before the windows installed npm, so add that before the final $PATH:
PATH="$HOME/bin:$HOME/.local/bin:/usr/bin:$PATH"
Save out, and then either reload the terminal or just source the path file
source ~/.profile
VSCode (v1.18) now has better WSL support for Node:
I use nvm to install Node on Ubuntu, although it should work fine if you install it normally.
e.g.
nvm install 9.2.0
nvm alias default 9.2.0
From the VSCode docs
If you want to run Node.js in the Linux subsystem on Windows (WSL), you can use the approach from above as well. However to make this even simpler, we've introduced a useWSL flag to automatically configure everything so that Node.js runs in the Linux subsystem and source is mapped to files in your workspace.
Here is the simplest debug configuration for debugging hello.js in WSL:
{
"type": "node",
"request": "launch",
"name": "Launch in WSL",
"useWSL": true,
"program": "${workspaceFolder}/hello.js"
}
I opened bash outside of the vs code and run the following command, to install node.
sudo apt install nodejs-legacy
and I'm able to run node with bash in vs code.

How to enable Bash in Windows 10 developer preview?

I am using windows 10 developer preview Build 14295. From the Build conference I understood that we can enable bash in windows 10. But its not clear how to enable bash in windows 10.
Please find below the blog post for running bash in windows 10.
Link : http://www.hanselman.com/blog/DevelopersCanRunBashShellAndUsermodeUbuntuLinuxBinariesOnWindows10.aspx
After turning on Developer Mode in Windows Settings and adding the
Feature, run you bash and are prompted to get Ubuntu on Windows from
Canonical via the Windows Store
I enabled the developer mode. But I am not sure how to add a feature and run the bash. Kindly help.
To enable bash in Windows 10:
Click the Start button , click Control Panel, click Programs, and then click Turn Windows features on or off.
Enable Windows Subsystem for Linux
To get Bash installed, open Command Prompt and type “bash”
For More Information visit :
Announcing Windows 10 Insider Preview Build 14316
Run Bash on Ubuntu on Windows
In some cases, attempting to turn on Developer Mode on may crash the Settings app. If this happens, the workaround is to use these steps here to enable Developer Mode
The Bash feature isn't available on build 14295.
Scott answered a question that an update will be coming soon to insiders (Microsoft want to make sure everything is OK with this feature before pushing it to Insiders)
I've been chatting with a Microsoft Program Manager (Sarah Cooley) and she confirm that she have the Bash feature on Build 14311 (which isn't out for insiders yet)
You can see Scott's answer here: https://news.ycombinator.com/item?id=11394994.
Today it is available at Build 14316!
The announcement is at https://blogs.windows.com/windowsexperience/2016/04/06/announcing-windows-10-insider-preview-build-14316/
Step1: Enable Developer Mode (Settings - Update & security > For developers)
Step2: Search for “Windows Features” and choose “Turn Windows features on or off” and enable Windows Subsystem for Linux (Beta).
Step3: To get Bash installed, open Command Prompt and type “bash”
Step4: Bash will install required packages on windows you can start with windows bash
Step5: Install any package through apt-get install package_name
Happy Bash programming on windows!
Now, you don´t have to enable developer mode anymore, to run bash. Better security for you without having the dev. mode enabled.
download git bash to run bash commands on your windows file system
git-bash website

Installing a .bundle file in Fedora linux

So I am using Ozone OS which is basically just fedora with a cool theme, and a lot less crap installed. I tried installing VMWare Horizon view client from here: https://my.vmware.com/web/vmware/details?downloadGroup=VIEWCLIENTS_LINUX_32&productId=421&rPId=7320
and then i renamed the file to vmware.bundle, when i make it runnable with:
chmod +x vmware.bundle
i ran the file using:
./vmware.bundle
this is what happens in my terminal
VMWare Horizon Client is an x86 application but you are trying to install it to an x64 Linux.
To run this installation, you may need to install 32-bit runtime libraries. Do you want to proceed? (yes/no)yes
Extracting VMware Installer...done.
but when i try going to the application menu, I can find VMware anywhere
There is really no such thing as ".bundle" files on Fedora. The only format for installable software on Fedora are RPM files.
All that this ".bundle" file appears to be, is the vendor's custom installation script, that's all. It's not any kind of a standard packaging format, of any kind.
You will be able to find a newly-installed application on your application menu only if the application correctly installed a .desktop file in the right location. If this installation script did not do so, you won't get anything in the application menu.
It is the application script's responsibility to install a .desktop file in order for the application to appear in the application menu.
try running /bin/vmware
that is the default install location

Ubuntu Eclipse Icon Creation

I was tring to install eclipse on ubuntu. What I did:
I unzipped the tar archive of eclipse.
I tried to start eclipse from the command line - like this - ./eclipse. It works.
But then I tried to create a desktop icon with:
gnome-desktop-item-edit ~/Desktop --create-new.
In a new icon I showed the path to the eclipse executable which I could launch from the command line. But then eclipse does not start stating:
A Java Runtime Environment (JRE) or Java Development Kit (JDK)
must be available in order to run Eclipse. No Java virtual machine
was found after searching the following locations:
/home/artem/eclipse/jre/bin/java
java in your current PATH
And also I get a message in the terminal (at some stage it appeared):
(gnome-desktop-item-edit:8998): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.DSV8LW': No such file or directory
I am using Ubuntu 12.04 x32 and eclipse Juno.
PS. PATH variable points at jdk/bin and JAVA_HOME - to the jdk folder
You can make launch "icon" by using symlink:
ln -s [TARGET DIRECTORY OR FILE] [SHORTCUT]
You can do it just with Graphic interface
Right click on eclipse. Choose "Make link". You will get a short cut in the folder. Copy the shortcut to the Desktop. Done :)
P.s:
By the way, if you don't like default icon of the shortcut. They look all the same and ugly. Just right click on the shortcut and click on the small icon on the left, then choose an image icon which you like (E.g: Eclipse icon).

installing grails in linux

I am new to using Linux. I installed grails by setting env variable GRAILS_HOME and added ot to PATH variable. I also exported both and when I typed in grails command.. It worked fine. When I closed that terminal session and opened a another new session, all the env variables that I had set up has all gone.
I was wondering how to have them available for all sessions.
Any help is appreciated
Thanks
Edit the .bashrc file of the user launching Grails.
Add the same lines as your commands:
GRAILS_HOME=/home/of/grails
export GRAILS_HOME
PATH=$PATH:$GRAILS_HOME/bin
you need to add $GRAILS_HOME/bin to the PATH (rather than $GRAILS_HOME)
Update
The best way to install Grails on Linux/Mac is to use GVM.
GVM is a tool for managing parallel Versions of multiple Software Development Kits on most Unix based systems. It provides a convenient command line interface for installing, switching, removing and listing Candidates.
In addition to Grails, you can also use GVM to manage your installation of
Groovy
Griffon
Gradle
vert.x
If you have an Ubuntu (or equal) installation. You could add a repository to it. It should do all the stuff for you:
sudo add-apt-repository ppa:groovy-dev/grails
sudo apt-get update
sudo apt-get install grails
you need to set them under ~/.bashrc file and then type source ~/.bashrc in your terminal so you don't have to close and re-open it again.
In /etc/profile.d/ create a script name grails.sh:
export GRAILS_HOME=/opt/grails
export PATH=$GRAILS_HOME/bin:$PATH
Change /opt/grails to where you unzipped grails.
This will make it available for all users.
If you are on ubuntu define the GRAILS_HOME variable with its installation path in /etc/environment and edit the system path variable as shown in second line
GRAILS_HOME=/opt/grails
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/grails2/bin:"
Groovy Grails Installation:
Before starting up install JAVA on linux system
Check java version using command
$> java -version
Install grails on Linux using Installing-a-grails-development-environment-on-linux
Before installing grails will need to install GVM (Grails version manager) from GVM Tool Installation
After installation of GVM from the above link, we will be able to run Grails sample application. Check it out with command
$> grails -version
Check Environment variable is set or not for Java as well as Grails with command
$> printenv
Create demo application and run the server for Grails using:
$> grails create-app demo
Go to path
$> cd demo/
Run the server
$> grails run-app
Run the server on specific port 9090
$> grails run-app -Dserver.port=9090
Tools and running environment set up for Groovy Grails:
Install GGTS (Groovy Grails Tool Suit) using GGTS with Eclipse IDE and tool
Select Eclipse package on linux from the above link:
YouTube Video Tutorial:
All Grails documentation video tutorials for the installations and running sample application is present here YouTube Channel

Resources