From 20e7cba41d0355af958be3f716a8b5047e91cd88 Mon Sep 17 00:00:00 2001
From: Joe <rrbo@proton.me>
Date: Mon, 19 Jun 2023 14:08:15 +0200
Subject: up

---
 .local/bin/dmapps | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 65 insertions(+), 3 deletions(-)

diff --git a/.local/bin/dmapps b/.local/bin/dmapps
index b8cc3b4..2e210b7 100755
--- a/.local/bin/dmapps
+++ b/.local/bin/dmapps
@@ -3,19 +3,33 @@
 use strict;
 use warnings;
 use Data::Dump qw(dump);
+use Env qw(TERMINAL);
 use POSIX qw(setsid);
-use Sys::Hostname;
+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";
+"MKVToolNix"			. "\n" .
+"Google Earth"			. "\n" .
+"--- Editors ---"		. "\n" .
+"NeoVim"				. "\n" .
+"Emacs"					. "\n" .
+"Emacs-NoX"				. "\n" .
+""	;
+use constant WORK_LIST	=> "" .
+"--- Work ---"	. "\n" .
+"Remmina"		. "\n" .
+"Insomnia"		. "\n" .
+"VMware"		. "\n" .
+"miro"			. "\n";
 
 sub run
 {
@@ -44,6 +58,13 @@ sub run
 		setsid();
 		exec("librewolf");
 	}
+	# Mail client
+	elsif ($action eq "Mail client") {
+		$pid = fork();
+		exit if $pid;
+		setsid();
+		exec("thunderbird");
+	}
 	# --- Accessories ---
 	# Qalculate!
 	elsif ($action eq "Qalculate!") {
@@ -73,6 +94,42 @@ sub run
 		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");
+	}
 	return;
 }
 
@@ -82,7 +139,12 @@ sub main
 	my $prompt;
 
 	$prompt = PROG_LIST;
-	$action = `printf "$prompt" | dmenu -i -l 25 -m 0`;
+	if (hostname() eq "po-rbo.ln.ysosecure.com") {
+		$prompt .= WORK_LIST;
+	}
+	$action = `dmenu -i -l 25 -m 0 <<LIST
+$prompt
+LIST`;
 	if (not $action) {
 		return;
 	}
-- 
cgit v1.2.3