forked from mixu/nwm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnwm
More file actions
executable file
·107 lines (87 loc) · 1.94 KB
/
Copy pathnwm
File metadata and controls
executable file
·107 lines (87 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#! /usr/bin/env bash
dir=`readlink -e $BASH_SOURCE`
dir=`dirname $dir`
nwm_dir="$HOME/.nwm/"
# you probably have a something in your .bashrc to setup node.
# i do, and this makes it work when you run sudo.
# this may not be the best way to tackle this, but it works now, for me.
# post an issue and mention @dominictarr if this breaks something.
start () {
log=''
if [ "x$1" = x ]; then
log='2> "$nwm_dir/nwm.err.log" 1> "$nwm_dir/nwm.log"'
fi
node "$dir/nwm-user-sample.js" $log
exit
}
mkdir -p ~/.nwm
init () {
NODE=`which node`
plat=`uname`
case $plat in
Linux)
cat << NWM1 > $HOME/.nwm/nwm-start
#! /usr/bin/env bash
$NODE "$dir/nwm-user-sample.js" 2> "$nwm_dir/err.log" 1> "$nwm_dir/out.log"
NWM1
chmod +x "$nwm_dir/nwm-start"
cat << NWM2 > "$nwm_dir/nwm.desktop"
[Desktop Entry]
Encoding=UTF-8
Name=nwm
Comment=This session starts nwm
Exec=$nwm_dir/nwm-start
Type=Application
NWM2
;;
*)
echo nwm does not yet have install script for
echo your platform: $plat. see readme for manual instructions
exit 1
esac
exit
}
#run this command as sudo.
install () {
plat=`uname`
case $plat in
Linux)
#nwm.desktop is generated by `nwm init`
cp $nwm_dir/nwm.desktop /usr/share/xsessions/
;;
*)
echo nwm does not yet have install script for
echo your platform: $plat. see readme for manual instructions
exit 1
esac
exit
}
uninstall () {
plat=`uname`
case $plat in
Linux)
rm /usr/share/xsessions/nwm.desktop
;;
esac
exit
}
xephyr () {
#the default size is small, so you can see loggers, etc.
if [ "x$1" = x ]; then
size=800x600
else
size="$1"
fi
Xephyr -screen "$size" -nodri -br :1 &
DISPLAY=:1 start --nolog
}
console () {
# connect a console to a running nwm server
node $dir/lib/console.js client 25171
}
help () {
less $dir/readme.md
}
$@
echo 'USAGE: nwm start|install|console|uninstall|help'
exit 1