Sep-11-2023, 09:06 AM
(This post was last modified: Sep-12-2023, 03:09 AM by ineuw.
Edit Reason: additional clarification
)
This simple date time & filename script is activated from Autokey and works well, except where I need it most - in Geany. In a GTK based theme, regardless of the title font size, the filename is shortened to fit long file names in their scheme.
Here are two apps displaying the filename in their title-bar, both in GTK and same theme in Cinnamon:
# 2023-08-06 01:38 - utils_update_system_and local_mime_databases.sh - Pluma
# 2023-09-08 22:24 - utils_update_s…me_databases.sh - /media/dgdrive/scripts/utils - Geany
I am looking for the code snippet to extract the active document name in Python before it's been altered by a display.
This is my current script.
Here are two apps displaying the filename in their title-bar, both in GTK and same theme in Cinnamon:
# 2023-08-06 01:38 - utils_update_system_and local_mime_databases.sh - Pluma
# 2023-09-08 22:24 - utils_update_s…me_databases.sh - /media/dgdrive/scripts/utils - Geany
I am looking for the code snippet to extract the active document name in Python before it's been altered by a display.
This is my current script.
clipboard.fill_clipboard('') time.sleep(0.1) activetitle_ = window.get_active_title() time.sleep(0.1) home_ = '<home>' paste_ = '<shift>+<insert>' ts_ = time.time() timestamp_ = datetime.datetime.fromtimestamp(ts_).strftime('%Y-%m-%d %H:%M') time.sleep(0.1) combined_ = '# ' + timestamp_ + ' - ' + activetitle_ time.sleep(0.1) clipboard.fill_clipboard(combined_) time.sleep(0.1) keyboard.send_keys(home_) keyboard.send_keys(paste_)
Linux Mint Cinnamon 22 - Python 3.12.3 - Autokey-gtk 0.96.0 as of 2024-01-13.