#!/usr/bin/env perl use strict; use warnings; use Sys::Hostname; # debug use Data::Dumper; use constant { BROWSER => '/bin/firefox', HOSTNAME => (split /\./, hostname())[0] }; use constant LIST => { graf => 'http://graf.joe.town/', zhinu => 'https://zhinu.jozan.org/', perplexity => 'https://perplexity.ai/', chatgpt => 'https://chatgpt.com/', discord => 'https://discord.com/', protondb => 'https://www.protondb.com/', nua_grafana => 'https://grafana.nuabee.fr/', nua_gr_linux_servers => 'https://grafana.nuabee.fr/d/xfpJB9FGz/linux-servers', nua_gr_restops => 'https://grafana.nuabee.fr/d/Mz11bd07k/vue-d-ensemble-machines-atelier', nua_gr_alertops => 'https://grafana.nuabee.fr/d/WojOgXTmk/ops-alerts', nua_git => 'https://gitlab.int.ysosecure.com/', nua_mbs => 'https://mbs.nuabee.com/', nua_hedgedoc => 'http://hedgedoc.int.ysosecure.com/', nua_doc => 'https://doc.int.ysosecure.com/', nua_kb => 'https://kb.int.ysosecure.com/', nua_zammad => 'https://support.nuabee.fr/', nua_atlas => 'https://atlas.nuabee.fr/', nua_share => 'https://share.nuabee.fr/', }; sub main { my $choice; my $url; my $pid; my $prefix; my $list; my $color; $color = '#cc241d'; if (@ARGV == 1) { $color = $ARGV[0]; } $prefix = '/usr'; if (HOSTNAME eq "mars") { $prefix += '/local'; } for (keys %{LIST()}) { $list .= $_ . "\n"; } $choice = `printf "$list" | dmenu -i -l 100 -sb '$color' -shb '$color'`; if (not $choice) { return; } chomp $choice; $pid = fork(); if (not $pid) { exec($prefix . BROWSER, LIST->{$choice}); } return; } main(); __END__