diff options
author | Urbain Vaes <urbain@vaes.uk> | 2016-04-19 15:24:25 +0100 |
---|---|---|
committer | Urbain Vaes <urbain@vaes.uk> | 2016-04-19 15:24:25 +0100 |
commit | e146e947c52ac4adbe426b3f893faff1e46ed5f8 (patch) | |
tree | 1605bf4eb78cc619988c92632f3cee2a56143fd5 /bin/workspace | |
parent | 83bd503208d45fa837348441196dd07223b13e3e (diff) |
Use GNU stow for dotfiles management
Diffstat (limited to 'bin/workspace')
-rwxr-xr-x | bin/workspace | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/bin/workspace b/bin/workspace deleted file mode 100755 index a22511e..0000000 --- a/bin/workspace +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/zsh - -# Command to use -[[ $1 = 'n' ]] && cmd="workspace" -[[ $1 = 'm' ]] && cmd="move container to workspace" - -# List of workspaces -workspaces=$(i3-msg -t get_workspaces | grep -Po '"name":.*?[^\\]"' | sed 's/"name":"\([^"]\+\)"/\1/g') - -# Keep only the ones containing : -workspaces=$(echo $workspaces | sed '/:/!d') - -# Get desired workspace -target=$(echo $workspaces | dmenu -i -sf green -p "Go to workspace:") - -# Exit if empty -[[ -z $target ]] && exit - -# If new workspace has to be created -if [[ ! $target = [0-9]* ]]; then - - # Calculate number for new workspace - used_numbers=$(echo $workspaces | awk 'BEGIN { FS = ":" } ; { print $1 }') - max_number=$(echo $used_numbers | tail -1) - lowest_gap=$(echo $used_numbers | awk '$1!=p+1{print p+1}{p=$1}' | head -1) - [[ -z $lowest_gap ]] && new_number=$(($max_number + 1)) || new_number=$lowest_gap - - # Add number to workspace name - target=$new_number:$target -fi - -# Execute command -exec i3-msg $cmd $target |