megapixels: place photos in ~/Pictures/Photos instead of directly in ~/Pictures
This commit is contained in:
@@ -3,11 +3,15 @@
|
|||||||
{
|
{
|
||||||
# XDG defines things like ~/Desktop, ~/Downloads, etc.
|
# XDG defines things like ~/Desktop, ~/Downloads, etc.
|
||||||
# these clutter the home, so i mostly don't use them.
|
# these clutter the home, so i mostly don't use them.
|
||||||
|
# note that several of these are not actually standardized anywhere.
|
||||||
|
# some are even non-conventional, like:
|
||||||
|
# - XDG_PHOTOS_DIR: only works because i patch e.g. megapixels
|
||||||
sane.user.fs.".config/user-dirs.dirs".symlink.text = ''
|
sane.user.fs.".config/user-dirs.dirs".symlink.text = ''
|
||||||
XDG_DESKTOP_DIR="$HOME/.xdg/Desktop"
|
XDG_DESKTOP_DIR="$HOME/.xdg/Desktop"
|
||||||
XDG_DOCUMENTS_DIR="$HOME/dev"
|
XDG_DOCUMENTS_DIR="$HOME/dev"
|
||||||
XDG_DOWNLOAD_DIR="$HOME/tmp"
|
XDG_DOWNLOAD_DIR="$HOME/tmp"
|
||||||
XDG_MUSIC_DIR="$HOME/Music"
|
XDG_MUSIC_DIR="$HOME/Music"
|
||||||
|
XDG_PHOTOS_DIR="$HOME/Pictures/Photos"
|
||||||
XDG_PICTURES_DIR="$HOME/Pictures"
|
XDG_PICTURES_DIR="$HOME/Pictures"
|
||||||
XDG_PUBLICSHARE_DIR="$HOME/.xdg/Public"
|
XDG_PUBLICSHARE_DIR="$HOME/.xdg/Public"
|
||||||
XDG_SCREENSHOTS_DIR="$HOME/Pictures/Screenshots"
|
XDG_SCREENSHOTS_DIR="$HOME/Pictures/Screenshots"
|
||||||
|
@@ -1,6 +1,13 @@
|
|||||||
{ ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
sane.programs.megapixels = {
|
sane.programs.megapixels = {
|
||||||
|
packageUnwrapped = pkgs.megapixels.overrideAttrs (upstream: {
|
||||||
|
postPatch = (upstream.postPatch or "") + ''
|
||||||
|
# patch it to save photos in a more specific directory
|
||||||
|
substituteInPlace src/process_pipeline.c \
|
||||||
|
--replace-fail 'XDG_PICTURES_DIR' 'XDG_PHOTOS_DIR'
|
||||||
|
'';
|
||||||
|
});
|
||||||
# megapixels sandboxing is tough:
|
# megapixels sandboxing is tough:
|
||||||
# if misconfigured, preview will alternately be OK, black, or only 1/4 of it will be rendered -- with no obvious pattern.
|
# if misconfigured, preview will alternately be OK, black, or only 1/4 of it will be rendered -- with no obvious pattern.
|
||||||
# adding all of ~ to the sandbox will sometimes (?) fix the flakiness, even when `strace` doesn't show it accessing any files...
|
# adding all of ~ to the sandbox will sometimes (?) fix the flakiness, even when `strace` doesn't show it accessing any files...
|
||||||
@@ -19,7 +26,7 @@
|
|||||||
".local/share/applications" #< needed for viewing photos, until i can sort out the portal stuff
|
".local/share/applications" #< needed for viewing photos, until i can sort out the portal stuff
|
||||||
".cache/mesa_shader_cache" # loads way faster
|
".cache/mesa_shader_cache" # loads way faster
|
||||||
"tmp"
|
"tmp"
|
||||||
"Pictures" #< TODO: make this Pictures/Photos and save photos there
|
"Pictures/Photos"
|
||||||
# also it addresses a lot via relative path.
|
# also it addresses a lot via relative path.
|
||||||
];
|
];
|
||||||
sandbox.extraPaths = [
|
sandbox.extraPaths = [
|
||||||
|
Reference in New Issue
Block a user