Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 700 Bytes

README.md

File metadata and controls

24 lines (18 loc) · 700 Bytes

swaycmd - Get the CWD of the focued view

This script allows you to get the current working directory of the focused window/view. If the window/view is running inside xwayland the script simply falls back to xcwd, so that also needs to be installed.

This is useful if you want your terminal or other programs to open in the CWD of the curently focused window.

Dependencies

  • jq
  • xcwd

The script should work on both FreeBSD and Linux.

Usage

Add swaycwd to your $PATH and run the command like this:

$ swaycwd
/usr/home/qiu

Example sway config:

# Start a terminal in CWD
bindsym $mod+Shift+Return exec 'cd "$(swaycwd)" && st'