From 8f093cf3cd032228100c7860dfd73cde2e722099 Mon Sep 17 00:00:00 2001 From: Emmet Date: Thu, 12 Oct 2023 20:49:37 -0500 Subject: [PATCH] Added org-timeblock for agenda visualization --- flake.lock | 17 ++++++++++++++++ flake.nix | 7 ++++++- user/app/doom-emacs/config.el | 19 +++++++++++++++++ user/app/doom-emacs/doom.nix | 11 +++++++++- user/app/doom-emacs/doom.org | 36 ++++++++++++++++++++++++++++++++- user/app/doom-emacs/packages.el | 2 ++ 6 files changed, 89 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 2887bf0..c54cf08 100644 --- a/flake.lock +++ b/flake.lock @@ -589,6 +589,22 @@ "type": "github" } }, + "org-timeblock": { + "flake": false, + "locked": { + "lastModified": 1696926758, + "narHash": "sha256-EtFnMyXoZN+BRzPcHzqJ53q94xY/WwmnB25dENju3IY=", + "owner": "ichernyshovvv", + "repo": "org-timeblock", + "rev": "0c7bd445800569a87eff5284ceef1ebcf13f281b", + "type": "github" + }, + "original": { + "owner": "ichernyshovvv", + "repo": "org-timeblock", + "type": "github" + } + }, "org-yaap": { "flake": false, "locked": { @@ -680,6 +696,7 @@ "nixpkgs": "nixpkgs_2", "org-nursery": "org-nursery", "org-side-tree": "org-side-tree", + "org-timeblock": "org-timeblock", "org-yaap": "org-yaap", "phscroll": "phscroll", "rust-overlay": "rust-overlay", diff --git a/flake.nix b/flake.nix index 5440bd2..d012e8e 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { description = "Flake of LibrePhoenix"; - outputs = { self, nixpkgs, home-manager, nix-doom-emacs, stylix, eaf, eaf-browser, org-nursery, org-yaap, phscroll, blocklist-hosts, rust-overlay, hyprland-plugins, ... }@inputs: + outputs = { self, nixpkgs, home-manager, nix-doom-emacs, stylix, eaf, eaf-browser, org-nursery, org-yaap, org-timeblock, phscroll, blocklist-hosts, rust-overlay, hyprland-plugins, ... }@inputs: let # ---- SYSTEM SETTINGS ---- # system = "x86_64-linux"; # system arch @@ -79,6 +79,7 @@ inherit (inputs) org-nursery; inherit (inputs) org-yaap; inherit (inputs) org-side-tree; + inherit (inputs) org-timeblock; inherit (inputs) phscroll; inherit (inputs) hyprland-plugins; }; @@ -133,6 +134,10 @@ url = "github:localauthor/org-side-tree"; flake = false; }; + org-timeblock = { + url = "github:ichernyshovvv/org-timeblock"; + 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 97411e0..9b12cef 100644 --- a/user/app/doom-emacs/config.el +++ b/user/app/doom-emacs/config.el @@ -1045,6 +1045,25 @@ tasks." (setq org-yaap-daemon-idle-time 30) (org-yaap-mode 1) +(add-load-path! "~/.emacs.d/org-timeblock") +(require 'org-timeblock) + +(map! :leader :desc "Open org timeblock" + "O c" 'org-timeblock) + +(map! :desc "Next day" + :map org-timeblock-mode-map + :nvmeg "l" 'org-timeblock-day-later) +(map! :desc "Previous day" + :map org-timeblock-mode-map + :nvmeg "h" 'org-timeblock-day-earlier) +(map! :desc "Schedule event" + :map org-timeblock-mode-map + :nvmeg "m" 'org-timeblock-schedule) +(map! :desc "Event duration" + :map org-timeblock-mode-map + :nvmeg "d" 'org-timeblock-set-duration) + ;;;------ magit configuration ------;;; ;; Need the following two blocks to make magit work with git bare repos diff --git a/user/app/doom-emacs/doom.nix b/user/app/doom-emacs/doom.nix index f8ace0c..57a937f 100644 --- a/user/app/doom-emacs/doom.nix +++ b/user/app/doom-emacs/doom.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, eaf, eaf-browser, org-nursery, phscroll, org-yaap, org-side-tree, theme, font, name, username, email, dotfilesDir, profile, wmType, defaultRoamDir, ... }: +{ config, lib, pkgs, eaf, eaf-browser, org-nursery, phscroll, org-yaap, org-side-tree, org-timeblock, theme, font, name, username, email, dotfilesDir, profile, wmType, defaultRoamDir, ... }: let themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + "../../../../themes"+("/"+theme)+"/polarity.txt")); dashboardLogo = ./. + "/nix-" + themePolarity + ".png"; @@ -80,6 +80,11 @@ in recursive = true; }; + home.file.".emacs.d/org-timeblock" = { + source = "${org-timeblock}"; + recursive = true; + }; + home.file.".emacs.d/eaf/app/browser" = { source = "${eaf-browser}"; recursive = true; @@ -90,17 +95,21 @@ in popd; "; }; + home.file.".emacs.d/org-nursery" = { source = "${org-nursery}"; }; + 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; executable = true; }; + home.file.".emacs.d/phscroll" = { source = "${phscroll}"; }; + home.file.".emacs.d/system-vars.el".text = '' ;;; ~/.emacs.d/config.el -*- lexical-binding: t; -*- diff --git a/user/app/doom-emacs/doom.org b/user/app/doom-emacs/doom.org index f4e5d7f..c14fff4 100644 --- a/user/app/doom-emacs/doom.org +++ b/user/app/doom-emacs/doom.org @@ -1208,6 +1208,28 @@ On Wayland, EAF doesn't work. (setq org-yaap-daemon-idle-time 30) (org-yaap-mode 1) #+END_SRC +*** Org Timeblock +#+begin_src emacs-lisp :tangle config.el +(add-load-path! "~/.emacs.d/org-timeblock") +(require 'org-timeblock) + +(map! :leader :desc "Open org timeblock" + "O c" 'org-timeblock) + +(map! :desc "Next day" + :map org-timeblock-mode-map + :nvmeg "l" 'org-timeblock-day-later) +(map! :desc "Previous day" + :map org-timeblock-mode-map + :nvmeg "h" 'org-timeblock-day-earlier) +(map! :desc "Schedule event" + :map org-timeblock-mode-map + :nvmeg "m" 'org-timeblock-schedule) +(map! :desc "Event duration" + :map org-timeblock-mode-map + :nvmeg "d" 'org-timeblock-set-duration) + +#+end_src ** Magit Configuration #+BEGIN_SRC emacs-lisp :tangle config.el ;;;------ magit configuration ------;;; @@ -1532,6 +1554,7 @@ EAF doesn't work on Wayland :( (elfeed-update)) (map! :map 'elfeed-search-mode-map :desc "Update elfeed" :n "g R" #'elfeed-full-update) #+END_SRC + * My init.el This section is the [[./init.el][init.el]] section, which controls which Doom modules are loaded. @@ -1765,11 +1788,13 @@ Any git package can be configured for a particular commit or branch: (package! elfeed) (package! elfeed-protocol) (package! docker-tramp :disable t) +(package! org-ql) +(package! persist) #+END_SRC * Nix Integration 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, eaf, eaf-browser, org-nursery, phscroll, org-yaap, org-side-tree, theme, font, name, username, email, dotfilesDir, profile, wmType, defaultRoamDir, ... }: +{ config, lib, pkgs, eaf, eaf-browser, org-nursery, phscroll, org-yaap, org-side-tree, org-timeblock, theme, font, name, username, email, dotfilesDir, profile, wmType, defaultRoamDir, ... }: let themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + "../../../../themes"+("/"+theme)+"/polarity.txt")); dashboardLogo = ./. + "/nix-" + themePolarity + ".png"; @@ -1851,6 +1876,11 @@ in recursive = true; }; + home.file.".emacs.d/org-timeblock" = { + source = "${org-timeblock}"; + recursive = true; + }; + home.file.".emacs.d/eaf/app/browser" = { source = "${eaf-browser}"; recursive = true; @@ -1861,17 +1891,21 @@ in popd; "; }; + home.file.".emacs.d/org-nursery" = { source = "${org-nursery}"; }; + 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; executable = true; }; + home.file.".emacs.d/phscroll" = { source = "${phscroll}"; }; + home.file.".emacs.d/system-vars.el".text = '' ;;; ~/.emacs.d/config.el -*- lexical-binding: t; -*- diff --git a/user/app/doom-emacs/packages.el b/user/app/doom-emacs/packages.el index 01d876b..5aa60fc 100644 --- a/user/app/doom-emacs/packages.el +++ b/user/app/doom-emacs/packages.el @@ -25,3 +25,5 @@ (package! elfeed) (package! elfeed-protocol) (package! docker-tramp :disable t) +(package! org-ql) +(package! persist)