DEV Community

Yinebeb Tariku
Yinebeb Tariku

Posted on

Enhance Your Workflow with Desktop Shortcuts

Good day, folks;
I was experiencing an always-repetitive task each morning and sometimes in the afternoon too. Starting the workday by opening the same applications and services every morning and afternoon can become tiresome. Each time I powered on my laptop, I found myself going through the same motions-launching Visual Studio Code, IntelliJ, and starting up the required services on terminal.

Today, I will show my first fix-solution with a simple yet powerful script.

Script is a text file that contains a sequence of commands for a UNIX-based operating system.

As a Linux user, you might be familiar with using the terminal for various operations, but did you know that you can streamline your workflow further by creating desktop shortcuts? In this blog post, I will show you the necessity and importance of desktop shortcuts on Linux and how they can make your life easier.

Desktop shortcuts provide a convenient way to access frequently used applications, scripts, or commands with a single click. They eliminate the need to remember and type complex commands every time you want to perform a specific task. Imagine having a long series of commands that you use regularly to start your development environment, open projects, or perform system maintenance. With desktop shortcuts, you can simplify these operations and save valuable time.

We can leverage .desktop files, which are text-based configuration files. These files contain metadata about the application, including its name, command to execute, icon, and categories.

For instance, let’s create a desktop shortcut to start a local development server.
Script file:

!/bin/bash
sudo service nginx stop
sudo service apache2 restart
gnome-terminal --working-directory=/home/yinebeb/path/to/myapp/
code /home/yinebeb/path/to/myapp/

Desktop entry file:


[Desktop Entry]
Name=eTech-erp
Comment=stop Nginx, restart Apache2, open Terminal, Code and GoLand
Exec=/bin/bash /home/yinebeb/path/to/myapp.sh
Icon=/home/yinebeb/path/to/logo.png
Terminal=false
Type=Application
Categories=Utility;Development;

Save the script file with .sh extension as in myapp.sh and the desktop with .desktop as in myapp.desktop. Move the desktop entry file to .local/share/applications

Now make these file privilege to executable by running following commands:

$sudo chmod +x myapp.sh
$sudo chmod +x myapp.desktop

After this, you can access your app on the start menu, just press the supper key, type your app name, e as in eTech-erp, the name in the desktop entry.

Conclusion

By creating shortcuts to commonly used applications and scripts, you can save time, boost productivity, and maintain a well-organized work environment. If you find yourself bogged down by repetitive tasks, consider creating a simple script to automate your routine. Embrace the power of automation and set yourself free to explore new horizons in your daily work life.

Stay tuned for more tips and tricks!

ደህና ሁኑ | good bye!

Top comments (0)