#!/usr/bin/env perl use strict; use warnings; use feature qw/switch/; use Data::Dump qw(dump); use POSIX qw(setsid); use Sys::Hostname qw(hostname); use constant PROG_LIST => "" . "Terminal" . "\n" . "File manager" . "\n" . "Web browser" . "\n" . "Mail client" . "\n" . "--- Accessories ---" . "\n" . "Arduino" . "\n" . "cool-retro-term" . "\n" . "Qalculate!" . "\n" . "Kleopatra" . "\n" . "Transmission" . "\n" . "Wireshark" . "\n" . "MKVToolNix" . "\n" . "Stellarium" . "\n" . "Google Earth" . "\n" . "DBeaver" . "\n" . "OnlyOffice" . "\n" . "--- Editors ---" . "\n" . "NeoVim" . "\n" . "Emacs" . "\n" . "Emacs-NoX" . "\n" . "--- Graphics ---" . "\n" . "GIMP - GNU Image Manipulation Program" . "\n" . "Inkscape" . "\n" . "--- Internet ---" . "\n" . "LibreWolf" . "\n" . "Firefox" . "\n" . "Iridium" . "\n" . "Chromium" . "\n" . "Discord" . "\n" . "Signal" . "\n" . "Liferea" . "\n" . "HexChat" . "\n" . "--- Audio ---" . "\n" . "REAPER" . "\n" . "Audacity" . "\n" . "Pulse Control Panel" . "\n" . "JACK Audio Connection Kit" . "\n" . "--- Multimedia ---" . "\n" . "Ario" . "\n" . "Kdenlive" . "\n" . "OBS Studio" . "\n" . "--- Games ---" . "\n" . "Steam" . "\n" . "Lutris" . "\n" . "GZDoom" . "\n" . "DOSBox" . "\n" . "Mupen64Plus" . "\n" . "Cemu" . "\n" . "PCSX2" . "\n" . "RPCS3"; use constant WORK_LIST => "" . "--- Work ---" . "\n" . "Remmina" . "\n" . "Rclone Browser" . "\n" . "Insomnia" . "\n" . "VMware" . "\n" . "MongoDB Compass" . "\n" . "Miro" . "\n" . "FortiClient VPN" . "\n" . "Teams"; sub run { my ($action) = @_; my $pid; chomp($action); $pid = fork(); exit if $pid; setsid(); exec("alacritty") if $action =~ "Terminal"; exec("pcmanfm") if $action =~ "File manager"; exec("firefox") if $action =~ "Web browser"; exec("thunderbird") if $action =~ "Mail client"; exec("arduino-ide") if $action =~ "Arduino"; exec("cool-retro-term") if $action =~ "cool-retro-term"; exec("qalculate-gtk") if $action =~ "Qalculate!"; exec("kleopatra") if $action =~ "Kleopatra"; exec("transmission-gtk") if $action =~ "Transmission"; exec("doas", "wireshark") if $action =~ "Wireshark"; exec("mkvtoolnix-gui") if $action =~ "MKVToolNix"; exec("stellarium") if $action =~ "Stellarium"; exec("google-earth-pro") if $action =~ "Google Earth"; exec("alacritty", "-e", "nvim") if $action =~ "NeoVim"; exec("emacs") if $action =~ "Emacs"; exec("alacritty", "-e", "emacs-nw") if $action =~ "Emacs-NoX"; exec("gimp") if $action =~ "GIMP - GNU Image Manipulation Program"; exec("inkscape") if $action =~ "Inkscape"; exec("librewolf") if $action =~ "LibreWolf"; exec("firefox") if $action =~ "Firefox"; exec("iridium", "--force-dark-mode") if $action =~ "Iridium"; exec("chromium") if $action =~ "Chromium"; exec("discord") if $action =~ "Discord"; exec("signal-desktop") if $action =~ "Signal"; exec("liferea") if $action =~ "Liferea"; exec("hexchat") if $action =~ "HexChat"; exec("reaper") if $action =~ "REAPER"; exec("audacity") if $action =~ "Audacity"; exec("pavucontrol") if $action =~ "Pulse Control Panel"; exec("qjackctl") if $action =~ "JACK Audio Connection Kit"; exec("ario") if $action =~ "Ario"; exec("kdenlive") if $action =~ "Kdenlive"; exec("obs") if $action =~ "OBS Studio"; exec("steam") if $action =~ "Steam"; exec("lutris") if $action =~ "Lutris"; exec("gzdoom") if $action =~ "GZDoom"; exec("dosbox") if $action =~ "DOSBox"; exec("mupen64plus-qt") if $action =~ "Mupen64Plus"; exec("cemu") if $action =~ "Cemu"; exec("pcsx2") if $action =~ "PCSX2"; exec("rpcs3") if $action =~ "RPCS3"; exec("remmina") if $action =~ "Remmina"; exec("rclone-browser") if $action =~ "Rclone Browser"; exec("insomnia") if $action =~ "Insomnia"; exec("vmware") if $action =~ "VMware"; exec("dbeaver") if $action =~ "DBeaver"; exec("onlyoffice-desktopeditors") if $action =~ "OnlyOffice"; exec("nixGL", "mongodb-compass") if $action =~ "MongoDB Compass"; exec("miro") if $action =~ "Miro"; exec("/opt/forticlient/gui/FortiClient-linux-x64/FortiClient") if $action =~ "FortiClient VPN"; exec("nixGL", "teams-for-linux") if $action =~ "Teams"; return; } sub main { my $action; my $prompt; my $color; $color = '#cc241d'; if (@ARGV == 1) { $color = $ARGV[0]; } $prompt = PROG_LIST; if (hostname() eq "po-rbo.ln.ysosecure.com") { $prompt .= WORK_LIST; } $action = `dmenu -i -l 100 -sb '$color' -shb '$color' <