#!/usr/bin/env perl use strict; use warnings; 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" . "Qalculate!" . "\n" . "Kleopatra" . "\n" . "Transmission" . "\n" . "Wireshark" . "\n" . "MKVToolNix" . "\n" . "Google Earth" . "\n" . "--- Editors ---" . "\n" . "NeoVim" . "\n" . "Emacs" . "\n" . "Emacs-NoX" . "\n" . "--- Graphics ---" . "\n" . "GIMP" . "\n" . "Inkscape" . "\n" . "--- Internet ---" . "\n" . "LibreWolf" . "\n" . "Firefox" . "\n" . "Iridium" . "\n" . "Chromium" . "\n" . "Discord" . "\n" . "Signal" . "\n" . "Liferea" . "\n" . "HexChat" . "\n" . "" ; use constant WORK_LIST => "" . "--- Work ---" . "\n" . "Remmina" . "\n" . "Rclone Browser" . "\n" . "Insomnia" . "\n" . "VMware" . "\n" . "DBeaver" . "\n" . "Miro" . "\n"; sub run { my ($action) = @_; my $pid; chomp($action); # Terminal if ($action eq "Terminal") { $pid = fork(); exit if $pid; setsid(); exec("alacritty"); } # File manager elsif ($action eq "File manager") { $pid = fork(); exit if $pid; setsid(); exec("pcmanfm"); } # Web browser elsif ($action eq "Web browser") { $pid = fork(); exit if $pid; setsid(); exec("librewolf"); } # Mail client elsif ($action eq "Mail client") { $pid = fork(); exit if $pid; setsid(); exec("thunderbird"); } # --- Accessories --- # Qalculate! elsif ($action eq "Qalculate!") { $pid = fork(); exit if $pid; setsid(); exec("qalculate-gtk"); } # Kleopatra elsif ($action eq "Kleopatra") { $pid = fork(); exit if $pid; setsid(); exec("kleopatra"); } # Transmission elsif ($action eq "Transmission") { $pid = fork(); exit if $pid; setsid(); exec("transmission-gtk"); } # Wireshark elsif ($action eq "Wireshark") { $pid = fork(); exit if $pid; setsid(); exec("doas", "wireshark"); } # MKVToolNix elsif ($action eq "MKVToolNix") { $pid = fork(); exit if $pid; setsid(); exec("mkvtoolnix-gui"); } # Google Earth elsif ($action eq "Google Earth") { $pid = fork(); exit if $pid; setsid(); exec("google-earth-pro"); } # --- Editors --- # NeoVim elsif ($action eq "NeoVim") { $pid = fork(); exit if $pid; setsid(); exec("alacritty", "-e", "nvim"); } # Emacs elsif ($action eq "Emacs") { $pid = fork(); exit if $pid; setsid(); exec("emacs"); } # Emacs-NoX elsif ($action eq "Emacs-NoX") { $pid = fork(); exit if $pid; setsid(); exec("alacritty", "-e", "emacs-nw"); } # --- Graphics --- # GIMP elsif ($action eq "GIMP") { $pid = fork(); exit if $pid; setsid(); exec("gimp"); } # Inkscape elsif ($action eq "Inkscape") { $pid = fork(); exit if $pid; setsid(); exec("inkscape"); } # --- Internet --- # LibreWolf elsif ($action eq "LibreWolf") { $pid = fork(); exit if $pid; setsid(); exec("librewolf"); } # Firefox elsif ($action eq "firefox") { $pid = fork(); exit if $pid; setsid(); exec("firefox"); } # Iridium elsif ($action eq "Iridium") { $pid = fork(); exit if $pid; setsid(); exec("iridium", "--force-dark-mode"); } # Chromium elsif ($action eq "Chromium") { $pid = fork(); exit if $pid; setsid(); exec("chromium"); } # Discord elsif ($action eq "Discord") { $pid = fork(); exit if $pid; setsid(); exec("discord"); } # Signal elsif ($action eq "Signal") { $pid = fork(); exit if $pid; setsid(); exec("signal-desktop"); } # Liferea elsif ($action eq "Liferea") { $pid = fork(); exit if $pid; setsid(); exec("liferea"); } # --- Work --- # Remmina elsif ($action eq "Remmina") { $pid = fork(); exit if $pid; setsid(); exec("remmina"); } # Rclone Browser elsif ($action eq "Rclone Browser") { $pid = fork(); exit if $pid; setsid(); exec("rclone-browser"); } # Insomnia elsif ($action eq "Insomnia") { $pid = fork(); exit if $pid; setsid(); exec("insomnia"); } # VMware elsif ($action eq "VMware") { $pid = fork(); exit if $pid; setsid(); exec("vmware"); } # DBeaver elsif ($action eq "DBeaver") { $pid = fork(); exit if $pid; setsid(); exec("dbeaver"); } # Miro elsif ($action eq "Miro") { $pid = fork(); exit if $pid; setsid(); exec("miro"); } 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 25 -m 0 <