Skip to content

Instantly share code, notes, and snippets.

@m93a
Created April 3, 2024 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m93a/963a4109f4ce2ca9a6eba67711bcc4bd to your computer and use it in GitHub Desktop.
Save m93a/963a4109f4ce2ca9a6eba67711bcc4bd to your computer and use it in GitHub Desktop.
a nushell script for adding flatpak apps to path
#!/usr/bin/env nu
const p = ~/.bin/flatpak
rm -rf $p
mkdir $p
(
flatpak list --columns=application
| lines
| where (str contains "Platform" | not $in)
| where (str contains "Gtk3theme" | not $in)
| each {|v| [$"($p)/($v)", $"#!/usr/bin/sh\nflatpak run ($v)"]}
| each {|v| echo $v.1 out> $v.0}
)
ls $p | each {|f| chmod +x $f.name}
null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment