A shell wrapper to isolate claude code inside docker (with dmenu/fzf)
As a archlinux, and suckless philosophy enjoyer, I wanted to try out Anthropic's claude code cli, but I really didn't like the idea of installing it as a global npm package and giving an AI agent full access to my host filesystem.
Full disclosure: I wrote this script myself for my personal workflow (integrated with my window manager), and wanted to share it here to see if anyone finds it useful.
It's a lightweight, POSIX-compliant script (#!/bin/sh) that handles the entire container lifecycle, dynamically maps host uid/gid during the build step, and uses dmenu and fzf for mode and directory selection.
The repository with the full script can be found here: https://github.com/shirozuki/claude-cli
I would love to get your general feedback on the script, the approach, or any improvements you might suggest. Thanks!
https://redd.it/1tlrrxu
@r_bash
USEKIT — a small Python toolkit/editor workflow for Termux
https://redd.it/1tl1zkd
@r_bash
Install jargon file as man page
https://github.com/smithbh/jargon-mandoc/
https://redd.it/1tkofqx
@r_bash
My personal roadmap for linux foundation .
https://redd.it/1tkggv6
@r_bash
Here are mine, what aliases does others swear by?
Wrote up a collection of shell aliases that have quietly saved me a lot of time over the years. The kind of thing you set up once and wonder how you lived without.
A few from the article:
alias gs='git status'
alias ..='cd ..'
alias ll='ls -lah'
alias grep='grep --color=auto'
alias ports='ss -tulanp'
Covers aliases for navigation, git shortcuts, file operations, and a few that are specific to dev workflows.
Full list here: https://medium.com/stackademic/shell-aliases-that-will-save-you-hours-every-week-42523ef08064?sk=4905d8b510832dad699810b1ce6322b0
Curious what aliases the folks here swear by. drop yours in the comments.
https://redd.it/1tjsqdv
@r_bash
bind -x '"...": setsid kill -2 $$' works but bind -x '"...": kill -2 $$' does not
I'm stumbling over a behavior in bash that I don't 100% understand. The following doesn't work as expected:
bind -x '"\ex": kill -SIGINT $$'
I would expect this to behave pretty much identical to pressing Ctrl-C, which in a normal terminal in canonical mode would send a SIGINT to the foreground process group of the session associated with the controlling terminal, which is in the case of readline in bash is handled by an appropriate signal handler that aborts the current readline buffer and reprints the prompt. Because of stty echoctl, we should also see a ^C being printed by the terminal itself.
However, this is not what happens. Instead, when I type \ex (Alt-x or Meta-x), it deletes the current PS1 prompt string, does NOT print ^C, moves to a new line, and then prints a new PS1 prompt string. Visually, it looks like the current line was completely (basically what printf '\033[2K' would do)) and then a new line is created. Running it multiple times creates a lot of empty whitespace. Functionally, it's identical to Ctrl-C, though, which makes sense.
The weird thing is, if I run the kill -SIGINT command from another terminal, OR I adjust the command to be setsid kill instead of just kill (I know that this calls /bin/kill instead of the bash builtin kill, but that's irrelevant to the matter), then it suddenly works exactly as expected, identical to pressing Ctrl-C.
Can someone explain exactly what is going on? Adding stty sane or stty echo echoctl before the kill didn't help, unfortunately. My guess is that in the "bind -x" execution context, the terminal characteristics are set to -echo -echoctl (and maybe some more), but then why doesn't stty sane/stty echo echoctl help it?
https://redd.it/1tjez3m
@r_bash
Flyline: a Bash plugin to replace readline for a modern line editing experience
https://github.com/HalFrgrd/flyline
https://redd.it/1ti19i8
@r_bash
How to create crontab/cronjob through a script?
I want to add a cronjob entry programmatically through the script instead to manually adding the entry in crontab -e.
Suppose, i have a script that runs to check for ram usage, and I want to add a cronjob inside the same script and run it every 5 mins. Is it possible to do so?
https://redd.it/1thtbip
@r_bash
I built a tool that turns daily hacking practice into a streak habit. Red/Blue/Purple Team paths, real code drills.
https://hacklingo.tech
https://redd.it/1th3dzx
@r_bash
Started learning Linux from zero , just hit file permissions and my brain is melting (in a good way) lol 🐧
https://redd.it/1tfkfyi
@r_bash
Bash Scripting vs. Python
For those of you who also write scripts in Python or another language besides Bash, How do you decide when to write a script in Python vs. a script in Bash? I'm trying to be economical with my study time, because if I spend a lot of time learning some limited use functionality in one language, I could have used that time to learn a more general use functionality in another language. Here's an example: I've spent a fair amount of time learning awk, but I've never been great at using it, and sometimes I think that I should have just used Path and regex objects in Python, instead.
https://redd.it/1tfayxj
@r_bash
Is it OK if I use an appimage-browser like default browser?
Hi, I am using a browser from an appimage. Could I use it like browser by default from bash?
I did the commands before for change one browser by another... maybe I can use these steeps again and change to new browser-appimage like default...
PS: what is the meaning of "submission" flag here in this sub?
Thank you and Regards!
https://redd.it/1teq9x7
@r_bash
Building a multi-agent system from scratch: 50 lines of bash + git
https://en.andros.dev/blog/ed26ea98/building-a-multi-agent-system-from-scratch-50-lines-of-bash-git/
https://redd.it/1tdutty
@r_bash
noob Is there a way to refactor this simple "additional args"?
notify() {
local -a args
if [ "$target" != pixel ]; then
args=(--icon="$file" "$@")
else
args=("$@")
fi
notify-send --hint=string:x-dunst-stack-tag:shot \
--hint=string:synchronous:shot --app-name=screenshot "${args@}"
}args=("$@") is not great, but neither is referencing notify-send twice when it's the same command with an optional --icon="$file". There's parameter expansion :+ but it replaces it with an empty string so would need an eval(?). Turning notify-send into a nested function is a bit verbose.
This logic is something I do often so wondering if this is as good as it gets.
https://redd.it/1tl5kb5
@r_bash
What would you call this? IO stream question
OK, so I'm a long-time hobbyist, no training or professional experience. I don't really know what I'm asking for here, so I'm just going to describe it and maybe somebody can point me in the right direction.
When scripting a bunch of binaries and shell commands together to automate stuff, it's very common for me to redirect Stdout and Stderr to some temporary log files, and then "tail -f | grep" the logs in a separate session, as a status monitor. (Headless server, so everything's over ssh)
This works great, except that you have to actually issue the tail command somewhere, and then leave it running. This means 2 or 3 tabs in the Mobaxterm window, for any given thing I'm doing. So I have to check back every so often, to see if anything's gone fucky.
I've used "wall" to send notices to any open terminals, which is really close. But only works if I'm at my desk, with Mobax/Putty open and visible.
I'm imagining REALLY OLD systems, where a dot matrix line printer was used for this, to keep the terminal freed up, and only spit out info that mattered- even the sound those things made, was kind of an alert to tell you that you needed to go look. What would be the modern equivalent?
If I had a screen, either a spare monitor or even one of those little 5" USB monitors, that I could stick on the side of the server rack, and redirect individual lines to, then I'd have a dedicated place for those notifications to be sent to. If the screen isn't blank, it means I need to read what it says. Easy. Instead of Stdout or Stderr, it would be some third thing that works equivalently for redirects.
How could I do this?
Or am I overlooking something real obvious that would make this whole idea unnecessary? Which is completely possible.
https://redd.it/1tl1ora
@r_bash
Linux and Shell Scripting Notes
https://www.reddit.com/gallery/1tkl96d
https://redd.it/1tkly5m
@r_bash
Silly little trivia / "joke" / headcanon: found evidence that Steve Bourne is actually rebourne-again Lord Kelvin
Ohm (Ω) is the unit of electrical resistance. What should the reciprocal "opposite" electrical conductance be called? "Obviously mho (℧)", said Lord Kelvin.
From Wikipedia: Siemens (unit of conductance)#Mho)
100 years (or something) later someone asks how IF and CASE clauses should be terminated...
Coincidence??
(tbh Bourne just adopted these "if-fis" and "case-esacs" to Bourne shell from ALGOL 68, but he also worked on that so I stubbournely choose to believe he's still the progenitor of the idiom.)
https://redd.it/1tk273z
@r_bash
Over ssh, sudo reboot; logout is not always working as expected. Why?
When working over ssh, I sometimes want to reboot or power off a system. The usual error message about the broken pipe annoy me, so I use
`sudo reboot; logout` as a stop for it. The interesting issue is that it doesn't work on all systems. A sixth gen Intel NUC works, but on an 11th gen Intel CPU I get the same errors as if I didn't issue the logout:
Broadcast message from root@NUC11TNKi3 on pts/1 (Thu 2026-05-21 11:38:21 CEST):
The system will power off now!
Read from remote host nuc11tnki3.lan: Connection reset by peer
Connection to nuc11tnki3.lan closed.
client_loop: send disconnect: Broken pipe
On a 10th gen Intel NUC, it's no issue:
`sudo reboot; logout`
Broadcast message from root@nuc10i3fnk on pts/2 (Thu 2026-05-21 11:58:15 CEST):
The system will reboot now!
Connection to nuc10i3fnk.lan closed.
It should have something to do with the timing (that's why I post it in /r/bash), but I can't identify why only *some* systems show it. I use it on some fast systems and on slow systems without problems. Bash version is 5.3.9 in case it plays a role. But I have used other systems with other bash versions as well.
https://redd.it/1tjfnfo
@r_bash
Made a ffmpeg video converter to H.265 script to save space on my video files
https://redd.it/1tieb2m
@r_bash
Removed by Reddit
Removed by Reddit on account of violating the [content policy. ]
https://redd.it/1thx4o2
@r_bash
tadam - a one-liner that brings the Windows "TA-DAAAM!" sound back as a shell command
/r/commandline/comments/1thjo2y/tadam_a_oneliner_that_brings_the_windows_tadaaam/
https://redd.it/1thjt2z
@r_bash
Made a shell greeter that generates a unique rocket every time you open a terminal tab
https://redd.it/1th6kg2
@r_bash
fast alternative to find for finding git directories
Hey,
I have a small script to switch between projects. All my projects are in a deeply nested directory that is equal to their upstream source (eg. ~/projects/github.com/junegunn/fzf/).
It works by using find to enumerate all directories under ~/projects/ that contain a .git/ directory and passes that to fzf. Unfortunately this is pretty slow somehow because findtakes a long time. When using fzf directly it's super fast, but I can't restrict the selection to only include git root directories.
Is there a better way of getting a similar result? All I want is to have a fast way of switching between projects
dev () {
project="$(find $HOME/projects -type d -name .git -prune -exec sh -c 'dirname $(realpath --relative-to $HOME/projects {})' \; 2>/dev/null | fzf -1)"
if [ $? -ne 0 ]
then
return $?
fi
projectDir="$HOME/projects/$project"
pushd $projectDir
}
https://redd.it/1tglx1c
@r_bash
There were too many scattered wrapper functions in my .bashrc. So I built Monkeypatsh
https://redd.it/1tfvp2j
@r_bash
play music using youtube-dl
https://redd.it/1tfiw8k
@r_bash
Improving the "command failed with exit 129" errors; check out my project: dexit - "Decode Exit".
https://github.com/eatnumber1/dexit
https://redd.it/1pvutw5
@r_bash
i made a new tool imager
\-imager-
what the hell is it?:
it is a tool that gives your more time to spend with your imaginary girlfriend, basically you spend 15-20 minutes figuring out the FUCKING syntax of appimage tools, but imager is the guy that your imaginary girlfriend said to 'not worry about'
what does the tool do:
you enter the name, you select the location of a file, example binary or a shell script,select the image, or you can just skip, pick the output directory. and done you have more time with your imaginary girlfriend, YAY
I WANT THE SOURCE CODE NOW NOW NOW NOW:
chill, here https://gitlab.com/giorgich11/imager/-/blob/main/sourcecode.sh
i am lazy give me the appimage link:
sure here https://gitlab.com/giorgich11/imager/-/raw/main/imager.AppImage
if you don't like this tool, don't flame it please, i am a new developer😢
https://redd.it/1te22vo
@r_bash
Sync Wallpaper with Terminator background image?
/r/xfce/comments/1tddprn/sync_wallpaper_with_terminator_background_image/
https://redd.it/1tddqd3
@r_bash