Create a gist now

Instantly share code, notes, and snippets.

Run *.desktop files (usually located under ~/.local/share/applications) from the command-line. This is only a bare-bones omplementation. Useful on a Mac. See .
use strict;
my $cmd;
my $path;
while (<>) {
if (/^Exec=(.*)/) {
$cmd = $1;
$cmd =~ s{\\\\}{\\}g;
$cmd =~ s{\\`}{`}g;
$cmd =~ s{\\\$}{\$}g;
if (/^Path=(.*)/) {
$path = $1;
if ($cmd) {
if ($path) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment