From 00f3c93594db0d54257602187e9c72ecbf1a037a Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 2 Dec 2025 22:32:22 -0500 Subject: [PATCH] Detect and use irc clients if available. --- I38.md | 1 + i38.sh | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/I38.md b/I38.md index 4e31b37..9e370ea 100644 --- a/I38.md +++ b/I38.md @@ -62,6 +62,7 @@ Common Ratpoison mode commands: |-----|--------| | `c` | Launch a terminal | | `e` | Open text editor (TEXTEDITOR) | +| `i` | Launch IRC client | | `w` | Launch web browser (BROWSER) | | `k` | Kill (close) the current window | | `F1` | Show ratpoison mode keybindings | diff --git a/i38.sh b/i38.sh index 80c4e1e..a1b5c4e 100755 --- a/i38.sh +++ b/i38.sh @@ -546,6 +546,23 @@ else fileBrowser="${programList/#-/}" fi export fileBrowser="$(command -v $fileBrowser)" +# IRC client +unset programList +for i in albikirc Albikirc access-irc stormirc ; do + if command -v ${i/#-/} &> /dev/null ; then + if [ -n "$programList" ]; then + programList="$programList $i" + else + programList="$i" + fi + fi +done +if [ "$programList" != "${programList// /}" ]; then + ircClient="$(menulist "IRC client:" $programList)" +else + ircClient="${programList/#-/}" +fi +export ircClient="$(command -v $ircClient)" # Auto mount removable media udiskie=1 if command -v udiskie &> /dev/null ; then @@ -845,6 +862,10 @@ $(if command -v pidgin &> /dev/null ; then echo "# p bound to pidgin" echo "bindsym p exec $(command -v pidgin), mode \"default\"" fi) +$(if [[ ${#ircClient} -gt 3 ]]; then + echo "# IRC client bound to i" + echo "bindsym i exec $ircClient, mode \"default\"" +fi) $(if command -v xrandr &> /dev/null ; then echo "# alt+s bound to brightness control" echo "bindsym \$mod+s exec --no-startup-id ${i3Path}/scripts/screen_controller.sh, mode \"default\"" @@ -1030,6 +1051,7 @@ webBrowser="${webBrowser##*/}" screenReader="${screenReader##*/}" textEditor="${textEditor##*/}" fileBrowser="${fileBrowser##*/}" +ircClient="${ircClient##*/}" # Extract and categorize top-level keybindings for documentation # Generate HTML directly since we're inserting into an already-converted HTML file