From a4ec8f17d13d3c760cc3477de9b1ac06844ec7d3 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 16 Aug 2016 21:20:15 -0700 Subject: [PATCH] Shell commands for cscreen --- dotfiles/lib/shellrc/osx.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dotfiles/lib/shellrc/osx.sh b/dotfiles/lib/shellrc/osx.sh index 1a42f967..588085da 100644 --- a/dotfiles/lib/shellrc/osx.sh +++ b/dotfiles/lib/shellrc/osx.sh @@ -183,3 +183,15 @@ function resistance_game_start { sleep 4 say "everyone open their eyes" } + +function get_screen_by_index { + cscreen | head -n -1 | tail -n +2 | filter_by_column_value 2 "$1" | get_cols 1 +} + +function make_main_screen { + cscreen -i "$(get_screen_by_index "$1")" -p +} + +function swap_main_screen { + make_main_screen 2 +}