linuxShortcuts/start-dev.sh

39 lines
1.1 KiB
Bash
Raw Permalink Normal View History

2023-06-23 13:10:17 +00:00
#!/bin/bash -
PARAM="$1"
LAYOUT=$(</home/bruno/.layout)
2022-10-07 11:40:50 +00:00
kactivities-cli --set-current-activity `kactivities-cli --list-activities | grep "Development" | cut -d' ' -f2`
2023-06-23 13:10:17 +00:00
if [[ -z $(tmux ls | grep "DEV") ]]
then
/bin/terminator --title "DEV" -x "cd ~/development; tmux new -t \"DEV\"" &
sleep 1
opening=1
startedTerm=1
fi
2022-10-07 11:40:50 +00:00
TERMINATOR="0,1988,61,1760,880"
QUTE="0,90,78,1715,900"
2023-06-23 13:10:17 +00:00
if [ $LAYOUT == "desktop" ]
then
wmctrl -r "DEV" -F -b remove,maximized_vert,maximized_horz
wmctrl -r "qutebrowser" -b remove,maximized_vert,maximized_horz
sleep 1
wmctrl -r "DEV" -F -e $TERMINATOR
wmctrl -r "qutebrowser" -e $QUTE
else
wmctrl -r "DEV" -F -e $TERMINATOR
wmctrl -r "qutebrowser" -e $QUTE
sleep 1
wmctrl -r "DEV" -F -b add,maximized_vert,maximized_horz
wmctrl -r "qutebrowser" -b add,maximized_vert,maximized_horz
fi
if [[ "$PARAM" ]]
then
tmux send -t DEV $'cd "'${PARAM}$'"; clear; git status; pwd\n'
else
[[ -z $startedTerm ]] && exit 0
tmux send -t DEV $'find $HOME/development/ -maxdepth 2 -type d | gum filter --limit 1 | read myfolder; cd $myfolder; clear; starta . || git status; pwd\n'
fi