thann

joined 2 years ago
MODERATOR OF
[–] thann@heapoverflow.ml 1 points 2 years ago

I would just ask it in the js & webdev community =]

[–] thann@heapoverflow.ml 3 points 2 years ago

Heres a good response on SO: https://unix.stackexchange.com/questions/223432/in-zsh-how-can-i-more-quickly-disown-the-foreground-process/223433#223433

Having a global keybind to disown the foreground process is impossible: Keystrokes are received by the foreground process, not by the shell. You need to first suspend it with Ctrl+z if you want to disown it.

However, turns out there's a zsh option to speed up disowning then continuing: With setopt AUTO_CONTINUE, disown will automatically also send SIGCONT.

So you can get it down to C-z disown.

[–] thann@heapoverflow.ml 2 points 2 years ago

nice catch!
I constantly switch between Js and python, and cant remember the differences lol
yeah, the --help generation is a very convenient part of the libs.
I just wrote this to demonstrate the simplest possible answer.

[–] thann@heapoverflow.ml 2 points 2 years ago

programming in a nutshell

[–] thann@heapoverflow.ml 2 points 2 years ago (2 children)

you have a really simple use-case, so you probably don't need and argument parsing lib, which I would normally recommend...

You can just iterate through the arguments array and categorize them by type, then add them to the appropriate collection to be handled later.

Something like this:

ids = []
urls = []
csvs = []
for arg in sys.argv:
  if arg.startswith('http'):
    urls.push(arg)
  else if arg.endswith('.csv'):
    csvs.push(arg)
  else:
    ids.push(arg)
[–] thann@heapoverflow.ml 3 points 2 years ago (1 children)

Most screenshot tools allow you to pass a name as an argument, so you could make a shell script to generate the name you want then call the screenshotting tool with the appropriate name. Also, consider using flameshot