You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
704 B
21 lines
704 B
/** A utility script to move a window to a workspace
|
|
*
|
|
* This tool relies on i3-msg, jq, and dmenu to move a window to a
|
|
* different workspace. In the future, maybe the display mechanism
|
|
* (dmenu) could be made configurable, so not to rely on nazi code.
|
|
*/
|
|
|
|
{ bottom, pkgs, ... }: with pkgs;
|
|
let dmenu-cmd = if bottom then
|
|
"${dmenu}/bin/dmenu -b -i \"$@\""
|
|
else
|
|
"${dmenu}/bin/dmenu -i \"$@\"";
|
|
in
|
|
writeShellScript "libkookie-i3-move" ''
|
|
WS=$(${i3}/bin/i3-msg -t get_workspaces | \
|
|
${jq}/bin/jq -r -M '.[] | .name' | sort -u | \
|
|
${dmenu-cmd})
|
|
|
|
${i3}/bin/i3-msg -t command move workspace $WS
|
|
${i3}/bin/i3-msg workspace $WS
|
|
''
|
|
|