Browse Source

added test for sublsess before creating a new instance. if sublsess command is in path, execute it

dev
bud 5 months ago
parent
commit
f9e38c68ac
4 changed files with 15 additions and 19 deletions
  1. +10
    -14
      scripts/sublaunch
  2. +2
    -2
      src/sublaunch/init.sh
  3. +2
    -2
      src/sublaunch/manifest.md
  4. +1
    -1
      src/sublaunch/sublaunch.1

+ 10
- 14
scripts/sublaunch View File

@@ -3,8 +3,8 @@
___printversion(){
cat << 'EOB' >&2
sublaunch - version: 2019.12.08.0
updated: 2019-12-08 by budRich
sublaunch - version: 2020.05.31.0
updated: 2020-05-31 by budRich
EOB
}

@@ -36,15 +36,14 @@ main(){

# --project|-j PROJECT

# export SUBLIME_TITS_CRIT="${SUBLIME_TITS_CRIT}"
# export SUBLIME_TITS_SRCH="${SUBLIME_TITS_SRCH}"

__tits+=($(sublget -r npf))
# for k in "${!__tits[@]}"; do echo "$k - ${__tits[$k]}" ;done && exit
_currentproject="${__tits[1]:-}"
: "${__o[project]:=$_currentproject}"

# launch new instance
if [[ -z "${_currentproject}" ]]; then
command -v sublsess > /dev/null && sublsess
cmd=(subl)
[[ -n $(pidof sublime_text) ]] && cmd+=('--new-window')
@@ -85,14 +84,11 @@ main(){

{
xdotool windowfocus "${__tits[0]}"
if [[ ${__o[wait]} = 1 ]]; then
[[ -f ${__lastarg:-} ]] && {
subl --command 'close_all'
subl --command "$__lastarg"
}
subl --wait
else
[[ -f ${__lastarg:-} ]] && subl "$__lastarg"
if [[ ${__o[wait]} = 1 ]] && [[ -f ${__lastarg:-} ]]; then
subl --command 'close_all'
subl --wait "$__lastarg"
elif [[ -f ${__lastarg:-} ]]; then
subl "$__lastarg"
fi
}


+ 2
- 2
src/sublaunch/init.sh View File

@@ -3,8 +3,8 @@
___printversion(){
cat << 'EOB' >&2
sublaunch - version: 2019.12.08.0
updated: 2019-12-08 by budRich
sublaunch - version: 2020.05.31.0
updated: 2020-05-31 by budRich
EOB
}



+ 2
- 2
src/sublaunch/manifest.md View File

@@ -1,8 +1,8 @@
---
description: >
Run or raise sublime with a specific profile and file
updated: 2019-12-08
version: 2019.12.08.0
updated: 2020-05-31
version: 2020.05.31.0
author: budRich
repo: https://github.com/budlabs
created: 2018-08-06


+ 1
- 1
src/sublaunch/sublaunch.1 View File

@@ -1,5 +1,5 @@
.nh
.TH SUBLAUNCH 1 2019\-12\-08 Linx "User Manuals"
.TH SUBLAUNCH 1 2020\-05\-31 Linx "User Manuals"
.SH NAME
.PP
\fB\fCsublaunch\fR \- Run or raise sublime with a


Loading…
Cancel
Save