nix/home/program/bash/module/File.nix

34 lines
650 B
Nix
Raw Normal View History

2024-04-06 03:03:58 +03:00
{ ... }: {
text = ''
# Open file/dir in GUI.
# Usage: open <FILE>
function open() {
xdg-open "''${@}"
}
alias o="open"
# Play media file from CLI. All files by default.
# Usage: play [FILE]
function play() {
local targets=''${*}
[[ "''${targets}" = "" ]] && targets=$(_ls_file)
mpv --no-video ''${targets}
}
# Play media files shuffled from CLI. All files by default.
# Usage: play_shuffle [FILE]
function play_shuffle() {
local targets=''${*}
[[ "''${targets}" = "" ]] && targets=$(_ls_file)
mpv --no-video --shuffle ''${targets}
}
2024-04-16 23:19:40 +03:00
# Open files app.
function files() {
nautilus
}
2024-04-06 03:03:58 +03:00
'';
}