Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 1560  / 2 Years ago, mon, february 14, 2022, 6:30:33

Redcar is a graphical application that is installed via a Ruby gem, and I have installed it in a Ruby environment that is managed by RVM.



A launcher icon isn't automatically installed, so I need to create one myself. I've tried using Unity's "Keep in launcher" option for the icon that is displayed while Redcar is running:



Redcar and Unity



But when I exit Redcar and then click the launcher icon, the icon only flashes and Redcar does not open.



How can I create a working launcher icon?



I tried creating ~/.local/share/applications/redcar.desktop with the following contents:



[Desktop Entry]
Type=Application
Version=1.0
Name=Redcar
Comment=A programmer's text editor written in Ruby!
Icon=/home/ak/.rvm/gems/ruby-1.9.2-p290/gems/redcar-0.11/share/icons/redcar-icon-beta.png
Exec=/home/ak/.rvm/gems/ruby-1.9.2-p290/bin/redcar
Categories=Development;IDE;


The file is executable and is shown with the Redcar icon when I browse to ~/.local/share/applications in Nautilus, but nothing happens when I double-click it. Redcar runs fine when I enter /home/ak/.rvm/gems/ruby-1.9.2-p290/bin/redcar in a terminal.


More From » launcher

 Answers
5

Ruby gems are installed to ~/.rvm/gems/ruby-$version@$gemset/ with RVM.



First, download this icon and save to ~/.local/share/icons/redcar.png.



Now, save the following to ~/bin/redcar.sh and make it executable with chmod +x ~/bin/redcar.sh.



#!/bin/bash
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then

# First try to load from a user install
source "$HOME/.rvm/scripts/rvm"

elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then

# Then try to load from a root install
source "/usr/local/rvm/scripts/rvm"

else

printf "ERROR: An RVM installation was not found.
"

fi

rvm use 1.9.3@redcar-install
gem install redcar
redcar


Now, you'll need to create a desktop file manually pointing to the correct executable and icon. It should look something like:



[Desktop Entry]
Type=Application
Version=1.0
Name=Redcar
Comment=A programmer’s text editor written in Ruby and Java.
Icon=~/.local/share/icons/redcar.png
Exec=~/bin/redcar.sh
Categories=Development;IDE;


Place it in ~/.local/share/applications/redcar.desktop It should then show up in the dash search, and then you should be able to drag it to the Launcher.


[#43340] Tuesday, February 15, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ranquctive

Total Points: 391
Total Questions: 103
Total Answers: 104

Location: South Sudan
Member since Thu, Feb 4, 2021
3 Years ago
ranquctive questions
;