<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>Ishaat Chowdhury</title>
<link>https://www.ishaat.ca/</link>
<atom:link href="https://www.ishaat.ca/index.xml" rel="self" type="application/rss+xml"/>
<description></description>
<generator>quarto-1.9.36</generator>
<lastBuildDate>Sun, 12 Feb 2023 00:00:00 GMT</lastBuildDate>
<item>
  <title>My Ultimate Windows 10 Window Management Setup</title>
  <dc:creator>Ishaat Chowdhury</dc:creator>
  <link>https://www.ishaat.ca/posts/2023/001-my-ultimate-windows-10-window-management-setup/</link>
  <description><![CDATA[ 





<section id="background" class="level1">
<h1>Background</h1>
<p>I’ve always been disappointed with the default experience of managing application windows and searching (for files, open apps, anything really) in Windows 10. In general, I find that Windows isn’t as keyboard driven as I’d like.</p>
<p>Below is a list of features I need from my graphical shell:</p>
<ul>
<li>Manipulate application windows and navigate virtual desktops using keyboard shortcuts</li>
<li>Quickly switch between apps/windows using keyboard</li>
<li>Search open windows using keyboard in a view with window previews</li>
<li>Search files and launch applications quickly</li>
<li>Automatically tile windows in order to keep things organized and make effective use of screen space</li>
<li>Make it clear which application window is focused</li>
<li>Reduce mouse movements as much as possible by having the mouse cursor automatically move according to focus events (ex. Alt-Tab)</li>
</ul>
<p>I rely on a mix of built-in Windows settings and shortcuts as well as external programs and scripts to make this workflow possible for me on Windows 10/11. It took me some time to figure out how to piece all these things together into a coherent workflow, so I decided to document my steps in this post. Hopefully, you find the contents of this post useful. If not, at least I have this setup documented for myself.</p>
</section>
<section id="built-in-settingsshortcuts" class="level1">
<h1>Built-in Settings/Shortcuts</h1>
<p>These are a list of built-in Windows settings and keyboard shortcuts related to window management that I use on a daily basis.</p>
<section id="basic-window-manipulation" class="level2">
<h2 class="anchored" data-anchor-id="basic-window-manipulation">Basic window manipulation</h2>
<p><code>Win+Up</code> (may have to repeat again): Maximize window. <code>Win+Down</code> (may have to repeat again): Minimize window. <code>Alt+F4</code>: Close window.</p>
<p>Although there are built-in shortcuts for snapping windows to the left/right half of screen or quarters of a screen, I don’t use them since I rely on FancyWM to perform these actions.</p>
</section>
<section id="switch-between-virtual-desktops" class="level2">
<h2 class="anchored" data-anchor-id="switch-between-virtual-desktops">Switch between virtual desktops</h2>
<p><code>Ctrl+Win+Left</code> : Switch to the previous virtual desktop. <code>Ctrl+Win+Right</code>: Switch to the next virtual desktop.</p>
<p><code>Win+Tab</code>: Open the virtual desktop switcher. I mainly use this to see which virtual desktops are empty and move to them. You can move to other desktops by clicking on them. Hit the shortcut again or hit <code>Esc</code> to exit out of this view.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.ishaat.ca/posts/2023/001-my-ultimate-windows-10-window-management-setup/win10wmsetup-desktop-switcher.png" class="img-fluid figure-img"></p>
<figcaption>Virtual destkop switcher</figcaption>
</figure>
</div>
</section>
<section id="move-window-to-nextprevious-monitor" class="level2">
<h2 class="anchored" data-anchor-id="move-window-to-nextprevious-monitor">Move window to next/previous monitor</h2>
<p><code>Shift+Win+Left</code>: Send window to the previous monitor. <code>Shift+Win+Right</code>: Send window to the next monitor.</p>
</section>
<section id="navigating-elements-within-popups" class="level2">
<h2 class="anchored" data-anchor-id="navigating-elements-within-popups">Navigating elements within popups</h2>
<p><code>Tab</code>: Cycle to next element (ex. a button). <code>Shift+Tab</code>: Cycle to the previous element (ex. a button).</p>
<p>Works not just in popups but in UAC prompts, notification tray, and many other UI elements.</p>
</section>
<section id="open-notification-view" class="level2">
<h2 class="anchored" data-anchor-id="open-notification-view">Open notification view</h2>
<p><u>Windows 10</u>: <code>Win+A</code>: Open the notification tray. <u>Windows 11</u>: <code>Win+N</code>: Open the notification tray.</p>
<p>We can use the <code>Tab</code>/<code>Shift+Tab</code> shortcuts from the above section to navigate the notification view. Hit <code>Shift+Tab</code> a few times after opening the view to get to the clear all notifications button. Then hit <code>Enter</code> to clear all notifications.</p>
<p>I find this trick is really useful when I’m using my 43” 4K monitor for work, since it’s a pain to move the mouse to the other side of the screen just to clear notifications.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.ishaat.ca/posts/2023/001-my-ultimate-windows-10-window-management-setup/win10wmsetup-close-notifications-view.png" class="img-fluid figure-img"></p>
<figcaption>Close notification view</figcaption>
</figure>
</div>
</section>
<section id="active-window-border-highlight-using-accent-color" class="level2">
<h2 class="anchored" data-anchor-id="active-window-border-highlight-using-accent-color">Active window border highlight using accent color</h2>
<p>Open Settings &gt; Personalization &gt; Colors. Pick a specific accent color or pick accent color automatically based on wallpaper. We need to have an accent color set since that will be the color the active window border is highlighted with.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.ishaat.ca/posts/2023/001-my-ultimate-windows-10-window-management-setup/win10wmsetup-personalization-settings-color.png" class="img-fluid figure-img"></p>
<figcaption>Color settings</figcaption>
</figure>
</div>
<p>Here’s what application windows look by default, without active window border highlight.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.ishaat.ca/posts/2023/001-my-ultimate-windows-10-window-management-setup/win10wmsetup-wt-focused-no-highlight.png" class="img-fluid figure-img"></p>
<figcaption>Windows Termianl focused with active window border highlight off</figcaption>
</figure>
</div>
<p>Windows terminal is the active window here. But it’s really hard to tell that.</p>
<p>Now, here’s what it looks like when active window border highlight is on. It’s much more obvious that Windows Terminal is the focused window since the border is highlighted in red.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.ishaat.ca/posts/2023/001-my-ultimate-windows-10-window-management-setup/win10wmsetup-wt-focused-highlight.png" class="img-fluid figure-img"></p>
<figcaption>Windows Terminal focused with active window border highlight on</figcaption>
</figure>
</div>
<p>The built-in active window highlight does have some limitations though. Mainly, it doesn’t seem to work on apps built with Electron.</p>
</section>
<section id="switch-between-apps-on-task-bar-using-keyboard" class="level2">
<h2 class="anchored" data-anchor-id="switch-between-apps-on-task-bar-using-keyboard">Switch between apps on task bar using keyboard</h2>
<p>On each machine, I pin my 10 most used applications at the beginning of the taskbar. That way I can leverage the default shortcuts to switch to any of the first 10 pinned apps on the taskbar.</p>
<p><code>Win+1</code>: Switch to first pinned app on the taskbar <code>Win+2</code>: Switch to second pinned app on the taskbar … <code>Win+9</code>: Switch to the ninth pinned app on the taskbar <code>Win+0</code>: Switch to the tenth pinned app on the taskbar</p>
<p>Here’s an illustration from my taskbar.</p>
<p><img src="https://www.ishaat.ca/posts/2023/001-my-ultimate-windows-10-window-management-setup/win10wmsetup-taskbar-switch.png" class="img-fluid" alt="Taskbar App Numbering"> <!-- [](win10wmsetup-taskbar-switch.png) --></p>
<p>Now, these keyboard shortcuts have some interesting behaviour:</p>
<ol type="1">
<li>When a pinned app has no windows open, hitting the shortcut will launch the app in the current virtual desktop. In my example, if I hit <code>Win+0</code>, it would open Bitwarden in the current virtual desktop.</li>
<li>When a pinned app has a single window open and the window is not focused, hitting the shortcut will switch to the virtual desktop the window is on and will focus the window. If the window was minimized, it will be restored.</li>
<li>When a pinned app has a single window open and the window is focused, hitting the shortcut will minimize it.</li>
<li>When a pinned app has multiple windows open, hitting the shortcut will cycle through the windows of the application. Releasing the shortcut will switch to the selected window of the app.
<ul>
<li>Note: You can only cycle between windows of the application, you can’t minimize/maximize any of the windows using the shortcut like you could when the app only had one window.</li>
</ul></li>
</ol>
</section>
<section id="other-keyboard-shortcuts" class="level2">
<h2 class="anchored" data-anchor-id="other-keyboard-shortcuts">Other keyboard shortcuts</h2>
<p>I only listed my most used keyboard shortcuts in this article but you can find full list of them <a href="https://support.microsoft.com/en-us/windows/keyboard-shortcuts-in-windows-dcc61a57-8ff0-cffe-9796-cb9706c75eec#WindowsVersion=Windows_10">here</a>.</p>
</section>
<section id="multitasking-settings" class="level2">
<h2 class="anchored" data-anchor-id="multitasking-settings">Multitasking settings</h2>
<p>Open <code>Settings &gt; System &gt; Multitasking</code>. I like to use the following settings. I especially rely on Alt+Tab showing windows from all virtual desktops. I personally don’t find switching between Edge tabs in my OS to be a useful feature since I can do that from within Edge just fine.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.ishaat.ca/posts/2023/001-my-ultimate-windows-10-window-management-setup/win10wmsetup-multitasking-settings.png" class="img-fluid figure-img"></p>
<figcaption>Windows Multi-tasking Settings</figcaption>
</figure>
</div>
</section>
<section id="improve-windows-search" class="level2">
<h2 class="anchored" data-anchor-id="improve-windows-search">Improve Windows Search</h2>
<p>Open <code>Settings &gt; Search &gt; Searching Windows</code>. Make sure Enhanced search is on, so Windows can find more files than by default.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.ishaat.ca/posts/2023/001-my-ultimate-windows-10-window-management-setup/win10wmsetup-windows-file-search-settings.png" class="img-fluid figure-img"></p>
<figcaption>Windows File Search Settings</figcaption>
</figure>
</div>
</section>
</section>
<section id="third-party-programs" class="level1">
<h1>Third-Party Programs</h1>
<p>For me, the built-in settings and behaviours of Windows aren’t enough. To create the workflow for managing windows and searching files that I want, this is my list of essential programs as well as relevant configuration for them.</p>
<section id="everything" class="level2">
<h2 class="anchored" data-anchor-id="everything">Everything</h2>
<p>Even with Enhanced Windows Search enabled, I sometimes can’t find what I’m looking for. So I use <a href="https://www.voidtools.com/">Everything</a> in those cases.</p>
</section>
<section id="powertoys" class="level2">
<h2 class="anchored" data-anchor-id="powertoys">PowerToys</h2>
<p><a href="https://learn.microsoft.com/en-us/windows/powertoys/">PowerToys</a> is a collection of useful utilities that make Windows so much more useful. Here I will focus on the utilities and the settings for those utilities that are related to window management and searching.</p>
<p>In terms of general settings, I always run PowerToys as Admin, so I can use the utilities on admin windows.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.ishaat.ca/posts/2023/001-my-ultimate-windows-10-window-management-setup/win10wmsetup-powertoys-admin.png" class="img-fluid figure-img"></p>
<figcaption>Run PowerToys as Admin</figcaption>
</figure>
</div>
<section id="powertoys-run" class="level3">
<h3 class="anchored" data-anchor-id="powertoys-run">PowerToys Run</h3>
<p><a href="https://learn.microsoft.com/en-us/windows/powertoys/run">PowerToys Run</a> is an application launcher for Windows. You can use it to search applications, open windows, files, do currency conversions, and much more. I like to think of it as a superpowered Windows search. I’ve been a user of application launchers across multiple platforms (Launchy, KRunner) for years now. I can’t live without them anymore!</p>
<p>Here’s some basic settings I enable for PowerToys Run:</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.ishaat.ca/posts/2023/001-my-ultimate-windows-10-window-management-setup/win10wmsetup-powertoys-run-settings.png" class="img-fluid figure-img"></p>
<figcaption>PowerToys Run Settings</figcaption>
</figure>
</div>
<p>For built-in plugins, I disable <code>Web Search</code> and <code>OneNote</code>. I enable everything else. The <code>Visual Studio Code Workspaces</code> plugin is particularly handy for me.</p>
<p>I install an unofficial <a href="https://github.com/lin-ycv/EverythingPowerToys/releases">Everything Plugin</a> for PowerToys run. The link will take you to the releases page which has the installation instructions. The only thing to note is that you need to extract the zip file using 7z instead the built-in archiver. Alternately, can install the plugin from <a href="https://community.chocolatey.org/packages/everythingpowertoys">chocolatey</a>.</p>
<p>After installing the plugin, restart PowerToys. Then enable the plugin and set a global activation key.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.ishaat.ca/posts/2023/001-my-ultimate-windows-10-window-management-setup/win10wmsetup-powertoys-run-everything.png" class="img-fluid figure-img"></p>
<figcaption>PowerToys Run EveryThing Plugin Settings</figcaption>
</figure>
</div>
<p>This is how I typically run searches using Everything. I rarely use the actual Everything application.</p>
</section>
<section id="fancyzones" class="level3">
<h3 class="anchored" data-anchor-id="fancyzones">FancyZones</h3>
<p><a href="https://learn.microsoft.com/en-us/windows/powertoys/fancyzones">FancyZones</a> is a utility that extends the built-in window snapping/tiling features of Windows. You can specify custom zones that you can manually snap windows to using the mouse. By default, Windows can only snap windows to half or a quarter of the screen. But with FancyZones, you can create your own custom zones which you pre-define and then you snap to these zones.</p>
<p>I actually find the core functionality of FancyZones to be useless. It’s too much work for me to manually snap windows using my mouse compared to using a tiling WM extension like FancyWM. But there is one useful thing that FancyZones does for me.</p>
<p>When using multiple monitors, by default Windows will open applications on the primary monitor, not the current active monitor. This drives me nuts since I always want apps to open on the monitor that has focus because that’s where I usually need the application to be and that’s also typically where my mouse cursor is. Without FancyZones and this specific setting enabled, I would always have to drag the window to the monitor that previously had focus if it wasn’t the primary monitor which was a pain!</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.ishaat.ca/posts/2023/001-my-ultimate-windows-10-window-management-setup/win10wmsetup-fancyzones-window-settings.png" class="img-fluid figure-img"></p>
<figcaption>FancyZones Window Settings</figcaption>
</figure>
</div>
<p>I also like to make sure these settings for FancyZones are enabled to prevent dragging windows using mouse from activating FancyZones.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.ishaat.ca/posts/2023/001-my-ultimate-windows-10-window-management-setup/win10wmsetup-fancyzones-zone-settings.png" class="img-fluid figure-img"></p>
<figcaption>FancyZones Zone Settings</figcaption>
</figure>
</div>
</section>
</section>
<section id="alt-tab-terminator" class="level2">
<h2 class="anchored" data-anchor-id="alt-tab-terminator">Alt-Tab Terminator</h2>
<p><a href="https://www.ntwind.com/software/alttabter.html">Alt-Tab Terminator</a> is a program that replaces the default Windows Alt+Tab view (which shows windows with small previews in a grid) with a list view that is searchable and has much larger window previews.</p>
<p>Here’s a screenshot of the program running:</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.ishaat.ca/posts/2023/001-my-ultimate-windows-10-window-management-setup/win10wmsetup-alt-tab-terminator.png" class="img-fluid figure-img"></p>
<figcaption>Alt-Tab Terminator</figcaption>
</figure>
</div>
<p>For me the app has a few killer features: - Search and preview open applications (this is super useful when you have a lot of apps open) - Ability to set a keyboard shortcut to cycle through windows of same application - By default Windows can’t do this - On OSX/Linux typically this behaviour is bound to Alt + ` by default</p>
<p>These are my preferred settings for this program:</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.ishaat.ca/posts/2023/001-my-ultimate-windows-10-window-management-setup/win10wmsetup-alt-tab-terminator-settings-general.png" class="img-fluid figure-img"></p>
<figcaption>Alt-Tab Terminator Settings: General</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.ishaat.ca/posts/2023/001-my-ultimate-windows-10-window-management-setup/win10wmsetup-alt-tab-terminator-settings-appearance.png" class="img-fluid figure-img"></p>
<figcaption>Alt-Tab Terminator Settings: Appearance</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.ishaat.ca/posts/2023/001-my-ultimate-windows-10-window-management-setup/win10wmsetup-alt-tab-terminator-settings-hotkeys.png" class="img-fluid figure-img"></p>
<figcaption>Alt-Tab Terminator Settings: HotKeys</figcaption>
</figure>
</div>
<p>As you can see, I don’t actually use Alt+Tab Terminator to replace Alt+Tab. In general, I only use Alt+Tab to switch between the current window and previously focused window. The default Alt+Tab is fine for that. Beyond that, I typically switch between my most common applications using <code>Win + Number</code> shortcuts. I use Alt+Tab Terminator only to switch to applications that I can’t switch to using <code>Win + Number</code> . I launch Alt-Tab Terminator by using a custom keyboard shortcut <code>CapsLock + Tab</code>. This keyboard shortcut invokes Alt-Tab Terminator by invoking it’s exe directly (see kanata section for more details). I don’t use Alt+Tab Terminator to replace <code>Win + Tab</code> since the virtual desktop preview is pretty useful for me.</p>
</section>
<section id="fancywm" class="level2">
<h2 class="anchored" data-anchor-id="fancywm">FancyWM</h2>
<p><a href="https://apps.microsoft.com/store/detail/fancywm-dynamic-tiling-window-manager/9P1741LKHQS9?hl=en-us&amp;gl=us">FancyWM</a> is a tiling window manager extension for the Windows Desktop. It doesn’t replace the built-in Window Manager, it simply hooks into it and provides tiling capabilities over it. It’s similar in concept to <a href="https://github.com/pop-os/shell">Pop Shell</a>, <a href="https://github.com/Bismuth-Forge/bismuth">Bismuth</a>, or <a href="https://github.com/koekeishiya/yabai">yabai</a>.</p>
<p>I personally find a tiling window manager to be really useful. It helps me keeps my application windows organized and lets me navigate open windows easily with the keyboard. When using a laptop, I don’t have to use the trackpad as much to get around. When using a large 4K monitor, it lets me create layouts on the fly to effectively use all that space without getting eye strain or having to use the mouse too much.</p>
<p>There are a lot of other projects out there trying to bring tiling window manager capabilities to the Windows Desktop. But I found those projects were either unstable, hard to configure, hard to use, or didn’t integrate well with Windows.</p>
<p>These are the things I really like about FancyWM: - Easy to install (just grab it from the MS Store) - Easy to use - Almost no configuration required - Don’t need to remember complicated keyboard shortcuts to start using it - FancyWM uses an activation key sequence (default <code>Shift+Win</code> ) from which you then type in another keyboard shortcut to perform some action. If you haven’t typed another shortcut after hitting the activation sequence, a menu with all available shortcuts will popup making it so you don’t really need to memorize anything to start using FancyWM. - It only tiles restored windows - FancyWM doesn’t tile maximized windows so you can use the entire screen when the situation calls for it - When the window is restored (ie. unmaximized), FancyWM will then automatically tile it - Can manipulate tiled windows with both mouse and keyboard shortcuts - Can resize and move Windows around using mouse and they will still be automatically tiled. - Can even move around entire panels using mouse (I think this is the only way, I haven’t found keyboard shortcut for it). - Integrates with native Windows Virtual Desktops - Other tiling WM projects for Windows try to create their own “workspace” functionality outside of native virtual desktops and that has never worked well for me. The built-in virtual desktop implementation in Windows is fine, I just need more keyboard shortcuts to work with them than what comes baked into Windows (which FancyWM does deliver).</p>
<p>Here’s a short demo of FancyWM. These are the features of FancyWM I’m showing (all using keyboard shortcuts): - Split panel horizontally or vertically - Stack windows in same panel - Focus windows in a direction - Move and swap windows in a direction - Resize windows - Temporarily float windows</p>
<div class="quarto-video ratio ratio-16x9"><iframe data-external="1" src="https://www.youtube.com/embed/nNFbUpHJmG4" title="" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></div>
<p>Now here’s another demo of FancyWM focusing on handling of virtual desktops. I’m demoing the following features (all using keyboard shortcuts): - Focus specific virtual desktop by number (<code>Shift+Win</code> followed by <code>Number</code> after short delay) - This shortcuts seems to even work in the Virtual Desktop Switcher - Move window to specific virtual desktop by number (<code>Shift+Win</code> followed by <code>Shift+Number</code> after short delay) - Focus previous virtual desktop (<code>Shift+Win</code> followed by <code>Q</code> after short delay) - This shortcuts seems to even work in the Virtual Desktop Switcher - Move window to previous virtual desktop (<code>Shift+Win</code> followed by <code>Shift+Q</code> after short delay)</p>
<div class="quarto-video ratio ratio-16x9"><iframe data-external="1" src="https://www.youtube.com/embed/j7wu2VmVx6c" title="" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></div>
<p>FancyWM has a lot of other cool features that I haven’t gone into (ex. moving window to specific monitor number, etc.) and new features are added regularly.</p>
<p>While the activation sequence makes FancyWM very user friendly, it also introduces a lot of extra keystrokes everytime you need to do something. Luckily, FancyWM has the capability to call it’s executable directly to perform these actions. To focus to the window on the left you can use this command in a shell: <code>cmd fancywm.exe --action MoveFocusLeft</code>. Then, you can use a keyboard remapping software like AutoHotKey or kanata to bind these commands to custom keyboard shortcuts.</p>
</section>
<section id="kanata" class="level2">
<h2 class="anchored" data-anchor-id="kanata">Kanata</h2>
<p><a href="https://github.com/jtroo/kanata">kanata</a> is an advanced keyboard remapping software that allows you to segment your keyboard into several “layers” of functionality and to perform different actions depending on how you press a key (tapping a key versus holding a key can perform two different actions). You can set up your keyboard so that holding a specific key will activate a new layer on your keyboard where keys will behave differently than on your default layer.</p>
<p>Here’s an example. When you’re typing normally the default layer is active. In this case, when you type <code>n</code>, it will output ‘n’ as normal. Say you hold <code>Tab</code> and while it’s held you enter another layer. In this layer, when you hit <code>n</code> instead of outputting ‘n’ you output <code>Ctrl+Win+Left</code> which is the keyboard shortcut for moving to the virtual desktop on the left.</p>
<p>My main use of kanata is to create a navigation layer that is activated while I hold the <code>Tab</code> key. When I press any other key while holding tab, it will execute a navigation command (usually a call to <code>fancywm.exe</code>). This way, I can directionally focus and move windows without using the FancyWM activation sequence which saves me a lot of keystrokes.</p>
<p>Why use kanata for this purpose over AutoHotKey (or some other software)? 1. Setting up layers on the keyboard and doing different actions based on tapping vs holding a key is much easier in kanata than AutoHotKey. 1. My kanata config for remapping keys is significantly shorter and more powerful than the AutoHotKey script I previously used for the same purpose. 2. kanata supports remapping your keyboard at a much lower level than AutoHotKey and similar software. kanata has an alternate implementation in windows (<code>kanata_wintercept.exe</code>) that uses the <a href="http://www.oblita.com/interception">interception</a> kernel driver to remap keys. This allows you to remap keys from admin programs without running kanata as admin and to use it in places where AutoHotKey or the regular kanata implementation (<code>kanata.exe</code>) wouldn’t work such as the login screen.</p>
<p>To install kanata, download <code>kanata_cmd_allowed.exe</code> and <code>kanata_wintercept_cmd_allowed.exe</code> from the <a href="https://github.com/jtroo/kanata/releases">releases</a> page and download it somewhere on your computer. I stick with the latest stable release.</p>
<p>Here’s my full <a href="https://gist.github.com/ishchow/30f3a6d34c2f3230fad9936af648329d#file-kanata-kbd">kanata config</a>.</p>
<p>In addition to the navigation layer behaviour described above, there are some other interesting things we can do with this kanata configuration. When typing normally (in the default layer) if you tap <code>CapsLock</code> it will send <code>Esc</code>. If you hold <code>CapsLock</code> and/or hit another key, you will enter the modal layer. The modal layer will be active as long as <code>CapsLock</code> is held. In the modal layer, <code>CapsLock+Tab</code> will open Alt-Tab Terminator. <code>CapsLock+h</code> will send left arrow. <code>CapsLock+df</code> will send <code>Ctrl+Shift</code>. Hold <code>CapsLock+df</code> with one hand and then hold <code>h</code> and this essentially sends <code>Ctrl+Shift+Left(hold)</code> which is the standard shortcut for selecting text to the left. These remaps in the modal layer essentially allow me to navigate text using vim-like bindings in any application!</p>
<p>Holding the backtick key will activate the numbers layer and the layer will be active while the backtick key is held. When in the numbers layer, typing certain keys will send numbers instead of the keys (ex. <code>k</code> sends <code>2</code>). This effectively allows you to get numpad-like functionality on keyboards without it (ex. laptop keyboard).</p>
<p>To use this kanata configuration, save the above config file in the same location that you store that kanata executables. Then you can run kanata with this custom config:</p>
<pre><code>.\kanata_cmd_allowed.exe --cfg kanata.kbd</code></pre>
<p>Or if you want to use the interception driver instead of the default keyboard hook mechanism:</p>
<pre><code>.\kanata_wintercept_cmd_allowed.exe --cfg kanata.kbd</code></pre>
<p>To automatically start kanata at startup, you can use the <a href="https://github.com/jtroo/kanata/discussions/193#discussioncomment-4499387">Windows Task Scheduler</a>.</p>
</section>
<section id="autohotkey" class="level2">
<h2 class="anchored" data-anchor-id="autohotkey">AutoHotKey</h2>
<p><a href="https://www.autohotkey.com/">AutoHotKey</a> is a scripting language to automate things in Windows.</p>
<p>When installing AutoHotKey, make sure the circled option is checked since it will allow AutoHotKey scripts to handle programs running as Admin.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.ishaat.ca/posts/2023/001-my-ultimate-windows-10-window-management-setup/win10wmsetup-autohotkey-install.png" class="img-fluid figure-img"></p>
<figcaption>AutoHotkey Installation</figcaption>
</figure>
</div>
<section id="mouse-follows-focus" class="level3">
<h3 class="anchored" data-anchor-id="mouse-follows-focus">Mouse Follows Focus</h3>
<p>This is an AutoHotKey <a href="https://gist.github.com/ishchow/30f3a6d34c2f3230fad9936af648329d#file-mouse-follows-focus-ahk">script</a> that automatically centers the mouse on a newly focused window that was focused due to a keyboard shortcut (ex. <code>Alt-Tab</code>, <code>Win+Number</code>). Focus events that were caused by mouse movements will not change mouse position.</p>
<p>Below is a demonstration of the default Windows behaviour when switching between application windows using keyboard shortcuts (in this case, <code>Win+Number</code>). You can see that the focused window changes but the mouse cursor still stays at the same position.</p>
<div class="quarto-video ratio ratio-16x9"><iframe data-external="1" src="https://www.youtube.com/embed/5PiZZbXib5E" title="" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></div>
<p>Below is a demonstration of ‘Mouse Follows Focus’. Now when I switch windows using keyboard shortcuts, the mouse cursor is automatically moved to the center of the newly focused window. This is especially useful when working with multi-monitor setups, since you can avoid having to physically drag your mouse to move the cursor to another monitor when the focused window changes via keyboard. But I also like this when working on a laptop on the couch since I don’t have to use the trackpad so much.</p>
<div class="quarto-video ratio ratio-16x9"><iframe data-external="1" src="https://www.youtube.com/embed/qqEqMTeONJ4" title="" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></div>
</section>
<section id="handling-admin-windows-with-autohotkey" class="level3">
<h3 class="anchored" data-anchor-id="handling-admin-windows-with-autohotkey">Handling admin windows with AutoHotKey</h3>
<p>AutoHotKey scripts won’t work on Admin windows by default. Need to follow this <a href="https://stackoverflow.com/a/68855449">guide</a> to be able to make an AutoHotKey script handle Admin windows without running it as admin.</p>
</section>
<section id="running-autohotkey-script-on-startup" class="level3">
<h3 class="anchored" data-anchor-id="running-autohotkey-script-on-startup">Running AutoHotKey script on startup</h3>
<p>I also use the Windows Task Scheduler to run <code>mouse_follows_focus.ahk</code> on startup. Alternately, you could make a shortcut to your script and then place it in <code>shell:startup</code>.</p>
</section>
</section>
</section>
<section id="problems" class="level1">
<h1>Problems</h1>
<section id="when-mouse-cursor-follows-focus-sometimes-mouse-cursor-is-focused-on-the-taskbar-instead-of-an-application-window" class="level2">
<h2 class="anchored" data-anchor-id="when-mouse-cursor-follows-focus-sometimes-mouse-cursor-is-focused-on-the-taskbar-instead-of-an-application-window">When mouse cursor follows focus, sometimes mouse cursor is focused on the taskbar instead of an application window</h2>
<p>When window focus events are invoked, it seems that Windows will switch focus to the taskbar and then focus on the actual window. The script adds a short delay to compensate for this but sometimes it’s not enough, so you end up in a situation where the mouse cursor is still on the taskbar and hasn’t moved to the application window (as shown below).</p>
<div class="quarto-video ratio ratio-16x9"><iframe data-external="1" src="https://www.youtube.com/embed/lTi6waxdh1Y" title="" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></div>
<p>Usually hitting Alt+Tab once or twice would help to recenter the mouse.</p>
</section>
</section>
<section id="conclusion" class="level1">
<h1>Conclusion</h1>
<p>Although it took a bit of time to set this all up, I’m really happy with the result. I find I’m now much more productive in Windows.</p>


</section>

 ]]></description>
  <category>Windows</category>
  <category>FancyWM</category>
  <category>Kanata</category>
  <guid>https://www.ishaat.ca/posts/2023/001-my-ultimate-windows-10-window-management-setup/</guid>
  <pubDate>Sun, 12 Feb 2023 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Introducing nvim-deardiary</title>
  <dc:creator>Ishaat Chowdhury</dc:creator>
  <link>https://www.ishaat.ca/posts/2021/001-introducing-nvim-deardiary/</link>
  <description><![CDATA[ 





<p>I’ve been working on a Neovim plugin written in Lua for a while now called <a href="https://github.com/ishchow/nvim-deardiary">nvim-deardiary</a>. I’ve been using it regularly over the past month or so and I think it’s now in a good enough state to release.</p>
<section id="motivation" class="level2">
<h2 class="anchored" data-anchor-id="motivation">Motivation</h2>
<p>I used to use <a href="https://github.com/vimwiki/vimwiki">vimwiki</a> which is a very popular vim plugin that lets you manage a number of personal wikis. I never actually used the wiki functionality but it did have one cool feature that lets you keep a daily journal per wiki using a few simple key bindings. However, I found vimwiki to be lacking in several ways:</p>
<ol type="1">
<li>Journal entries can only be kept per day. I often like having entries per week as well and I didn’t find a built in way to do weekly entries in vimwiki.</li>
<li>Flat file structure. Vimwiki keeps entries in “YYYY-MM-DD” format under a single directory but I found it hard to navigate in the filesystem since there can be many files. Over years, the directory could have thousands of files which I didn’t like the thought of. I prefer a nested structure like “YYYY/MM/DD” to keep entries organized when I need to look at them directly. Typically, I use fuzzy finders to search through my wiki so having an index file of all the entries in one directory was unnecessary for me.</li>
<li>No built-in way to template journal entries. I often like all entries in a journal to have a standard format and there wasn’t a built-in way to do templating with vimwiki. It’s possible to do it but it requires using python/bash scripts and some autocommands. It worked but it always felt like a hack.</li>
<li>Vimwiki was too big of a plugin for my taste. The plugin has so many features and I spent a lot of time configuring it to work with markdown. I didn’t like how vimwiki provides it’s own filetype even when using the markdown mode since it caused conflicts with other plugins.</li>
</ol>
<p>Ultimately, I didn’t really need a wiki just a journaling plugin so I decided to create my own.</p>
</section>
<section id="project-overview" class="level2">
<h2 class="anchored" data-anchor-id="project-overview">Project Overview</h2>
<p>nvim-deardiary has the following features:</p>
<ul>
<li>Manage multiple journals</li>
<li>Set different frequencies of entries per journal (ex. daily, weekly)</li>
<li>Custom frequencies of journal entries (ex. can add quarterly frequencies)</li>
<li>Control filesystem paths of new entries</li>
<li>Templating of new entires</li>
</ul>
<p>Note: Neovim 0.5+ is a requirement since the plugin is written in Lua and uses apis that may not be present in 0.4.4 or earlier.</p>
<p>Visit the <a href="https://github.com/ishchow/nvim-deardiary">repo</a> to learn how to install, configure, and use the plugin. Please open an issue for bugs and feature requests.</p>
<p>An example of an advanced configuration can be found in my <a href="https://github.com/ishchow/dotfiles/blob/master/.config/nvim/lua/diary.lua">dotfiles</a>.</p>
</section>
<section id="design-decisions" class="level2">
<h2 class="anchored" data-anchor-id="design-decisions">Design Decisions</h2>
<p>Since plugins for Neovim nightly can be created in either Lua or Vimscript, I had to seriously evaluate between these two options for creating my plugin. I went with Lua since it had several advantages over Vimscript for my use case:</p>
<ol type="1">
<li>A simple, one file <a href="https://tieske.github.io/date/">datetime library</a> that I could vendor with my plugin. This library had all the datetime manipulation methods I needed. I couldn’t find an alternative in Vimscript, at least not one with documentation as thorough as this Lua library.</li>
<li>Unit testing using <a href="https://olivinelabs.com/busted/">busted</a>. busted is a pretty fully featured unit testing library in Lua. It comes with all the basics you can expect in a unit testing library and it’s very ergonomic. I didn’t know if Vimscript has an equivalent to busted or if I did find them, I couldn’t figure out how to use them.</li>
<li>Access to <a href="https://luarocks.org/">luarocks</a>. My plugin doesn’t need luarocks to function since the datetime library is actually contained with the plugin source. However, access to luarocks was invaluable for testing since I could access filesystem and path manipulation libraries. Using <a href="https://stevedonovan.github.io/Penlight/api/index.html">penlight</a>, I could create mocks of any neovim apis that I used which allowed me to unit test my plugin easily. It’s super useful for running tests in CI without actually building Neovim and using its plugin infrastructure to test your plugin. Although that method of plugin testing was overkill for me, it is a perfectly viable option for some use cases as described in this <a href="https://github.com/KillTheMule/KillTheMule.github.io/blob/master/test_plugins_from_neovim.md">blog post</a>.</li>
<li>Clean and easy syntax. This point is purely subjective but I found Lua to be more approachable as a programming language than Vimscript. Vimscript is nice for configuring Neovim/Vim but I liked the idea of writing something in Lua much more than Vimscript.</li>
</ol>
<p>I’m very happy with my choice of writing the plugin in Lua. Inspired by popular Lua plugins, I chose to expose configuration of journal <a href="https://github.com/ishchow/nvim-deardiary/blob/main/lua/deardiary/config.lua">frequencies</a> using callbacks since this provides a lot of flexbility for configuration. Ever since <a href="https://github.com/wbthomason/packer.nvim">packer.nvim</a> got luarocks support I’ve been using <a href="https://stevedonovan.github.io/Penlight/api/libraries/pl.template.html">penlight templating</a> to template journal entries in my dotfiles. No need for the python scripts I used before with vimiwki. Overall, writing the plugin in Lua was rewarding experience. I could never imagine myself writing a plugin for Neovim before. I’m very excited for the future of Neovim and it’s plugin ecosystem.</p>


</section>

 ]]></description>
  <category>neovim</category>
  <category>lua</category>
  <category>nvim-deardiary</category>
  <guid>https://www.ishaat.ca/posts/2021/001-introducing-nvim-deardiary/</guid>
  <pubDate>Sun, 07 Feb 2021 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Eleventy + TailwindCSS = New Site</title>
  <dc:creator>Ishaat Chowdhury</dc:creator>
  <link>https://www.ishaat.ca/posts/2020/001-eleventy-tailwindcss-new-site/</link>
  <description><![CDATA[ 





<p>Now that I’m recently graduated with all my summer activities (vacations, grad ceremonies, etc.) cancelled due to COVID, I thought this would be the ideal time to redo my website. I created my new website using <a href="https://www.11ty.dev/">Eleventy</a> as the static site generator and <a href="https://tailwindcss.com/">TailwindCSS</a> to style the website.</p>
<p>I’ve used a few static site generators in the past. My original website was a static site made using <a href="https://jekyllrb.com/">Jekyll</a> and a premade template from <a href="https://html5up.net/strata">HTML5 UP</a>. I originally created my website to host my portfolio of school and personal projects. I also redesigned the website of an <a href="https://compeclub.com">extracurricular club</a> at my university using <a href="https://gohugo.io/">Hugo</a> and a premade theme that I had to customize heavily.</p>
<p>While Hugo and Jekyll are hugely popular and come with lots of premade themes you can build from, I found both of them frustrating for different reasons. Regarding Jekyll, I liked it’s templating engine (Liquid) and it was really easy to get started due to it’s popularity but build times were slow and Ruby was a pain to manage on Windows at the time. On the other hand, Hugo had blazing fast build speeds and was completely batteries included (the single binary made it a breeze to setup) but I found it’s templating language to be extremely complex. Additionally, I felt it was hard to extend Hugo when you need extra functionality. Also, the directory structure of Hugo can be quite strict and the template lookup order can be complex. Lastly, I personally found that using premade themes can be frustrating when you want to extend their functionality (ex. adding search).</p>
<p>I recently discovered Eleventy and I am hooked! Eleventy combines the best of both Hugo and Jekyll in addition to adding useful, unique features. Eleventy has speedy builds, support for multiple templating languages (I use Nunjucks), ability to extend Eleventy using plugins and custom filters, and flexible directory structure. Eleventy is built using NodeJS which allows developers to tap into the npm ecosystem to provide asset compilation pipelines, plugins, and so much more. This is a huge advantage since you can extend Eleventy to do almost anything: <a href="https://www.11ty.dev/docs/filters/#filters">custom filters</a>, <a href="https://www.11ty.dev/docs/config/#transforms-example-minify-html-output">minify html using transforms</a>, and <a href="https://www.11ty.dev/docs/data-frontmatter-customize/#example-using-toml-for-front-matter-parsing">TOML front matter support</a>. But the defaults features are pretty awesome too! My favourite features include: <a href="https://www.11ty.dev/docs/config/">flexible directory structure</a>, <a href="https://www.11ty.dev/docs/pages-from-data/">powerful pagination</a>, <a href="https://www.11ty.dev/docs/data-template-dir/#example-apply-a-default-layout-to-multiple-templates">applying common front matter variables to all pages in directory using a json file</a>, and <a href="https://www.11ty.dev/docs/data-js/">exposing environment variables using javascript files</a>. The biggest drawbacks to using Eleventy is the lack of documentation compared to something like Hugo or Jekyll as well as having to roll functionality provided by other static site generators yourself (ex. asset compilation) which can be a barrier for some people.</p>
<p>For the design of the website, I decided to use TailwindCSS as the CSS framework. TailwindCSS is a utility first CSS framework built on top of PostCSS. Essentially, TailwindCSS comes with a ton of utility classes for things like margin, padding, font, and flex box configurations which you can add to your HTML elements to create custom designs while writing very little CSS. It’s kind of a weird concept but I really enjoyed using it once I got the hang of it. The abundance of utility classes make it really easy to quickly iterate on a design without even leaving your HTML files! How cool is that! Tailwind comes with just the right amount of options for these utility classes to make your choices for things like padding granular without being overwhelming. Even though I’m not much of a CSS or design wizard, I was able to come up with a design I am satisfied with quickly and easily. Especially given that I was aiming for a more minimalistic, text driven design for this site, using a framework like Bootstrap with lots of built-in components that I would have to override anyways didn’t make a ton of sense. In fact, this site was created using the default fonts and color palette provided by the framework itself! The only CSS classses I ended up writing were for styling typography (headings, text, and code blocks). TailwindCSS has some drawbacks such as larger CSS files by default (although this can be easily mitigated by using <a href="https://tailwindcss.com/docs/controlling-file-size/#basic-usage">PurgeCSS</a>).</p>
<p>Overall, I’m really happy with this new site. I can easily recommend using Eleventy as a static site generator for people who are frustrated with other static site generators and want more control as well as flexibility. I can also recommend TailwindCSS for those needing a more lightweight framework compared to Bootstrap or even as a slightly easier alternative to writing raw CSS. Eleventy and TailwindCSS also work quite well together.</p>



 ]]></description>
  <category>ssg</category>
  <category>eleventy</category>
  <category>tailwindcss</category>
  <guid>https://www.ishaat.ca/posts/2020/001-eleventy-tailwindcss-new-site/</guid>
  <pubDate>Wed, 20 May 2020 00:00:00 GMT</pubDate>
</item>
</channel>
</rss>
