How to create a desktop shortcut for RStudio on Ubuntu 22.04 - rstudio

Recently, I update my ubuntu to 22.04 LTS, however, my RStudio desktop shortcut disappear, how can I fix this problem or how to recreate a shortcut for RStudio?
I try to create a file rstudio.desktop, and add this to it.
[Desktop Entry]
Categories=Development;
Comment[zh_CN]=
Comment=
Exec=/usr/lib/rstudio/bin/rstudio
GenericName[zh_CN]=IDE
GenericName=IDE
Icon=/usr/lib/rstudio/rstudio.png
MimeType=
Name[zh_CN]=RStudio
Name=RStudio
Path=
StartupNotify=true
Terminal=false
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=xxxx
But I did not got it.

Related

macos OS X equivalent of Linux .desktop file

I have developed a set of shell scripts that work on Windows and Linux and would like to distribute them for macos 10.4 and following. (They are to help language development workers in minority languages keep their software up-to-date. You can read about the project at lingtransoft LangTran.)
I make the Windows installer with Inno Setup and the .deb file for Linux with EPM. I have been able to make a .pkg installer by running EPM on a Mac, and it installs the shell scripts to the right place, and they work properly when I run them from a Terminal window, but I would like to provide clickable icons. If I can work out the macos/OS X equivalent of a Linux .desktop file, I should be able to get the EPM package maker to install the launcher files in the right place.
For Linux, EPM will package my hand-crafted .desktop files and install them in the right place for them to appear in the menu. (Here is one of the .desktop files:
[Desktop Entry]
Name=LangTranUpdate
X-GNOME-FullName=LangTran Update Script
GenericName=Software Distribution System updater
Comment=For updating a local software repository
Path=/usr/local/langtran
Exec=/usr/local/langtran/LangTranUpdate.sh
Icon=/usr/local/langtran/Progs/LangTran-icon.ico
Terminal=true
Type=Application
Categories=Network
StartupWMClass=gpodder
)
The script needs to run in the folder /usr/local/langtran because it looks for other files in the same place, so the "Path" key is set to that. The Windows shortcut files work the same way.
Since macos doesn't have a START button to open a menu tree, I would like the installer to put clickable objects on the desktop so the user can drag them to the Dock if desired.
So my question is: How do I make the macos/OSX equivalent of a Linux .desktop file or a Windows shortcut?

How to change the default terminal in Manjaro?

I recently switched from ubuntu to Manjaro. On ubuntu I used Tilix and made it my default terminal emulator.
I did so with:
sudo update-alternatives --config x-terminal-emulator
Is there a way to set the default terminal emulator with Manjaro/Arch?
Edit:
I'm using Manjaro Gnome
I currently use manjaro (i3), and in the past have used manjaro preloaded with different desktop environments(gnome, xfce and KDE). One thing that I have observed is that the default terminal emulator depends on the preloaded desktop environment. Unfortunately, you have not provided which DE you use.
For gnome, you can execute:
gsettings set org.gnome.desktop.default-applications.terminal exec gnome-terminal
Make sure to replace gnome-terminal with your choice.
If you use xfce DE, then go to settings, then preferred application, then utilities tab and then change the terminal emulator from there.
If you use i3, you can either change the i3 config file located in ~/.i3/ and then change the binding for $mod+Return exec i3-sensible-terminal (Replace i3-sensible-terminal with your choice.) OR you can install xfce4-settings-manager using:
sudo pacman -S xfce4-settings
Then execute xfce4-settings-manager using menu ($mod+d) follow the steps as I mentioned for xfce desktop environment above.
Not really a solution, but a work-around that works for most of my use cases.
Adding a keyboard shortcut (under Settings → Devices → Keyboard) with:
Name: Launch Terminal
Command: tilix
Shortcut: Ctrl+Ctrl+T
If you are on KDE:
I am currently using Manjaro with KDE version 5.26.4. For me I went into Settings --> Applications --> Default Applications.
From there you can select the Terminal emulator of your choice from the drop-down menu.

Duck Spyder as a launcher which is installed through Anaconda on Ubuntu17.4

After installing Anaconda(3 or higher) it includes Spyder. So it isn't known as an independent application. The problem with this kind of having Spyder is that Ubuntu doesn't allow to Duck it or add a Spyder shortcut on Desktop or add it as a Favorite. Therefore, every time I need to run Spyder, I have to run it through command line: $ spyder which is not the best and a fast way to run it.
On the other hand, I already have spyder and based on it's official website is not recommended to have it double installed: https://pythonhosted.org/spyder/installation.html
So I need a way which allows me to have a shortcut for my Spyder on Desktop or Favorites list or on Duck.
after searching a lot, here is what has worked for me: Copy any launcher from:
/usr/share/applications/.
Right click and go to properties, change the command line to spyder path:
~/anaconda3/bin/spyder or ~/anaconda/bin/spyder
Note: You can get the correct spyder path by typing: $ which spyder
Change the rest of the info like description and icon path as you like.
Save the file under something like spyder.desktop in order to set it as a desktop configuration file.
Now you have a app launcher which is connected to spyder (in Anaconda), copy the launcher to:
~/.local/share/applications/
Now the icon should pop up in your application menu.
Note: You should set the user as the owner. So this is the last step:
sudo chown <username> ~/.local/share/applications/spyder.desktop

Recreating PyCharm launcher in Ubuntu

I installed pycharm normally via bin/pycharm.sh, but the mistake I made was doing bash pycharm.sh while the pycharm directory has inside the Downloads folder.
I later on moved the directory to /opt/Pycharm/. This is causing the once functioning unity launcher (which was added when PyCharm was initially installed) to fail every time I attempt to use it (as expected).
How can I re-add pycharm.sh as a lauchable app from the unity launcher? I know the location of the pycharm.sh file. I've tried to add it to /usr/bin/ but that does not change anything.
I can still launch pycharm via bash /usr/opt/Pycharm/bin/Pycharm.sh. But this is tedious.
UPDATE
I have tried making a new .desktop file for pycharm, using the following script:
[Desktop Entry]
Encoding=UTF-8
Name=PyCharm
Exec=/opt/Pycharm-3.0.1/bin/pycharm.sh
Icon=/opt/Pycharm-3.0.1/bin/PyCharm_32.png
Type=Application
Categories=Development;
StartupWMClass=PyCharm
However, I get a "Unable to save Pycharm.desktop" error when I try to save the file inside /usr/share/applications/pycharm.desktop. Any help regarding this would be deeply appreciated.
First start pyCharm from it's bin folder via command line
$ ./pycharm.sh
Then, goto
Tools -> Create Desktop Entry.
It will create a correct Desktop file in the correct place. Afterward you can initiate it from the menu and pin the icon or drag and drop it to the bar. This way, you don't have to deal with .desktop files and mumbo jumbo..
I managed to solve it. The thing is, Pycharm already installs a launcher inside .local/share/applications. Thus, you need to get rid of it before proceeding to create your own. After that, all you have to do is add your own *.desktop file to the applications directory inside usr/share/applications/.
You need to create your .desktop file using sudo and inside the desktop file:
[Desktop Entry]
Encoding=UTF-8
Name=PyCharm
Exec=/opt/pycharm-3.0.1/bin/pycharm.sh
Icon=/opt/pycharm-3.0.1/bin/pyCharm.png # Changed from pycharm_32.png
Type=Application
Categories=Development;
StartupWMClass=PyCharm
After that is done, you can launch your app properly. Please note that pycharm.sh must also have execution rights.
With Ubuntu 16.04, I used the "snap" installer, which doesn't include an easily accessible icon (there's probably one hidden inside the snap image, but it's hard to get at). Instead it shows a grey question mark icon in the launcher instead. Also there doesn't seem to be a Tools > Create Desktop Entry option in version 2017.3.3 as far as I can see - maybe it has been moved somewhere.
So I copied pycharm.png from an earlier non-snap Community installation, saved it somewhere, then created ~/.local/share/applications/jetbrains-pycharm-ce.desktop:
[Desktop Entry]
Version=1.0
Type=Application
Name=PyCharm Community Edition
Icon=/path/to/pycharm.png
Exec="/snap/bin/pycharm-community" %f
Comment=The Drive to Develop
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-pycharm-ce
Then when I start PyCharm (from the command line), the launcher item appears with the correct icon, and then I right-click on it and choose "Lock to Launcher", and it now persists.
A downside is that the icon will not be automatically updated with the app, so it might fall out of date.
In case you just want to update your launcher to point to an updated PyCharm, for me changing 4.0.4 to 4.0.6 in the following worked:
nano /usr/share/applications/jetbrains-pycharm.desktop
When Tools -> Create Desktop Entry does not work:
Create a new file on your desktop (using vi or a similar command) named: jetbrains-pycharm.desktop
Paste the following inside:
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Name=PyCharm
Icon=/opt/pycharm-5.0.1/bin/pycharm.png
Exec="/opt/pycharm-5.0.1/bin/pycharm.sh" %f
Comment=Develop with pleasure!
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-pycharm
Keep in mind to change the path and version number of icon and exec properties above.
Tested on various versions of PyCharm - like a charm ☺
In the 2016 version of PyCharm just do following:
Start PyCharm.
From the Tools menu, select "Create Desktop Entry..."
Create entry for "all the users" if required.
Relaunch PyCharm from Launcher.
Ubuntu 16.04 (haven't checked prior versions)
Run pycharm.sh (make sure you use the correct dir and PyCharm version below):
$ ./dir_where_you_placed_it/pycharm-2016.1.4/bin/pycharm.sh
While PyCharm is running, right click its icon on the Launcher and select "lock to Launcher".
Run $ pycharm-community
Right after you will see the icon on the taskbar.
Right Click, select Lock on the Taskbar.
Somewhat solves the problem.
Simply replaced the Icon=/path/to/pycharm.pngin ~/.local/share/applications/jetbrains-pycharm-ce.desktop from meowsqueak's answer with the correct path when installed from snap.
[Desktop Entry]
Version=1.0
Type=Application
Name=PyCharm Community Edition
Icon=/snap/pycharm-community/current/bin/pycharm.png
Exec="/snap/bin/pycharm-community" %f
Comment=The Drive to Develop
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-pycharm-ce
sudo vim `which charm`
Now edit the RUN_PATH.
I recently resolved a related issue where, after updating from v2.7 to v3.0.2, my PyCharm launcher was still pointing to the old (and now deleted) PyCharm path.
After attempting all of the (good) advice above, the problem still persisted.
The solution, in my case, was to create a desktop entry for ALL USERS.
[Welcome Screen]->Configure->Create Desktop Entry...
Check the box: "Create entry for all users" and then proceed.
Apparently, in a previous installation I must have installed it in this fashion and was not able to update the launcher for a single account.
Now the pycharm updated to version 2016.1 and I find the file jetbrains-pycharm.desktop in the path ~/.local/share/applications
then just edit the path for Icon and Exec
Simply type this on your terminal window:
jetbrains-pycharm.desktop
Hope that helps :)
I just wanted to add, I just installed PyCharm Edu for Ubuntu 16.04 LTS today, and the way to create a desktop entry is very easy. When PyCharm Edu opens up, before entering any project, click on configure, and there should be a create Desktop Entry option. Select it, and it will create a PyCharm Edu.desktop file in the following directory:
/usr/local/share/applications
Now traverse to that destination, and click the newly created PyCharm Edu.desktop file to launch PyCharm Edu. After that, you would just need to lock to launcher. It should work.
I know I am very late, but I hope I've helped those of us on Ubuntu 16.04 LTS who are trying to configure a desktop entry for this specific application.
I guess you didn't check 'Create the entry for all users (requires superuser privileges)' option on Tools -> Create Desktop Entry. You should check it.
You don't have to create something new.
you can always use python for automation
may be this will help you
a python script that allows u to run pycharm as user or sudoers/root
import os
from time import sleep
sleep(1)
program = input('which program to run: >')
if program == "pycharm":
os.chdir('#full path to pycharm paste here')
root = input('run as root(y/n): >')
if root == 'y':
print('started ' + program + ' as root')
sleep(0.5)
print('please enter root password to continue:')
os.system('sudo ./pycharm.sh')
elif root == 'n':
print('running ' + program + ' as non root')
os.system('./pycharm.sh')
elif program != 'pycharm':
print('program not found')
I have an LXDE desktop (on Debian Buster) and using PyCharm CE 2020.2.3. Choosing Create Desktop Entry... created nothing on the desktop, no matter whether Create the entry for all users was checked or not.
However, the PyCharm menu entry (under Programming) offers a context menu entry Add to desktop. Clicking this finally made the desktop icon appear.

Creating a Desktop shortcut Eclipse on Linux Mint

I installed Eclipse using the Software Manager (mintInstall) on Linux Mint 15. I am trying to create an Eclipse shortcut on my Desktop via Terminal. I looked it up and found out about the mkshct command. However, I have the following problems:
Where did the Software Manager install Eclipse? (Other applications on too while on this topic)
Am I on the right track using mkshct?
How I solved this issue:
Open the downloaded file (it will have eclipse, eclipse.ini, epl-v10.html, etc.)
Right click on the eclipse file (the same file that launches Eclipse) and click on Make a Link, than drag the link to your desktop.
The Eclipse package also contains icon.xpm if you want to change the link/desktop icon.
Maybe it is in /opt/eclipse/.
P.S. Download from eclipse.org new version and you can run eclipse without installing from the folder.
If you open the Start Menu option on the bottom right, search for Eclipse.
Once you find it (normally found under 'Development') just drag the icon to the desktop and a shortcut will be made for it.
CLI approach:
% which eclipse
% /xxxxxx/xxxxx/xxxxx/xxxx/eclipse
% ln -s /xxxxxx/xxxxx/xxxxx/xxxx/eclipse /yyyy/yyyy/yyyy
where /xxxxxx/xxxxx/xxxxx/xxxx/eclipse is output of % which eclipse and /yyyy/yyyy/yyyy is where you want symbolic-link(shortcut)
we type "which eclipse" to know where your eclipse is installed
first check Eclipse path $ which eclipse
1. $ sudo apt install gedit
2. $ cd Desktop
3. $ touch eclipse.desktop
4. $ gedit eclipse.desktop
5.
syntax:
[Desktop Entry]
Type=Application
Name=Name of your application
Icon=/path/to/icon
Exec=/path/to/application
You have to edit Name, Icon and Exec
[Desktop Entry]
Type=Application
Name=eclipse
Icon=/home/mypc/SOFTWARES/eclipse/icon.xpm
Exec=/home/mypc/SOFTWARES/eclipse/eclipse
Make it executable
chmod u+x eclipse.desktop

Resources