commandline

1923 readers
5 users here now

founded 2 years ago
MODERATORS
1
 
 

cross-posted from: https://programming.dev/post/27181555

Highlights:

  • Support for Background Jobs
  • Official .deb, .rpm, and .apk packages
  • Custom Command Attributes (@example, @search-terms)
  • std-rfc Module (experiments considered for the std lib)
  • Improvements to LSP
  • Improvements to Reedline Vi-mode
2
 
 

cross-posted from: https://lemmy.world/post/26801933

https://gitlab.com/christosangel/troblo

troblo is a terminal match-three game, written in Bash.

The aim is to place each time a pair of new tiles with fixed orientation on available empty squares of the 6x6 grid, in order to create rows or columns of three or more matching tiles, which will become empty again.

The new pair of fixed orientation tiles is shown each time at the right side of the grid.

The new pair can be placed only if both selected squares are empty.

The game ends when the grid becomes so clogged with unmatching tiles, and there is no place in the grid to drop the new fixed orientation (horizontal or vertical) pair of tiles.

This game was inspired by https://368chickens.com/.

3
 
 
4
 
 

Managarr - A TUI and CLI to help you manage your Servarrs.

Thanks to everyone who contributed to this release, be that in code, issues, or enhancement suggestions! You all help fuel my passion for working on this and it doesn't go unappreciated! ๐Ÿ˜„

As always, you can try out the changes yourself via the Managarr Demo Site

Breaking Changes

  • Managarr now supports multiple instances of the same Servarr with custom names and ordering. (See Features below) To accommodate this, configuration files must be updated so that all Servarrs listed beneath radarr, sonarr, etc., be updated to be lists, not individual Servarrs. For example: to migrate from the following config:

    radarr:
      host: 192.168.0.78
      port: 7878
      api_token: someApiToken1234
    sonarr:
      host: 192.168.0.89
      port: 8989
      api_token: someApiToken1234
    

    You would change the above configuration to the following:

    radarr:
      - host: 192.168.0.78
        port: 7878
        api_token: someApiToken1234
    sonarr:
      - host: 192.168.0.89
        port: 8989
        api_token: someApiToken1234
    
  • The --config flag has been renamed to --config-fileto make it more clear what it does.

Features

  • Users can now specify multiple instances of the same type of Servarr and give them custom names and ordering. This allows users to manage multiple instances of the same Servarr, such as an Anime and TV Show instance of Sonarr. To configure, add a list of Servarrs under the respective type (e.g. radarr, sonarr, etc.). (#17)

    • You can specify ordering of your Servarrs and how they will appear in the UI via the weight field. The lower the weight, the further to the left the Servarr will appear in the UI.
    • You can also name your Servarrs whatever you wish. This name will be displayed in the UI. For example, to name your Sonarr instances:
      sonarr:
        - name: Anime
          host: 192.168.0.89
          api_token: someApiToken
      
        - name: TV Shows
          host: 192.168.0.88
          api_token: someOtherApiToken
      
    • This change also required the introduction of a new CLI flag to specify which Servarr you wish to interact with: --servarr-name. This corresponds directly to the value of the name field in your configuration. If you did not specify a name in the configuration, then default names are provided for you corresponding to the Servarr; For example, if you defined two Radarr instances with no names, they will be named Radarr 1 and Radarr 2, respectively.
    • Omitting the --servarr-name flag with multi-instance configurations will default to using the first instance that appears in your config. For example, for the following configuration:
      sonarr:
        - host: 192.168.0.89
          api_token: someApiToken
      
        - host: 192.168.0.88
          api_token: someOtherApiToken
      
      Running managarr sonarr list series will default to interacting with the Sonarr instance at 192.168.0.89. This is the same as running managarr sonarr list series --servarr-name 'Sonarr 1'.
  • API tokens can now be fetched from files instead of needing to be hardcoded (#31). The following is an example config that loads the API token from a file:

    radarr:
      - host: 192.168.0.78
        api_token_file: /home/root/.config/radarr_token
    
  • Configurations now interpolate environment variables (#23). This allows you to load sensitive information from environment variables. For example, to load the API token from an environment variable, you can do the following:

    radarr:
      - host: 192.168.0.78
        api_token: ${MY_RADARR_API_TOKEN_ENV_VAR}
    

    This is available for all fields in the configuration file.

Security Updates

Miscellaneous

5
11
submitted 3 weeks ago* (last edited 3 weeks ago) by [email protected] to c/[email protected]
 
 

http://xkcd.com/936/

Not worth creating a project for, and it might be interesting to see what changes people would make.

Non-standard dependencies:

  • words, for the dictionary
  • zsh (this will probably work just fine with bash, though, too)
#!/usr/bin/zsh
# Author: @[email protected]
# 2025-02-23

final=(xargs echo)
count=6
while getopts d opt; do
	case $opt in
		d)
			final=(tr 'A-Z' 'a-z')
			;;
		*)
			printf "Password generator based on the correcthorse algorithm from http://xkcd.com/936//n/n"
			printf "USAGE: %s [-d] [#]\n" "$0"
			printf " -d  make the result all lower case; otherwise, each word will be capitalized.\n"
			printf " #   the number of words to include. Defaults to 6."
			exit 1
			;;
	esac
done
shift $(($OPTIND - 1))
[[ $# -gt 0 ]] && count=$*

shuf -n $((count * 2)) /usr/share/dict/american-english | \
	sed 's/'"'"'.*//; s/^\(\w\)/\U\1/' | \
	sort | uniq | shuf -n $count | xargs echo | \
	tr -d ' ' | $final

What's going on here:

Nearly 30% of the American dictionary (34,242) are words with apostrophes. They could be left in to help satisfy password requirements that demand "special characters," but correcthorse isn't an algorithm that handles idiot "password best practices" well anyway. So, since every word with an apostrophe has a pair word without one, we pull 2ยทN words to make sure we have enough. Then we strip out the plural/possessives and capitalize every word. Then we remove duplicates and select our N words from the result. Finally, we compact that into a space-less string of words, and if the user passed the -d option, we downcase the entire thing.

Without the user options, this really could be a 1-liner; that's how it started:

alias pony="shuf -n 12 /usr/share/dict/american-english | sed 's/'\"'\"'.*//; s/^\(\w\)/\U\1/' | sort | uniq | shuf -n 6 | xargs echo | tr -d ' '"
6
 
 

I wrote a CLI tool that generates basic scaffolding for all sorts of coding projects, from Zig applications to NPM packages.

Feel free to ask questions or contribute!

7
 
 

I wrote a CLI tool that generates basic scaffolding for all sorts of coding projects, from Zig applications to NPM packages.

Feel free to ask questions or contribute!

8
9
 
 

I rewrote some popular games for the terminal! You can play 2048, the snake game, tic-tac-toe, connect 4, and many more.

There's still a bunch of games to be made, so feel free to contribute :)

All contributions are welcome!

10
 
 

todo-md is a small pre-commit hook implemented in Bash that maintains TODO.md file in your repoHey! I've just released todo-md v1 ๐Ÿš€. Keep your tasks organized with todo-md!The pre-commit hook automatically maintains a TODO.md file by scanning your staged files for TODO: comments. You do not need complicated task trackers bloated with features anymore:) Let your code speak for itself!

Get it now: https://codeberg.org/lig/todo-md

#TODOmd #DevTools #PreCommit #Automation #OpenSource #Git #Todoโ€‹

11
 
 

cross-posted from: https://lemmy.world/post/23581846

https://gitlab.com/christosangel/tuifoop

tuifoop is a terminal puzzle game.

It is a clone of Swell Foop, written in Bash.

The aim is to remove as many cells as possible (or even all cells) from a grid. The user navigates in the grid using the navigation keys, and can select a cell to remove. Cells can be removed in clusters of more than one cells adjacent to each other. Single cells cannot be removed.

When selected, a cluster of adjacent similar cells is removed, and the remaining cells above take their place.

When a whole grid column is cleared, it collapses and the remaining columns to the right shift to fill its place.

IMPORTANT:

Most themes are based in emoji characters.

In order for the emoji characters to be rendered correctly, the user must:

  1. Make sure that emoji characters are supported in their terminal.

  2. Make sure suitable mono font is used to render the grid and the emoji backgound properly. For instance, ubuntu font can support emojis, however the font background is not rendered correctly, therefore the grid cursor (where the cursor is placd in the cell matrix) cannot be seen in the terminal window.

If a problem is encountered as this is concerned, it is easily resolved by changing to a more appropriate font through terminal application's preferences or configuration, so that the emojis as well as the grid are rendered correctly.

12
 
 

cross-posted from: https://lemmy.world/post/23313015

https://gitlab.com/christosangel/tuiplette

tuiplette is a terminal match-three game, written in Bash.

The aim is to gain points by swapping two adjacent grid cells to create rows or columns of three or more matching cells, which will disappear and allow the above cells to fall and occupy the vacant space.

When there are no moves left, the grid will be refreshed, and the game will continue until all (configured) reshuffles are used. When there are no moves left, and no reshuffles left, the game will end.

If the score is among the 10 best scores achieved, it makes it in the Top Ten Hiscores.

As far as the appearence of the game, by configuring the game accordinly, the user can select the game theme according to their liking.

The user has select theme between letters, numbers, greek, shapes, faces and blocks.

The colors selected are the configured terminal theme colors.

themes

13
2
submitted 3 months ago* (last edited 3 months ago) by [email protected] to c/[email protected]
 
 

I was recently furloughed from work, so in between job applications, I decided to polish off Sonarr support in my Managarr TUI. Thus, I'm very proud to announce the beta release of Managarr with Sonarr support!

TL;DR: Managarr is a TUI and CLI for managing your Servarr instances. As of now, it now supports both Radarr and Sonarr and all the features that are available in the UI are also available in the CLI for scripting and additional automation.

The new version has the following features:

  • Wider platform support (Windows, Mac, Linux, x86_64 and arm64)
  • View your library, downloads, blocklist, episodes
  • View details of a specific series, or episode including description, history, downloaded file info, or the credits
  • View your host and security configs from the CLI to programmatically fetch the API token, among other settings
  • Search your library
  • Add series to your library
  • Delete series, downloads, indexers, root folders, and episode files
  • Trigger automatic searches for series, seasons, or episodes
  • Trigger refresh and disk scan for series and downloads
  • Manually search for series, seasons, or episodes
  • Edit your series and indexers
  • Manage your tags
  • Manage your root folders
  • Manage your blocklist
  • View and browse logs, tasks, events queues, and updates
  • Manually trigger scheduled tasks
  • Manually trigger scheduled tasks
  • And more!

Here's some screenshots of the Sonarr tab:

Thanks to everyone's feedback when I first posted the alpha release here, this version sports a handful of additional performance improvements and platform support.

This is now technically in beta, so if anyone encounters any issues, please let me know!

14
 
 

cross-posted from: https://lemmy.world/post/23017061

https://gitlab.com/christosangel/stackabrix

stackabrix is a simple terminal game, written in Bash, where the user, against the clock and with the least moves possible, must sort the blocks according to their color, and stack them in the respective stack.

During the game, the user can move left and right, pick blocks and drop them in other stacks.

The aim is to sort the blocks, and stack them in the respectively named stacks, fast as possible, and with the least moves possible.

The play's score is the sum of the time achieved in seconds and of the moves made.

If the score is among the 10 best scores achived, it makes it in the Top Ten Highscores.

win_game

Any feedback is welcome.

15
 
 

The normal complaint new Zellij users have is that it has a lot of keybindings which are likely to conflict with programs like nvim or Helix that use a lot themselves. Before, the workflow was to lock Zellij with ctrl-g which let input go through to the focused shell/program.

The new mode has most of the keybindings behind the ctrl-g lock, e.g. a new tab is ctrl-g t n (instead of ctrl-t n). You can still use alt-(cursor) for changing focus and alt-n/alt-f for a new tiled/floating pane, but all other key presses get passed along.

You can switch between default and unlock-first (non-colliding) modes so if you need those alt shortcuts you can lock everything as before.

Plus some other nice features like being able to change modifier keys while running (via the Kitty Keyboard Protocol), and autoloading the new config when you edit the file.

16
 
 

After almost 3 years of work, I've finally managed to get this project stable enough to release an alpha version!

I'm proud to present Managarr - A TUI and CLI for managing your Servarr instances! At the moment, the alpha version only supports Radarr.

Not all features are implemented for the alpha version, like managing quality profiles or quality definitions, etc.

Here's some screenshots of the TUI:

Additionally, you can use it as a CLI for Radarr; For example, to search for a new film:

managarr radarr search-new-movie --query "star wars"

Or you can add a new movie by its TMDB ID:

managarr radarr add movie --tmdb-id 1895 --root-folder-path /nfs/movies --quality-profile-id 1

All features available in the TUI are also available via the CLI.

17
 
 

Thought this was neat. TUI media player on the Hackberrypi

18
 
 

https://gitlab.com/christosangel/chaftrix

This program written in C will render the matrix effect in the terminal window in the background, while rendering an image in the foreground, allowing animation of this image in one or two dimensions.

video.png

Image rendering is done with chafa.

This program is the continuation and evolution of other projects:

https://gitlab.com/christosangel/matrix_clone

https://gitlab.com/christosangel/ascii-matrix

https://gitlab.com/christosangel/animatrix

19
 
 

Hello Lemmy,

This is an extension of the bluetuith TUI Bluetooth Manager project, which was initially developed for Linux, and is now being ported to Windows as well. This will allow the TUI to manage Bluetooth on Windows. Note that this is just a shim, the TUI will be ported to adapt with this shim later.

This tool offers a simple command-line interface and a socket-based interface (as an interprocess communication layer) to control Bluetooth Classic based functions, like:

  • Getting adapter information, performing device discovery, setting power states
  • Getting device information, pairing/unpairing a device
  • Connection to a device using various Bluetooth profiles
    • The supported profiles are A2DP, MAP, PBAP and OPP
    • Each connectable profile appears as a subcommand of the connect command
    • Every subcommand has multiple functions. View the documentation for more information.

This is currently alpha stage, so do expect bugs. Any bugs can be reported in the issue tracker.

I hope you enjoy this release, and any constructive feedback is appreciated.

20
 
 

Rook provides a secret service a-la secret-tool, keyring, or pass/gopass, except backed by a Keepass kdbx file.

The problem Rook solves is mainly in script automation, where you have aerc, offlineimap, isync, vdirsyncer, msmtp, restic, or any other cron jobs that need passwords and which are often configured to fetch these passwords from a secret service with a CLI tool. Unlike existing solutions, Rook is headless, and does not have a bespoke secrets database full of passwords that must be manually synchronized with Keepass; instead, it uses a Keepass db directly.

Rook is in the AUR and in Alpine testing; binaries are available from the project page.

From the changelog, since the last Lemmy release announcement v0.1.3 on May 20:

[v0.2.0] Fri Oct 11 09:01:03 2024 -0500

Added

  • support for password + key file credentials
  • show --no-eol option, to strip CRs after, eg, passwords

Changed

  • show matches search: it's now case insensitive

Fixed

  • successful OPEN with password wasn't clearing the one-time pin, so the DB was staying locked.
21
 
 

stmps is a fork of stmp, under active development and with several additional features. (*) items are PRs which also been accepted by the stmp project.

  • mpris support (*)
  • improved help text
  • improved playlist handling, including concurrent loading in the background
  • improved browser behavior, e.g. add all songs by an artist
  • global, server-side search
  • artist search in the browser (*)
  • TUI-less server information query
  • queue reordering
  • queue shuffling
  • randomly add songs to the queue
  • randomly add similar songs to the queue, using the Subsonic "get similar songs" feature

It's fast, keyboard driven, and a single executable; it is regularly tested against Navidrome and Gonic.

stmps can be installed by a simple go install command, and it's also in AUR as stmps.

I'm not the author, but am one of the active contributors.

22
 
 

Also available here. (Docker image)

23
24
25
view more: next โ€บ