A programmable scratchpad
Notepad Plus
Boop, a digital scratchpad, lets you convert data from your desktop instead of exposing confidential data online. You can even extend Boop with your own functions using JavaScript.
If you need to count words or lines of text, calculate checksums and hashes, optimize program code, or perform any other conversion function, you can easily find an online source to do just that. However, you may not want to copy and paste confidential data to a potentially dubious website.
Instead, Boop [1], a digital notepad that can be scripted, performs this task locally. The open source program originally developed for macOS supports typing or pasting text via clipboard. At the touch of a button, a variety of predefined scripts or even your own small programs can then be applied to the entered text. This means that all the data stays on your computer, and you can save yourself the trouble of searching for the right utility online.
With the release of Boop-GTK [2], a port to the GTK toolkit, Linux and Windows users can now use Boop. The still very young application is not currently listed in the package sources of the major Linux distributions, with the exception of a boop-gtk entry in the Arch User Repository (AUR) for Arch Linux. Users of other distributions need to build the program from the source code or use the Snap [3] or Flathub packages [4] provided by the project.
Scriptable
Fundamentally, Boop works the same way regardless of the task: Copy text or code into the application window or type directly in the editor area, and then activate the script dialog via Ctrl+Shift+P. In the subsequent selection dialog, you can choose between (as of the editorial deadline) 59 different scripts (Figure 1).
The scope of these scripts ranges from Add Slashes (which prepends a backslash to certain special characters like ', ", \, or NUL) to a feature that makes converting localization strings between iOS and Android formats easier. The search field in the dialog header lets you easily filter out a specific function.
For example, web developers can clean up CSS files with Format CSS, prepare text for websites using HTML Decode and HTML Encode, or compress CSS markup via Minify CSS. You can then use Format CSS again to transform the optimized CSS code back into a readable format (Figure 2).
Developers who specialize in programming applications can use Eval Javascript to execute JavaScript directly in the context of Boop and view the output (Figure 3). Similar to CSS code, Boop can also minimize JSON and XML and unpack them accordingly, as well as transform JSON into various other formats.
Various text functions like Camel Case, Kebab Case (all words connected by minus signs), Snake Case (connected with an underscore), Sponge Case (random uppercase/lowercase), Markdown Quote, Reverse Lines, and Reverse String complete the repertoire for editors. If required, MD5 checksums or hash values (SHA-1, SHA-256, and SHA-512) can also be calculated for the entered data.
Add Your Own
If you are missing a certain function, it can be integrated -- with the appropriate know-how -- directly into Boop. For this purpose, the Open Config Directory option in the hamburger menu in the upper right corner opens a file manager with the ~/.config/boop-gtk folder. Boop automatically loads JavaScript files stored in the scripts/ subfolder into the application at program launch time.
For suggestions and details on how the scripts work, use the Get More Scripts menu item. It loads the GitHub repository maintained by the original Boop developer in your browser. You will find a number of scripts that have not yet made it directly into the program [5]. You can use these examples as a template to write your own script.
The Boop project also shows an example script on its homepage: The Poopificator randomly replaces words with a poop emoji [6] -- if that's a function you need. To do this, transfer the contents from Listing 1 to a new file named poop.js, and then move it to ~/.config/boop-gtk/scripts/. After restarting Boop, you will find a new entry named Poopificator under the action drop-down menu.
Listing 1:
Listing 1
poop.js
01 /** 02 { 03 "api":1, 04 "name":"Poopificator", 05 "description":"Swaps random words with poop emojis.", 06 "author":"Ivan", 07 "icon":"html", 08 "tags":"poop,emoji,hashtag" 09 } 10 **/ 11 12 const poopFactor = 0.2 13 14 function main(state) { 15 var all = state.fullText.split(" ") 16 state.fullText = all.map(x => r() ? x : "& 128169;”).join(" ") 17 } 18 19 function r() { 20 return Math.random() >= poopFactor 21 }
The Poopficator action now replaces random words with the HTML code & #128169;. You then use a second action, HTML Decode, to turn the HTML snippets into the desired emoji (Figure 4). The script in Listing 1 requires the second action, because Linux Magazine uses typesetting software that does not allow this type of special character. If you transfer the script directly from Boop's project page, the second action is unnecessary.
Conclusions
If you rely on web services for one or more functions discussed here, Boop offers a useful local solution. The program works without Internet access, requires fewer resources than a web browser, and all data remains on your computer. In addition, the Boop community continually adds new functions. And if you can't find the function you need, you can add your own scripts with some basic programming knowledge.
Infos
- Boop: https://boop.okat.best/
- Boop-GTK: https://github.com/mrbenshef/Boop-GTK
- Boop on Snapcraft: https://snapcraft.io/boop-gtk
- Boop on Flathub: https://flathub.org/apps/details/fyi.zoey.Boop-GTK
- More Boop scripts: https://github.com/IvanMathy/Boop/tree/main/Scripts
- Pile of Poo: https://emojipedia.org/pile-of-poo
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.
-
ZorinOS 17.1 Released, Includes Improved Windows App Support
If you need or desire to run Windows applications on Linux, there's one distribution intent on making that easier for you and its new release further improves that feature.
-
Linux Market Share Surpasses 4% for the First Time
Look out Windows and macOS, Linux is on the rise and has even topped ChromeOS to become the fourth most widely used OS around the globe.
-
KDE’s Plasma 6 Officially Available
KDE’s Plasma 6.0 "Megarelease" has happened, and it's brimming with new features, polish, and performance.
-
Latest Version of Tails Unleashed
Tails 6.0 is based on Debian 12 and includes GNOME 43.
-
KDE Announces New Slimbook V with Plenty of Power and KDE’s Plasma 6
If you're a fan of KDE Plasma, you'll be thrilled to hear they've announced a new Slimbook with an AMD CPU and the latest version of KDE Plasma desktop.
-
Monthly Sponsorship Includes Early Access to elementary OS 8
If you want to get a glimpse of what's in the pipeline for elementary OS 8, just set up a monthly sponsorship to help fund its continued existence.
-
DebConf24 to be Held in South Korea
Busan will be the location of the latest DebConf running July 28 through August 4