Skip to content

Instantly share code, notes, and snippets.

@Nervengift
Nervengift / i3_focus_next
Last active January 20, 2023 19:05
focus next window in i3 (like Alt+Tab in other WMs)
#!/bin/bash
# ================================================================================== #
# Focus the next window on the current workspace in i3, e.g. for binding to Alt+Tab #
# Depends: jq, awk, i3wm (obviously) #
# Author: Nervengift <dev@nerven.gift> #
# License: Don't think this deserves a license, Public Domain #
# Known bugs: doesn't work with non-window container focused #
# ================================================================================== #
ws=$(i3-msg -t get_workspaces|jq "map(select(.focused))[]|.name")
# This gist is compatible with Ansible 1.x .
# For Ansible 2.x , please check out:
# - https://gist.github.com/dmsimard/cd706de198c85a8255f6
# - https://github.com/n0ts/ansible-human_log
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#