diff --git a/.config/i3/move_to_workspace.py b/.config/i3/move_to_workspace.py new file mode 100755 index 0000000..e455ec6 --- /dev/null +++ b/.config/i3/move_to_workspace.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 + +import sys + +import i3ipc + +i3 = i3ipc.Connection() + +if len(sys.argv) == 1: + print("\n".join([ws.name for ws in i3.get_workspaces()])) +else: + i3.command("move to workspace {sys.argv[1]}") diff --git a/.config/i3/move_to_workspace.sh b/.config/i3/move_to_workspace.sh deleted file mode 100755 index 3119282..0000000 --- a/.config/i3/move_to_workspace.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -if [ -z "$1" ] -then - i3-msg -t get_workspaces | tr ',' '\n' | grep "name" | sed 's/"name":"\(.*\)"/\1/g' | sort -n -else - i3-msg move to workspace "$1" 1>2 -fi - diff --git a/.config/i3/switch_workspace.py b/.config/i3/switch_workspace.py new file mode 100755 index 0000000..ad06a17 --- /dev/null +++ b/.config/i3/switch_workspace.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 + +import sys + +import i3ipc + +i3 = i3ipc.Connection() + +if len(sys.argv) == 1: + print("\n".join([ws.name for ws in i3.get_workspaces()])) +else: + i3.command("workspace {sys.argv[1]}") diff --git a/.config/i3/switch_workspace.sh b/.config/i3/switch_workspace.sh deleted file mode 100755 index c147b9f..0000000 --- a/.config/i3/switch_workspace.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -if [ -z "$1" ] -then - i3-msg -t get_workspaces | tr ',' '\n' | grep "name" | sed 's/"name":"\(.*\)"/\1/g' | sort -n -else - i3-msg workspace "$1" 1>2 -fi -