Srijan Choudhary
banner
srijan4.bsky.social
Srijan Choudhary
@srijan4.bsky.social
I've been developing software for more than 10 years, and leading software teams for the last 5 years. I've worked with several languages, but mostly use #Python and #Erlang these days, using #Emacs.

I'm interested in software team leadership, functional
Reposted by Srijan Choudhary
I so love my #emacs, was configuring some packages and wanted something easier, so I wrote a small function that will look up all the custom variables for a package and provide them as completion, allowing you to easily insert them. Trying to be more like
@xenodium by sharing.
October 30, 2025 at 3:05 PM
Reposted by Srijan Choudhary
I so love my #emacs, was configuring some packages and wanted something easier, so I wrote a small function that will look up all the custom variables for a package and provide them as completion, allowing you to easily insert them. Trying to be more like @xenodium.bsky.social by sharing.
October 30, 2025 at 3:00 PM
Triggering Orgzly sync on Android when Org file changes (https://srijan.ch/triggering-orgzly-sync-on-android-when-org-file-changes)
Triggering Orgzly sync on Android when Org file changes
### Introduction To use my org GTD system on the go, I use the excellent Orgzly Revived mobile app for Android. To sync the org files between my laptop and my phone, I use syncthing (specifically, the Syncthing Android Fork by Catfriend1). This allows me to quickly capture things from my phone, get reminder notifications of time-sensitive tasks, and mark tasks complete from my phone. The widgets are also useful for quickly looking at some contexts like errands or calls. ### Sync Issues However, Orgzly works by contructing a copy of the contents in it's own database and synchronizing it against the files periodically or when some action is taken in the app. Right now, it does not support synchronizing the data when the file changes. For me, this has sometimes lead to a conflict between the Orgzly database and the actual files in the org folder. This only happens if the org file is edited on my laptop and something is also edited in the Orgzly app before syncing. But, the Orgzly app supports intents that can be used from Tasker, Automate, etc to trigger an event-based sync. ### Tasker Profile So, I created a tasker profile to do this. It was surprisingly easy (I've used tasker before, though not too much). It can be found here: https://taskernet.com/?public&tags=orgzly&time=AllTime called "Run Orgzly Sync When Org Files Change". Here's the basic flow of the profile: Profile: Run Orgzly Sync When Org Files Change Settings: Notification: no Variables: [ %orgfolder:has value ] Event: File Modified [ File:%orgfolder Event:* ] Enter Task: Orgzly Sync Settings: Run Both Together A1: If [ %evtprm1 ~ *.org & %evtprm2 ~ ClosedWrite/MovedTo ] A2: Send Intent [ Action: com.orgzly.intent.action.SYNC_START Cat: None Package: com.orgzlyrevived Class: com.orgzly.android.ActionReceiver Target: Broadcast Receiver ] A3: End If ### How it works 1. When importing this profile, it will ask for your org folder in the local Android filesystem. 2. Once selected and the profile is activated, it will start monitoring this folder for inotify events. 3. When any file is modified (or created or moved to/from the folder or deleted), this profile is triggered. It received the parameters: full path of the affected file, and the actual event. 4. Then, it checks if the affected file is an org file (ending in `.org`) AND if the event is one of ClosedWrite or MovedTo. I filtered to these events because they are usually the last event received for an edit. 5. If yes, then Orgzly sync is triggered using an intent. I've been using this for the last several months, and it works well as long as both devices are online when making edits. Conflicts can still happen if, for example, I make some edits on my laptop and subsequently on my phone but the phone is not online or the syncthing app is not running due to data saver or battery saver active. In those cases, eventually syncthing creates a conflicted file that I can manually resolve. ### Limitations 1. It does not support recursive files inside the folder. Tasker right now does not support recursively watching a folder, but if it's added this can be a good edition; specially because Orgzly Revived supports that. 2. Since this watches the files in the folder, it also triggers a sync if Orgzly app was used to change the file. Not sure if this can be filtered somehow. Maybe based on foreground app? But it seems flakey. ### Alternatives 1. Orgzly Revived has a git sync backend in beta. This might work better with auto-commit & push. 2. Using Emacs on Android instead of Orgzly is also an option, but I felt it did not work very well without an external keyboard. Also, it does not have widgets.
srijan.ch
January 13, 2025 at 6:33 PM
Capturing slack messages directly into Emacs orgmode inbox (https://srijan.ch/capturing-slack-messages-directly-into-emacs-orgmode-inbox)
Capturing slack messages directly into Emacs orgmode inbox
Org capture button in Slack message popup Ever since switching to orgmode as my GTD system, I've been trying to (slowly) optimize my capture system for things coming to me from different places. One of the things that I was not satisfied with was capturing and processing inputs from Slack. Slack messages can easily get lost in the fast-paced stream of conversations. Manually copying and pasting messages introduces too much friction, and also removes some context (backlinks), unless a link to the original message is also manually copied. There are ways to save messages in Slack itself, but it just makes it another Inbox to check, and I'm trying to reduce that. I started by using the saved messages feature to save messages in a single place, and later either shifting them to my org inbox manually, or directly working on them and completing them. Then, I shifted to using the Slack Todoist integration to save slack messages to Todoist, and pulling them from Todoist into my org Inbox. I've now found a better mechanism that allows me to seamlessly capture Slack message with it's context into orgmode. Here's a demo: Demo video showing a custom slack button to trigger org capture with the selected message's contents and a link back to the message ## Demo breakdown This method uses userscripts to add a custom button to the hover menu that comes up for any message in slack, and triggers org protocol capture with the message details when the button is clicked. The message details include the sender, message text, and a direct link back to the message. I've set up this protocol handler to ask me to enter the heading of the capured item, but it can be as easily set up to directly capture the message without user input. ## Setup and Implementation ### Prerequisites 1. Slack running in a browser (instead of a desktop app) 2. Browser extention for userscripts (Tampermonkey, Violentmonkey, Greasemonkey, etc) 3. Emacs with orgmode installed 4. Org protocol setup I didn't find a good way to inject userscripts into the Slack destop app, so for now, this method requires using Slack in a browser. It also works when Slack is installed using the "Install Page as App" feature of the browser. ### Setting up Org Protocol Capture Setting up org protocol capture involves two steps: configuring your OS to use Emacs to open `org-protocol://` links, and configuring Emacs to save the captured data as you want. For OS setup, please check the guides for your OS here: https://orgmode.org/worg/org-contrib/org-protocol.html#orge00964c On Emacs side, this is the minimal config required: (server-start) (setq-default org-agenda-files '("~/org")) (setq-default my-org-inbox (expand-file-name "inbox.org" "~/org")) (setq-default org-capture-templates '( ("i" "Inbox" entry (file my-org-inbox) "* %?\n%i\n%U" :kill-buffer t) ("l" "Inbox with link" entry (file my-org-inbox) "* %?\n%i\n%a\n%U" :kill-buffer t))) (setq-default org-protocol-default-template-key "l") (require 'org-protocol) An optional enhancement that can be seen in the demo is: open a new emacs frame to capture this message, then close it automatically after the capture has been done. For this, I use the config snippet from prot's excellent post: https://protesilaos.com/codelog/2024-09-19-emacs-command-popup-frame-emacsclient/ To run emacsclient with the popup frame parameter, I use: emacsclient --create-frame -F \ '((prot-window-popup-frame . t) (name . "org-protocol-capture") (width . 80))' \ -- %u Emacsclient's args can be set in the desktop entry file (linux) or org-protocol.app file (OSX) when setting up org-protocol. ### The userscript For the userscript, I searched for an existing published userscript for Slack that adds a button, then tweaked it a bit to configure the button according to my needs. I've published the userscript here: https://greasyfork.org/en/scripts/521908-slack-org-protocol-capture From this, I learned about an interesting API called MutationObserver that seems very useful for userscripts. ## Notes ### Using emacs-slack Another simple approach for this can be to use the emacs-slack package to directly use Slack from Emacs. I tried this, and it does not work very well for me because: 1. My org limits Slack session authentication to 1 week, and authenticating in emacs-slack is a little cumbersome. 2. We also use Slack huddles, and it does not work well with emacs-slack. ### Possible Improvements 1. Make org capture template configurable 2. Add tooltip to the button 3. Pass even more metadata like message timestamp, channel name, emojis, etc. 4. Maybe some keyboard shortcuts to trigger the capture? ### Limitations / Drawbacks Since this is dependent on the HTML structure of the slack web app, it can be fragile and can break easily if there are changes in the app. This userscript uses the MutationObserver API to observe DOM changes in the whole slack workspace. So, it has some impact on performance. However, I've been using this daily for the last several months and I have not noticed any issues.
srijan.ch
December 27, 2024 at 12:01 PM
Read an interesting set of posts today: https://lethain.com/extract-the-kernel/ and https://lethain.com/executive-translation/ . The basic concept is:

> ... executives are generally directionally correct but specifically wrong, and it’s your job to […] https://srijan.ch/notes/2024-10-08-002
Original post on srijan.ch
srijan.ch
October 8, 2024 at 7:40 AM
Tried using X11 on #Linux the last few days due to some issues with Zoom screensharing in Wayland with the latest pipewire, and I already miss #Wayland.

Issues I faced with X11:

1. Smooth scrolling broken
2. Apps work noticeably slower
3. Screen […] https://srijan.ch/notes/2024-10-08-001
Original post on srijan.ch
srijan.ch
October 8, 2024 at 3:45 AM
I have been using #karousel on #KDE for several weeks, and yesterday shifted to #PaperWM on #GNOME. Took some time to configure things like I wanted, but it's much smoother than karousel (and fancier).

Overall, I like the scrolling tiling pane paradigm. I […] https://srijan.ch/notes/2024-10-01-002
Original post on srijan.ch
srijan.ch
October 1, 2024 at 10:50 PM
#Emacs #TIL : I learned about `save-interprogram-paste-before-kill` - which saves the existing system clipboard text into the kill ring before replacing it. This ensures that Emacs kill operations do not irrevocably overwrite existing clipboard text.

A […] https://srijan.ch/notes/2024-09-24-001
Original post on srijan.ch
srijan.ch
September 24, 2024 at 5:20 PM
Emacs 30.1 highlight - intuitive tab line (https://srijan.ch/emacs-30-1-highlight-intuitive-tab-line)
Emacs 30.1 highlight - intuitive tab line
The first Emacs 30.0.91 pretest for what will be the 30.1 release of Emacs was announced on the mailing list a few days ago. I was going through the NEWS file, and found something that I've wanted in Emacs for a while now. One of the niggles I had with Emacs was its tab behavior. It worked differently from how other applications that I'm used to work (firefox, kitty, etc). In emacs, tab-per-buffer can be achieved by using the tab-line-mode. But, before now, it had the following problems: 1. Since tab-line-mode listed buffers sorted by recently visited, so the order or tabs kept changing 2. There was no wrap-around when trying to go to the next tab from the last tab Here's a video showing the old behavior: A video showing tab-line-mode behavior when switching to next/prev tabs. The tab selection does not wrap around and behaves in an unexpected manner. It also starts showing buffers that have not previously been shown in this window. To solve this, there is package called intuitive-tab-line-mode that solves the above two problems. But, I had problems with it because it did not work well with the beframe package that I also use. Now, with Emacs 30.1, this behavior is what comes out-of-the-box with Emacs. The only config needed is to enable `global-tab-line-mode`. And because it's built-in, it works with other modes like beframe. A video showing an intuitive tab-line-mode behavior. Tab selection wraps around and only cycles between buffers already showing in current window. Here's my config for minimal intuitive per-buffer tabs in Emacs >= 30.0.91: (use-package tab-line :demand t :bind (("C-<iso-lefttab>" . tab-line-switch-to-prev-tab) ("C-<tab>" . tab-line-switch-to-next-tab)) :config (global-tab-line-mode 1) (setq tab-line-new-button-show nil tab-line-close-button-show nil)) More details about this change can be found in it's bug report mail thread.
srijan.ch
September 15, 2024 at 4:45 AM
Something precious stolen by magic.
#WitchHatAtelier #Manga #Magic
srijan.ch/notes/2024-0...
September 2, 2024 at 6:17 PM
I have been reading books mostly on Kindle for the last 10 years or so. Visited a nearby library today.

I didn't realize I was missing the experience of browsing shelves, stumbling upon unexpected gems, getting lost in the recommendations section, and […] https://srijan.ch/notes/2024-08-22-001
August 22, 2024 at 3:20 AM