Skip to content

Commit ac6dde8

Browse files
committed
added pomo starter for project
1 parent 9343ef4 commit ac6dde8

File tree

7 files changed

+178
-21
lines changed

7 files changed

+178
-21
lines changed

last

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/a/_proj/supermanager
1+
/a/_proj/prdins

pro.sh

+42
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ function usage {
2020
i initialize a script. Helps you to start windows and other stuffs that otherwise isn't available in ProLo.
2121
ta (if you have 'task' installed). Shows list of task related to it. The project name must be set to directory name.
2222
ta [tag] (if you have 'task' installed). Shows list of task related to current project and tags(dont add '+' infront of tags). The project name must be set to directory name.
23+
new creates starter documents and directories based on _proj template.
24+
pomo [taskno] starts the pomodoro timer for the given task id. The server must be started manually.
2325
EOF
2426
return;
2527
}
@@ -75,6 +77,26 @@ function outputtofilearray() {
7577
done
7678
}
7779

80+
function createProject() {
81+
if [ -z $1 ]; then
82+
echo "Whats the name of project?"
83+
return
84+
fi
85+
86+
if [ ! -d $LOC/templates/_proj ]; then
87+
echo "No _proj template found in ./templates. Create one."
88+
return
89+
fi
90+
91+
if [ -z $PROJECTROOT ]; then
92+
echo "Please assign PROJECTROOT variable to root of your directory."
93+
return
94+
fi
95+
96+
cp -r $LOC/templates/_proj $PROJECTROOT/$1
97+
echo created $1 in $PROJECTROOT
98+
}
99+
78100

79101
function updatelastproject() {
80102
# appends last selected project to ./projects
@@ -329,6 +351,12 @@ showscriptlists() {
329351
done
330352
}
331353

354+
startpomo() {
355+
local name=`getlastprojectname`
356+
task project:$name list $1
357+
sudo pomo start $1
358+
}
359+
332360

333361
# for i in `seq ${#DIRS[@]}`;
334362

@@ -376,6 +404,20 @@ while [ "$1" != "" ]; do
376404
create)
377405
showcreateprojectmenu $LOC/templates
378406
;;
407+
new)
408+
echo ${@:2}
409+
createProject ${@:2}
410+
return
411+
;;
412+
pomo)
413+
echo starting pomo
414+
if [ ${@:2} != "" ]; then
415+
startpomo ${@:2}
416+
shift
417+
else
418+
echo need task id as second args
419+
fi
420+
;;
379421
i)
380422
# initialize using a script for the current project
381423
# find if init file has been created, else create in ./init/projectname.sh

projects

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ scheduler=/a/_proj/scheduler
77
goalsdir=/a/_proj/goalsdir
88
prdins=/a/_proj/prdins
99
supermanager=/a/_proj/supermanager
10+
tgame=/a/_proj/tgame

scripts/prdins/api-common.sh

+19-14
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,34 @@ A=/a
22
ROOT=$PROJECTROOT/prdins/
33
ACTUAL=$ROOT/srcs/api-common/
44
EXTRA=$A/js/nodejs/_repo/
5-
source ~/.config/i3/vars.sh
5+
# source ~/.config/i3/vars.sh
66
SESSION_LOC="~/.vim/session/prdins-api-common.vim"
77

88
# TEST
99
echo $ROOT
1010
echo $A
1111

1212
function openEditor() {
13+
# code
1314
urxvtc \
14-
-cd /a/_proj/prdins/srcs/api-common/src \
15+
-title 'EDITOR' \
16+
-cd /a/_proj/prdins/srcs/api-common/lib/src \
1517
-e zsh
1618
# the following line will open vim but <F*> commands will all be dead. Dont know why.
1719
# -c 'vim --servername IDE --cmd "nmap ZE :mksession! ~/.vim/session/prdins-api-common.vim<CR>" index.js'
1820
}
1921

2022
function openServer() {
2123
urxvtc \
22-
-cd /a/_proj/prdins/srcs/api-common/ \
24+
-cd $ROOT/srcs/api-common \
2325
-e zsh \
24-
-c 'npm run serve'
26+
-c 'npm run dev'
2527
}
2628

2729
function openCurlTestWindow() {
2830
urxvtc \
2931
-title "CURL TEST" \
30-
-cd $ROOT/srcs/curl \
32+
-cd $ROOT/srcs/api-common/lib/src/curl \
3133
-e zsh
3234
}
3335

@@ -64,20 +66,23 @@ function openExtra() {
6466
-e zsh
6567
}
6668

67-
i3-msg workspace $ws1
68-
openExtra
69-
sleep 1
69+
# openExtra
70+
# i3-msg 'move container to workspace 1'
7071

71-
i3-msg workspace $ws2
7272
openEditor
73-
sleep 1
73+
i3-msg 'move container to workspace 2'
74+
75+
openMongoDB
76+
i3-msg 'move container to workspace 5'
7477

75-
i3-msg workspace $ws3
7678
openServer
79+
i3-msg 'move container to workspace 3'
80+
7781
openCurlTestWindow
82+
i3-msg 'move container to workspace 4'
83+
7884
openCLIWindow
79-
sleep 1
85+
i3-msg 'move container to workspace 3'
8086

81-
i3-msg workspace $ws4
82-
openMongoDB
8387
openMongoClient
88+
i3-msg 'move container to workspace 4'

scripts/prdins/fe-admin.sh

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
A=/a
2+
ROOT=$PROJECTROOT/prdins/
3+
ACTUAL=$ROOT/srcs/fe-admin/
4+
# source ~/.config/i3/vars.sh
5+
SESSION_LOC="~/.vim/session/prdins-fe-admin.vim"
6+
7+
# TEST
8+
echo $ROOT
9+
echo $A
10+
11+
function openEditor() {
12+
code
13+
# urxvtc \
14+
# -cd $ACTUAL/src \
15+
# -e zsh
16+
# the following line will open vim but <F*> commands will all be dead. Dont know why.
17+
# -c 'vim --servername IDE --cmd "nmap ZE :mksession! ~/.vim/session/prdins-fe-common.vim<CR>" index.js'
18+
}
19+
20+
function openBrowser() {
21+
chromium
22+
}
23+
24+
function openServer() {
25+
urxvtc \
26+
-cd $ACTUAL \
27+
-e zsh \
28+
-c 'npm run serve'
29+
}
30+
31+
function openAPIServer() {
32+
urxvtc \
33+
-cd $ROOT/srcs/api-common/ \
34+
-e zsh \
35+
-c 'npm run dev'
36+
}
37+
38+
function openCLIWindow() {
39+
urxvtc \
40+
-title "CLI TESTS" \
41+
-cd $ACTUAL \
42+
-e zsh
43+
}
44+
45+
function openMongoDB() {
46+
urxvtc \
47+
-title "MONGO DAEMON" \
48+
-e zsh \
49+
-c 'sudo mongod'
50+
}
51+
52+
function openMongoClient() {
53+
urxvtc \
54+
-cd $ROOT/srcs/db \
55+
-name "MONGO CLIENT"
56+
}
57+
58+
openCLIWindow
59+
i3-msg 'move container to workspace 3'
60+
61+
openServer
62+
i3-msg 'move container to workspace 3'
63+
64+
openAPIServer
65+
i3-msg 'move container to workspace 3'
66+
67+
openMongoDB
68+
i3-msg 'move container to workspace 5'
69+
70+
openMongoClient
71+
i3-msg 'move container to workspace 4'
72+
73+
openEditor
74+
i3-msg 'move container to workspace 2'
75+
76+
openBrowser
77+
i3-msg 'move container to workspace 2'
78+
79+
i3-msg 'workspace 2'

scripts/prdins/fe-common.sh

+36-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
A=/a
22
ROOT=$PROJECTROOT/prdins/
33
ACTUAL=$ROOT/srcs/fe-common/
4-
source ~/.config/i3/vars.sh
4+
# source ~/.config/i3/vars.sh
55
SESSION_LOC="~/.vim/session/prdins-fe-common.vim"
66

77
# TEST
@@ -10,6 +10,7 @@ echo $A
1010

1111
function openEditor() {
1212
code
13+
chromium
1314
# urxvtc \
1415
# -cd $ACTUAL/src \
1516
# -e zsh
@@ -24,18 +25,47 @@ function openServer() {
2425
-c 'npm run serve'
2526
}
2627

28+
function openAPIServer() {
29+
urxvtc \
30+
-cd $ROOT/srcs/api-common/ \
31+
-e zsh \
32+
-c 'npm run serve'
33+
}
34+
2735
function openCLIWindow() {
2836
urxvtc \
2937
-title "CLI TESTS" \
3038
-cd $ACTUAL \
3139
-e zsh
3240
}
3341

34-
i3-msg workspace $ws3
35-
openServer
42+
function openMongoDB() {
43+
urxvtc \
44+
-title "MONGO DAEMON" \
45+
-e zsh \
46+
-c 'sudo mongod'
47+
}
48+
49+
function openMongoClient() {
50+
urxvtc \
51+
-cd $ROOT/srcs/db \
52+
-name "MONGO CLIENT"
53+
}
54+
3655
openCLIWindow
37-
sleep 1
56+
i3-msg 'move container to workspace 3'
57+
58+
openServer
59+
i3-msg 'move container to workspace 3'
60+
61+
openAPIServer
62+
i3-msg 'move container to workspace 3'
63+
64+
openMongoDB
65+
i3-msg 'move container to workspace 5'
3866

39-
i3-msg workspace $ws2
40-
openEditor
67+
openMongoClient
68+
i3-msg 'move container to workspace 4'
4169

70+
openEditor
71+
i3-msg 'move container to workspace 2'

templates/_proj/docs/dev/init

Whitespace-only changes.

0 commit comments

Comments
 (0)