From 46387c6f578b8c886c85d6e320abf946aadd158f Mon Sep 17 00:00:00 2001 From: Emmet Date: Sat, 13 Apr 2024 15:01:22 -0500 Subject: [PATCH] Added org-sliced-images --- flake.lock | 17 +++++++++++++++++ flake.nix | 7 ++++++- user/app/doom-emacs/config.el | 8 +++++++- user/app/doom-emacs/doom.nix | 6 +++++- user/app/doom-emacs/doom.org | 16 ++++++++++++++-- 5 files changed, 49 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 537a652..077cdb0 100644 --- a/flake.lock +++ b/flake.lock @@ -805,6 +805,22 @@ "type": "github" } }, + "org-sliced-images": { + "flake": false, + "locked": { + "lastModified": 1711408181, + "narHash": "sha256-ck3mGXtJJ0N8asGE4cRtWeJx5/iC+bTXw2cvZgePJqM=", + "owner": "jcfk", + "repo": "org-sliced-images", + "rev": "bd1141d6df6edfd9749c0bbf3a72836148c0e39d", + "type": "github" + }, + "original": { + "owner": "jcfk", + "repo": "org-sliced-images", + "type": "github" + } + }, "org-timeblock": { "flake": false, "locked": { @@ -918,6 +934,7 @@ "org-krita": "org-krita", "org-nursery": "org-nursery", "org-side-tree": "org-side-tree", + "org-sliced-images": "org-sliced-images", "org-timeblock": "org-timeblock", "org-yaap": "org-yaap", "phscroll": "phscroll", diff --git a/flake.nix b/flake.nix index 3386aba..6c3ee25 100644 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,7 @@ outputs = inputs@{ self, nixpkgs, nixpkgs-stable, emacs-pin-nixpkgs, kdenlive-pin-nixpkgs, home-manager-unstable, home-manager-stable, nix-doom-emacs, nix-straight, stylix, blocklist-hosts, rust-overlay, org-nursery, org-yaap, - org-side-tree, org-timeblock, org-krita, phscroll, mini-frame, ... }: + org-side-tree, org-timeblock, org-krita, org-sliced-images, phscroll, mini-frame, ... }: let # ---- SYSTEM SETTINGS ---- # systemSettings = { @@ -138,6 +138,7 @@ inherit (inputs) org-side-tree; inherit (inputs) org-timeblock; inherit (inputs) org-krita; + inherit (inputs) org-sliced-images; inherit (inputs) phscroll; inherit (inputs) mini-frame; #inherit (inputs) nix-flatpak; @@ -232,6 +233,10 @@ url = "github:lepisma/org-krita"; flake = false; }; + org-sliced-images = { + url = "github:jcfk/org-sliced-images"; + flake = false; + }; phscroll = { url = "github:misohena/phscroll"; flake = false; diff --git a/user/app/doom-emacs/config.el b/user/app/doom-emacs/config.el index 2779572..6f8735b 100644 --- a/user/app/doom-emacs/config.el +++ b/user/app/doom-emacs/config.el @@ -272,7 +272,7 @@ org-pretty-entities t org-ellipsis "…") -(setq-default line-spacing 0.15) +(setq-default line-spacing 0) ; Automatic table of contents is nice (if (require 'toc-org nil t) @@ -482,6 +482,12 @@ If FULL-MODE is not null, run full krita." :desc "Copy link/file at point into system clipbord (C-g to escape if copying a file)" "y y" 'org-copy-link-to-clipboard-at-point)) +(add-load-path! "~/.emacs.d/org-sliced-images") +(require 'org-sliced-images) +(defalias 'org-remove-inline-images #'org-sliced-images-remove-inline-images) +(defalias 'org-toggle-inline-images #'org-sliced-images-toggle-inline-images) +(defalias 'org-display-inline-images #'org-sliced-images-display-inline-images) + ;; Online images inside of org mode is pretty cool ;; This snippit is from Tobias on Stack Exchange ;; https://emacs.stackexchange.com/questions/42281/org-mode-is-it-possible-to-display-online-images diff --git a/user/app/doom-emacs/doom.nix b/user/app/doom-emacs/doom.nix index 1df0023..6824bd9 100644 --- a/user/app/doom-emacs/doom.nix +++ b/user/app/doom-emacs/doom.nix @@ -1,5 +1,5 @@ { config, lib, pkgs-emacs, pkgs-stable, userSettings, systemSettings, - org-nursery, org-yaap, org-side-tree, org-timeblock, org-krita, phscroll, mini-frame, ... }: + org-nursery, org-yaap, org-side-tree, org-timeblock, org-krita, org-sliced-images, phscroll, mini-frame, ... }: let themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + "../../../../themes"+("/"+userSettings.theme)+"/polarity.txt")); dashboardLogo = ./. + "/nix-" + themePolarity + ".png"; @@ -101,6 +101,10 @@ in source = "${org-krita}"; }; + home.file.".emacs.d/org-sliced-images" = { + source = "${org-sliced-images}"; + }; + home.file.".emacs.d/dashboard-logo.png".source = dashboardLogo; home.file.".emacs.d/scripts/copy-link-or-file/copy-link-or-file-to-clipboard.sh" = { source = ./scripts/copy-link-or-file/copy-link-or-file-to-clipboard.sh; diff --git a/user/app/doom-emacs/doom.org b/user/app/doom-emacs/doom.org index 38d81f1..aec8d8a 100644 --- a/user/app/doom-emacs/doom.org +++ b/user/app/doom-emacs/doom.org @@ -342,7 +342,7 @@ Doom Emacs is traditionally installed by cloning the repository ([[https://githu org-pretty-entities t org-ellipsis "…") -(setq-default line-spacing 0.15) +(setq-default line-spacing 0) ; Automatic table of contents is nice (if (require 'toc-org nil t) @@ -587,6 +587,14 @@ else fi exit #+END_SRC +*** Org Sliced Images +#+begin_src emacs-lisp :tangle config.el +(add-load-path! "~/.emacs.d/org-sliced-images") +(require 'org-sliced-images) +(defalias 'org-remove-inline-images #'org-sliced-images-remove-inline-images) +(defalias 'org-toggle-inline-images #'org-sliced-images-toggle-inline-images) +(defalias 'org-display-inline-images #'org-sliced-images-display-inline-images) +#+end_src *** Org Online Images #+BEGIN_SRC emacs-lisp :tangle config.el ;; Online images inside of org mode is pretty cool @@ -1994,7 +2002,7 @@ Any git package can be configured for a particular commit or branch: In order to have Nix load my Doom Emacs configuration [[./doom.nix][doom.nix]], which I source in the =imports= block of my [[../../../profiles/work/home.nix][home.nix]]. #+BEGIN_SRC nix :tangle doom.nix { config, lib, pkgs-emacs, pkgs-stable, userSettings, systemSettings, - org-nursery, org-yaap, org-side-tree, org-timeblock, org-krita, phscroll, mini-frame, ... }: + org-nursery, org-yaap, org-side-tree, org-timeblock, org-krita, org-sliced-images, phscroll, mini-frame, ... }: let themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + "../../../../themes"+("/"+userSettings.theme)+"/polarity.txt")); dashboardLogo = ./. + "/nix-" + themePolarity + ".png"; @@ -2096,6 +2104,10 @@ in source = "${org-krita}"; }; + home.file.".emacs.d/org-sliced-images" = { + source = "${org-sliced-images}"; + }; + home.file.".emacs.d/dashboard-logo.png".source = dashboardLogo; home.file.".emacs.d/scripts/copy-link-or-file/copy-link-or-file-to-clipboard.sh" = { source = ./scripts/copy-link-or-file/copy-link-or-file-to-clipboard.sh;