Building a desktop launcher
I still use QuickSilver on my mac, despite there are multiple efforts attempting to displace it. There used to be one made for Linux, called Gnome Do, however the development eventually stopped. I settled for the built-in launcher in Gnome Shell, and then briefly moved on to rofi with this configuration.
One thing I liked a lot about Quicksilver is that I can somewhat “pipe” the result of an action to another operation, for example:
“Piping” in Quicksilver in action
For example, I can start by looking for a file DSCF8200.jpg then select an action Open With followed by selecting an application Preview. This is a flexibility that I don’t get with rofi and Gnome Shell.
Plus, I couldn’t even get rofi to run in a wayland session.
Finding a job is still looking like a long process (yes, still #OpenToWork here), just to distract my attention, I decided to start working on a simple launcher I would eventually start using. I would also take the opportunity to learn how to build a GUI application for real this time.
Considering that I am most comfortable with Python, I start with tkinter. However, I would start small and start the experiment with a CLI command. The building of the command, will serve as a blueprint for the launcher.
This is how RapidCopper started (sorry for the unimaginative name).
And yes, I am aware of the fact that tkinter GUI applications do not work in Wayland for now.
It is still in a very early stage, I am still prototyping things, and still figuring out the spec for the launcher. However, for now it does the things I want it to do.
The application still expects a setup, with
rc rebuild-index
This sets up the configuration in $HOME/.config/rapidcopper, with a sqlite3 database as the index, and a folder for plugins.
The do subcommand is the part where it does its job. I can launch an application
rc do fire
And it spits out a list of options
0 app: /home/jeffrey04/.local/share/applications/userapp-Firefox Developer Edition-EPEGV2.desktop - Custom definition for Firefox Developer Edition Firefox Developer Edition 1 app: /home/jeffrey04/.local/share/applications/firefox-developer.desktop - Firefox Aurora with Developer tools Firefox Developer Edition 2 app: /home/jeffrey04/.local/share/applications/userapp-Firefox Developer Edition-8CCQV2.desktop - Custom definition for Firefox Developer Edition Firefox Developer Edition Enter choice: :
Enter a number, press enter, and the corresponding application launches (via gtk-launcher, yes, this script is not portable).
I wanted to somewhat replicate the UX of quicksilver, so I made it aware of the pipe character |, though it looks ugly in practice.
rc do echo lorem ipsum dolor sit amet "|" clipboard
The specified text lorem ipsum dolor sit amet will then be copied to the clipboard. Unfortunately, I had to surround the pipe character with quotes so it will not be treated as a redirection in shell.
I am still figuring out the UX and specification, but for now it accomplished the main task where I want it to launch applications. After spending some time on it, and I reminded myself of Textual, where it offers an experience that resembles web front-end development. Currently, the TUI is still in development but seems to work similarly to the CLI counterpart.
It is hard to say what I expect out of it, as I am currently preparing to pick up some temporary part-time jobs while looking for the next project. This would greatly reduce the time and energy I have left for the project. The launcher does currently have a very basic support for plugins, but the API is subject to change.
The above is the detailed content of Building a desktop launcher. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Python is suitable for data science, web development and automation tasks, while C is suitable for system programming, game development and embedded systems. Python is known for its simplicity and powerful ecosystem, while C is known for its high performance and underlying control capabilities.

Python excels in gaming and GUI development. 1) Game development uses Pygame, providing drawing, audio and other functions, which are suitable for creating 2D games. 2) GUI development can choose Tkinter or PyQt. Tkinter is simple and easy to use, PyQt has rich functions and is suitable for professional development.

You can learn basic programming concepts and skills of Python within 2 hours. 1. Learn variables and data types, 2. Master control flow (conditional statements and loops), 3. Understand the definition and use of functions, 4. Quickly get started with Python programming through simple examples and code snippets.

Python is easier to learn and use, while C is more powerful but complex. 1. Python syntax is concise and suitable for beginners. Dynamic typing and automatic memory management make it easy to use, but may cause runtime errors. 2.C provides low-level control and advanced features, suitable for high-performance applications, but has a high learning threshold and requires manual memory and type safety management.

You can learn the basics of Python within two hours. 1. Learn variables and data types, 2. Master control structures such as if statements and loops, 3. Understand the definition and use of functions. These will help you start writing simple Python programs.

To maximize the efficiency of learning Python in a limited time, you can use Python's datetime, time, and schedule modules. 1. The datetime module is used to record and plan learning time. 2. The time module helps to set study and rest time. 3. The schedule module automatically arranges weekly learning tasks.

Python excels in automation, scripting, and task management. 1) Automation: File backup is realized through standard libraries such as os and shutil. 2) Script writing: Use the psutil library to monitor system resources. 3) Task management: Use the schedule library to schedule tasks. Python's ease of use and rich library support makes it the preferred tool in these areas.

Python is widely used in the fields of web development, data science, machine learning, automation and scripting. 1) In web development, Django and Flask frameworks simplify the development process. 2) In the fields of data science and machine learning, NumPy, Pandas, Scikit-learn and TensorFlow libraries provide strong support. 3) In terms of automation and scripting, Python is suitable for tasks such as automated testing and system management.
