Sticky Notes Companion App Workflow - Windows

In this workflow I am using the LibreOffice Writer as Sticky Notes For My Desktop.

And it’s reflected in obsidian

It’s not the most compact approach that you could imagine I know someone suggested to write some python script Instant Note-Taking: Needs a Lightweight Sticky Note App for Obsidian - #18 by arturo2r .

Anyways I decided to showcase it since it allows for things such as pasting images/screenshots in the sticky note for later use in obsidian.

Perquisites:
Libre Office Installed (although MS Word could also be set up for this similarly)
DOCXER plugin Installed and enabled

Open Libre office go to ToolsMacros → **Edit Macros **

Create such macro in My Macros & Dialogs → Standard → Module1:

Sub MaximizeAndResize
    Dim oFrame as Object
    Dim oWindow as Object
    Dim aRect as New com.sun.star.awt.Rectangle

    oFrame = ThisComponent.CurrentController.Frame
    oWindow = oFrame.getContainerWindow()

    ' Set width (300) and height (300) in pixels
    aRect.X = 1450
    aRect.Y = 600
    aRect.Width = 600
    aRect.Height = 700

    oWindow.setPosSize(aRect.X, aRect.Y, aRect.Width, aRect.Height, 15)
End Sub

(It tells program to resize window so it looks like a sticky note additionally it positions it in the right bottom corner)

Now put the included StickyNoteTemplate.docx in your templates folder and create .ps1 script to open this template as a sticky note.

Make sure to enter your own vault folder as $destFolder and $source as a template location

$destFolder = "C:\Users\X\Desktop\LMS\000_Inbox\030_QuickNotes"

$source = "C:\Users\X\Desktop\LMS\Extras\Templates\StickyNotesTemplate\StickyNoteTemplate.docx"




# --- Generate Timestamped Filename ---

$timestamp = Get-Date -Format "yyyy-MM-dd_HH-mm-ss"

$newFile = Join-Path $destFolder "StickyNote($timestamp).docx"




# --- Run Copy and Launch Macro ---

if (Test-Path $source) {

    Copy-Item -Path $source -Destination $newFile

    $macroPath = "macro:///Standard.Module1.MaximizeAndResize()"

    

    # Opens LibreOffice and runs your global window-resize macro

    Start-Process swriter -ArgumentList $newFile, $macroPath

} else {

    Write-Host "Source file not found!" -ForegroundColor Red

}

Now the last step is to create shortcut on your desktop by right clicking wherever on the desktop and choosing create shortcut from context menu.

Here you should pass your ps1 script location as a Target

C:\Windows\System32\cmd.exe /c start /b /min "" powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\Users\X\Desktop\LMS\Extras\Templates\StickyNotesTemplate\StickyNote.ps1"

Also run it minimised so console doesn’t flash every time you open stickynote and if you wish change the icon for the shortcut and pin it to your taskbar.

Now to make your sticky note changes visible in obsidian you need to save docx you can also set up periodical autosave every minute by going to Tools → Options → General
And Save Document Automatically

StickyNotesTemplate.zip (15.5 KB)

Edit:

If you want to keep the sticky note always on top rewrite .ps1 as so

# --- Define Folders and Files ---
$destFolder = "C:\Users\X\Desktop\LMS\000_Inbox\030_QuickNotes"
$source = "C:\Users\X\Desktop\LMS\Extras\Templates\StickyNotesTemplate\StickyNoteTemplate.docx"

# --- Generate Timestamped Filename ---
$timestamp = Get-Date -Format "yyyy-MM-dd_HH-mm-ss"
$newFile = Join-Path $destFolder "StickyNote($timestamp).docx"

# --- Run Copy and Launch Macro ---
if (Test-Path $source) {
    Copy-Item -Path $source -Destination $newFile
    $macroPath = "macro:///Standard.Module1.MaximizeAndResize()"
    
    # Opens LibreOffice and runs your global window-resize macro
    Start-Process swriter -ArgumentList $newFile, $macroPath
    
    # --- Native Windows Pinning DLL ---
    $sourceInput = @"
    using System;
    using System.Runtime.InteropServices;
    public class WindowUtils {
        [DllImport("user32.dll", SetLastError = true)]
        public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);

        public static void PinWindow(IntPtr hWnd) {
            if (hWnd != IntPtr.Zero) {
                // -1 is HWND_TOPMOST (Always On Top)
                // 0x0003 ignores resizing and moving (SWP_NOSIZE | SWP_NOMOVE)
                SetWindowPos(hWnd, new IntPtr(-1), 0, 0, 0, 0, 0x0003);
            }
        }
    }
"@

    if (-not ([System.Management.Automation.PSTypeName]"WindowUtils").Type) {
        Add-Type -TypeDefinition $sourceInput
    }

    # --- SMART LOOP: Look for the VISIBLE window title ---
    $timeout = 15 # Give it 15 seconds to load
    $elapsed = 0
    $hwnd = [IntPtr]::Zero

    while ($elapsed -lt $timeout) {
        # This scans ALL windows on your PC for anything containing "LibreOffice Writer" and has a valid UI handle
        $proc = Get-Process | Where-Object { $_.MainWindowTitle -like "*LibreOffice Writer*" -and $_.MainWindowHandle -ne 0 }
        
        if ($proc) {
            $hwnd = $proc.MainWindowHandle
            break
        }
        Start-Sleep -Milliseconds 200 # Checks 5 times a second
        $elapsed += 0.2
    }

    # Pin it silently in the background!
    if ($hwnd -ne [IntPtr]::Zero) {
        [WindowUtils]::PinWindow($hwnd)
    }

    # --- 🧹 AUTO-CLEAN (Deletes files older than 30 days) ---
    Get-ChildItem $destFolder -Filter "*.docx" | Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-30) } | Remove-Item -Force

} else {
    Write-Host "Source file not found!" -ForegroundColor Red
}

I forked plugin by Nancyel so the canvas folder plugin detects docx files (I also made it look for changes on obsidian startup just in case any sticky note was created while obsidian was closed).

Foldercanvas Plugin Fork

Now, all the sticky notes are displayed on the Canvas, just like they would be on a corkboard over a desk.

Also updated the Office macro to randomly cycle the sticky note background color through the six most common options as you see above.

Sub MaximizeAndResize
    Dim oFrame as Object
    Dim oWindow as Object
    Dim aRect as New com.sun.star.awt.Rectangle
    
    Dim oDoc as Object
    Dim oStyleFamilies as Object
    Dim oPageStyles as Object
    Dim oStyle as Object
    Dim nColor as Long
    Dim nChoice as Integer

    ' --- Window Resizing Logic ---
    oFrame = ThisComponent.CurrentController.Frame
    oWindow = oFrame.getContainerWindow()

    aRect.X = 1450
    aRect.Y = 600
    aRect.Width = 600
    aRect.Height = 700

    oWindow.setPosSize(aRect.X, aRect.Y, aRect.Width, aRect.Height, 15)

    ' --- Specific Random Color Logic ---
    oDoc = ThisComponent
    oStyleFamilies = oDoc.getStyleFamilies()
    oPageStyles = oStyleFamilies.getByName("PageStyles")
    oStyle = oPageStyles.getByName("Standard")

    ' Initialize random number generator
    Randomize
    
    ' Pick a random number between 1 and 6
    nChoice = Int((6 * Rnd) + 1)

    ' Assign the color based on your table
    Select Case nChoice
        Case 1 ' Poppy/Bright Orange
            nColor = RGB(241, 90, 41)
        Case 2 ' Peach/Coral
            nColor = RGB(247, 148, 29)
        Case 3 ' Lemon/Yellow
            nColor = RGB(255, 212, 0)
        Case 4 ' Lime/Green
            nColor = RGB(141, 198, 63)
        Case 5 ' Sky Blue/Aqua
            nColor = RGB(102, 204, 204)
        Case 6 ' Lavender/Purple
            nColor = RGB(201, 160, 220)
    End Select

    ' Apply the chosen color
    oStyle.BackColor = nColor
End Sub