Created
April 3, 2024 08:21
-
-
Save cshaa/963a4109f4ce2ca9a6eba67711bcc4bd to your computer and use it in GitHub Desktop.
a nushell script for adding flatpak apps to path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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