Compare commits
2 commits
5162143ca7
...
4d23af8e34
Author | SHA1 | Date | |
---|---|---|---|
Dmitry Voronin | 4d23af8e34 | ||
Dmitry Voronin | 9326dea538 |
16
flake.nix
16
flake.nix
|
@ -63,7 +63,7 @@
|
|||
|
||||
__findFile = _: p: ./${p};
|
||||
|
||||
findFiles = path: map (f: "${path}/${f}") (
|
||||
ls = path: map (f: "${path}/${f}") (
|
||||
builtins.filter (i: builtins.readFileType "${path}/${i}" == "regular") (
|
||||
builtins.attrNames (builtins.readDir path)
|
||||
)
|
||||
|
@ -104,12 +104,12 @@
|
|||
# HM config.
|
||||
./home/NixOs.nix
|
||||
]
|
||||
++ (self.findFiles ./container)
|
||||
++ (self.findFiles ./host/${system}/${hostname})
|
||||
++ (self.findFiles ./option)
|
||||
++ (self.findFiles ./config)
|
||||
++ (self.findFiles ./overlay)
|
||||
++ (self.findFiles ./system)
|
||||
++ (self.ls ./container)
|
||||
++ (self.ls ./host/${system}/${hostname})
|
||||
++ (self.ls ./option)
|
||||
++ (self.ls ./config)
|
||||
++ (self.ls ./overlay)
|
||||
++ (self.ls ./system)
|
||||
;
|
||||
specialArgs = let
|
||||
pkgs = nixpkgs.legacyPackages.${system}.pkgs;
|
||||
|
@ -148,7 +148,7 @@
|
|||
{ home-manager.config.stylix.autoEnable = lib.mkForce false; }
|
||||
./home/Android.nix
|
||||
]
|
||||
++ (self.findFiles ./option)
|
||||
++ (self.ls ./option)
|
||||
;
|
||||
extraSpecialArgs = {
|
||||
inherit inputs self pkgsMaster pkgsUnstable;
|
||||
|
|
|
@ -64,16 +64,25 @@
|
|||
block = true;
|
||||
run = openWith "radare2 -c V -w";
|
||||
}];
|
||||
image = [{
|
||||
desc = "Image";
|
||||
picture = [{
|
||||
desc = "Picture";
|
||||
orphan = true;
|
||||
run = openWith "loupe";
|
||||
}];
|
||||
image_edit = [{
|
||||
desc = "Image Edit";
|
||||
picture_edit = [{
|
||||
desc = "Picture Edit";
|
||||
orphan = true;
|
||||
run = openWith "gimp";
|
||||
}];
|
||||
picture_edit_quick = [{
|
||||
desc = "Picture Quick Edit";
|
||||
orphan = true;
|
||||
run = openWith "pic_edit";
|
||||
}];
|
||||
picture_copy = [{
|
||||
desc = "Picture Copy";
|
||||
run = openWith "pic_copy";
|
||||
}];
|
||||
mount = [{
|
||||
desc = "Mount";
|
||||
run = openWith "fmount";
|
||||
|
@ -133,7 +142,7 @@
|
|||
(mkMime "application/pdf" [ "pdf" ])
|
||||
(mkMime "audio/*" [ "audio" ])
|
||||
(mkName "*.mka" [ "audio" ])
|
||||
(mkMime "image/*" [ "image" "image_edit" ])
|
||||
(mkMime "image/*" [ "picture" "picture_copy" "picture_edit" "picture_edit_quick" ])
|
||||
(mkMime "video/*" [ "video" ])
|
||||
(mkMime "text/html" [ "browser" ])
|
||||
(mkMime "application/vnd.openxmlformats-officedocument.*" [ "document" ])
|
||||
|
|
18
home/program/bash/module/Picture.nix
Normal file
18
home/program/bash/module/Picture.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ ... }: {
|
||||
text = ''
|
||||
# Quick edit a picture and copy to clipboard.
|
||||
# Usage: pic_copy <FILE>
|
||||
function pic_copy() {
|
||||
swappy -f "''${1}" -o - | copy
|
||||
}
|
||||
|
||||
# Quick edit a pictures inplace.
|
||||
# Usage: pic_edit <FILES>
|
||||
function pic_edit() {
|
||||
local IFS=$'\n'
|
||||
for file in "''${@}"; do
|
||||
swappy -f "''${file}" -o "''${file}"
|
||||
done
|
||||
}
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue