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

34 lines
683 B
Nix
Raw Normal View History

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