Layton
January 28, 2026, 1:27am
1
Is there any Linux tool that enables the following? :
Create a script like this (example):
from datetime import datetime
now = datetime.now()
timestamp = now.strftime("%Y-%m-%d %H:%M")
return timestamp
Assign a keybind
When the keybind it pressed, automatically paste the output of the script
1 Like
Tasman
January 29, 2026, 11:28am
2
Check out espanso here: espanso.org
Not exactly an answer to what you are asking but does provide exactly what you are looking for.
Very flexible, useable and doesn’t cost anything.
1 Like
hydn
(Hayden James)
January 29, 2026, 12:20pm
3
You don’t need a single tool. This is usually done with a small script plus a keybinding.
On X11, bind a key to run a script and pipe its output to the clipboard using xclip or xsel (via xbindkeys or your WM).
On Wayland, do the same but use wl-copy and your compositor’s built-in keybinding system (GNOME, KDE, Sway, Hyprland).
most users skip Python entirely and just do:
date +"%Y-%m-%d %H:%M" piped into the clipboard.
hydn
(Hayden James)
January 29, 2026, 12:23pm
4
@Tasman Thanks for sharing. I had not come across Espanso before, but it looks like a solid fit for this use case. Dynamic date expansion on a trigger is exactly what the OP is describing.
Layton
February 3, 2026, 5:55pm
5
Can I create custom keybword’s+script’s with it?
Layton
February 3, 2026, 6:16pm
6
hydn:
On Wayland, do the same but use wl-copy and your compositor’s built-in keybinding system (GNOME, KDE, Sway, Hyprland).
I think Gnome keybidns are buggy, I set one put nothing happens when I press the keybind