]> Freerunner's - dotfiles.git/commitdiff
lf: set cursor states
authorAndre Ramnitz <tux.rising@gmail.com>
Fri, 21 Mar 2025 07:05:27 +0000 (08:05 +0100)
committerAndre Ramnitz <tux.rising@gmail.com>
Fri, 21 Mar 2025 07:05:27 +0000 (08:05 +0100)
dot-config/lf/lfrc

index 372c73e15de2e51ffd637c40560d9eda9c1bdbfc..24b31d838984464d5ae21c1d1d68b53737e8b2d9 100644 (file)
@@ -43,6 +43,26 @@ set ifs "\n"
 # leave some space at the top and the bottom of the screen
 set scrolloff 3
 
+# hook command which is invoked when the terminal gains focus
+cmd on-focus-gained :{{
+    set cursorparentfmt "\033[7m"
+    set cursoractivefmt "\033[7m"
+    set cursorpreviewfmt "\033[4m"
+}}
+
+# hook command which is invoked when the terminal loses focus
+cmd on-focus-lost :{{
+    # set cursorparentfmt "\033[7;2m"
+    # set cursoractivefmt "\033[7;2m"
+    # set cursorpreviewfmt "\033[4;2m"
+    set cursorparentfmt ""
+    set cursoractivefmt ""
+    set cursorpreviewfmt ""
+}}
+
+# set initial values upon startup
+on-focus-gained
+
 # make sure trash folder exists
 %mkdir -p ~/.trash