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