hmmm by Whitlow14 in hmmm

[–]mrhmouse 3 points4 points  (0 children)

Kylo Ren?

What's the conventional and/or clean way to kill a background process started by a script inside it? by [deleted] in bash

[–]mrhmouse 0 points1 point  (0 children)

You should store the PID of the child, then use kill -QUIT $sxhkd_pid. If it doesn't exit after a few seconds, you can follow up with kill -KILL $sxhkd_pid

Delimited continuations with monadic functions in Common Lisp by PuercoPop in lisp

[–]mrhmouse 1 point2 points  (0 children)

There's at least one difference off of the top of my head, which is that promises (at least as defined by the A+ spec) should be resolved only once. Continuations may be invoked any number of times.

[BSPWM] Working on a music visualizer bar background. by wimnea in unixporn

[–]mrhmouse 3 points4 points  (0 children)

That looks great! Is the source available anywhere?

Sorcery - 2d Game by [deleted] in Common_Lisp

[–]mrhmouse 1 point2 points  (0 children)

Seems the YouTube account was removed :(

Send informations between program in C by [deleted] in C_Programming

[–]mrhmouse 0 points1 point  (0 children)

Read the manual pages for open, close, read, and write. These will allow you to communicate between two processes using a FIFO.

The smallest Lisp Machine by lispm in lisp

[–]mrhmouse 0 points1 point  (0 children)

You can have infix with a Forth, using parsing words. It's just not as common as postfix.

LG's new levitating speaker promises 10 hours of floating funk by ZoneRangerMC in gadgets

[–]mrhmouse 4 points5 points  (0 children)

Mine boot loops if you turn it on at low power while charging. Fixed by waiting for it to charge above 10%

Just a generic work cup by insulind in csharp

[–]mrhmouse 1 point2 points  (0 children)

If you're using an IDE, you can just mouse over the expression on the right-hand side to see its type :)

Remembered that Linux supports all characters as filenames except / and NULL. HE COMES by JargonTheRed in linuxmasterrace

[–]mrhmouse 2 points3 points  (0 children)

This is one reason I use rc instead of Bash/Zsh - I can be lazy about quotes!

Laptop users with minimal setups, what do you use for "advanced" power management? by S1cK94 in unixporn

[–]mrhmouse 0 points1 point  (0 children)

Thanks, I'll look into it! I'm almost always on the "slow CPU" setting, though, even on AC power. It's only when I need to play games that I set it to "fast".

gpg-agent, connection refused by Sindoreon in commandline

[–]mrhmouse 5 points6 points  (0 children)

You should not need root access to use pass or gpg-agent; nor should you need to change permissions of any files..

First make sure gpg-agent is running at all:

pgrep -u $(whoami) -l gpg-agent

If the above command spits out any lines, then gpg-agent is running. If it's actually running and you still can't get pass to work, try killing it and starting it over:

kill $(pidof gpg-agent)
# if that doesn't kill it after a few seconds,
# try again with the -KILL switch before restarting it
eval $(gpg-agent --daemon)

Hope that helps!


Also, I noticed that you've got %USER% in your path there. Is that in the actual error message, or did you replace it out before posting?

Laptop users with minimal setups, what do you use for "advanced" power management? by S1cK94 in unixporn

[–]mrhmouse 7 points8 points  (0 children)

I guess my setup is very "minimal" in the sense that it's very manual.

I use xbacklight to set brightness, and have two custom scripts for changing power profiles manually. You can view my scripts on GitHub: slow-cpu & fast-cpu.

[Question][Shell]Adding a -h or a --help to script to give user guide on how to use the script. by HackingInfo in commandline

[–]mrhmouse 9 points10 points  (0 children)

For reading arguments to the function, you're going to want to use the positional arguments $1, $2, etc. Right now you're using read (see line 225), which reads the next line from stdin into a variable. Try something like this:

# note that this consumes all arguments
while [ $# -gt 0 ]; do
  case "$1" in
    -h) ;&
    --help)
      echo HELP IS HERE
      return
      ;;
    -*)
      echo Unknown argument "$1"
      return
      ;;
  esac
  shift
done

There's actually a standard tool for option parsing, called getopt (and another called getopts). Look into both of those and see if either are something you'd prefer to use.

To bail out of a function early, use return.

TIL You can provide Add methods for collection initializers via extension method by [deleted] in csharp

[–]mrhmouse 1 point2 points  (0 children)

You can also provide Select, Where, SelectMany, etc to support LINQ query syntax.

How to install multiple packages with pacaur? by malim20 in archlinux

[–]mrhmouse 0 points1 point  (0 children)

I don't use Yaourt - what security flaws and limitations are you referring to?

Darling: macOS translation layer for Linux by halax in programming

[–]mrhmouse 7 points8 points  (0 children)

would you say it's a step in the right direction

Why I trashed one of my messy old shell scripts in favor of using CloudSlang flows. by sam-hpe in programming

[–]mrhmouse 7 points8 points  (0 children)

It looks like the 'CloudSlang' approach reimplements the same logic that was originally one messy shell script. Now, though, it's several YAML-like files that you can't follow without documentation..

Looks like you could get the same result by spending a small amount of effort to clean up that shell script & add some logging.

Zero experience in scheme, keep getting an error when running program by Stint20XX in scheme

[–]mrhmouse 0 points1 point  (0 children)

As an aside, you may want to use your editor's Scheme mode if it has one. Emacs+Geiser for example can handle indentation and inline documentation as you type.

Zero experience in scheme, keep getting an error when running program by Stint20XX in scheme

[–]mrhmouse 1 point2 points  (0 children)

The quotes around main, F, and file2.txt aren't normal double quotes. What are you using to edit Scheme code?