/usr/bin/wallstreet is in wallstreet 1.14-0ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 | #!/bin/bash
# N.B.: Use bash for $RANDOM
#
# wallstreet: create wallstreet suitable consoles of news nerdery
#
# Copyright 2014 Dustin Kirkland <dustin.kirkland@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
PKG="wallstreet"
[ -n "$TMDIR" ] || export TMPDIR=$(mktemp -d /dev/shm/$PKG.XXXXXXXXX)
trap "rm -rf $TMPDIR; pkill -f -9 lib/$PKG/ >/dev/null 2>&1; exit 0" EXIT HUP INT QUIT TERM
dir="-v"
widget_dir="$(dirname $0)/../lib/$PKG"
widget1=$(ls "$widget_dir/" | sort -R | head -n1)
if [ -n "$1" ]; then
SPLITS="$1"
else
SPLITS=$(ls "$widget_dir" | wc -l)
fi
arrangements="main-horizontal main-vertical tiled"
if [ -z "$TMUX" ]; then
# Not in a tmux session: start one, with
# byobu if it's found, else with plain tmux
command -v byobu >/dev/null 2>&1
if [ $? -eq 0 ]; then
tmux_launcher=byobu
else
tmux_launcher=tmux
fi
$tmux_launcher new-session -d -s $PKG "/bin/bash"
$tmux_launcher send-keys -t $PKG "$0 $1"
$tmux_launcher send-keys -t $PKG Enter
exec $tmux_launcher attach-session -t $PKG
exit 1
fi
version=$(tmux -V | sed -e "s/.*\s//")
if dpkg --compare-versions $version le 2.1; then
tmux new-window -n $PKG "$widget_dir/w3m" \; \
set-option -g pane-active-border-bg "default" \; \
set-option -g pane-active-border-fg "default" \; \
split-window -v -t $PKG.0 $widget_dir/ticker + \; \
split-window -v -t $PKG.1 $widget_dir/ticker - \; \
split-window -v -t $PKG.2 $widget_dir/ticker topNews \; \
split-window -h -t $PKG.0 $widget_dir/img2txt \; \
split-window -h -t $PKG.4 $widget_dir/newsbeuter \; \
split-window -v -t $PKG.4 $widget_dir/rsstail \; \
send-keys -t $PKG.5 "Enter" \; \
resize-pane -t $PKG.0 -x 80 -y 80 \; \
resize-pane -t $PKG.1 -y 3 \; \
resize-pane -t $PKG.2 -y 3 \; \
resize-pane -t $PKG.3 -y 3 \; \
resize-pane -t $PKG.4 -y 45 \; \
resize-pane -t $PKG.5 -x 70 \; \
>/dev/null 2>&1
else
# Ubuntu 16.10 and newer
tmux new-window -n $PKG "$widget_dir/w3m" \; \
split-window -v -t $PKG.0 $widget_dir/ticker + \; \
split-window -v -t $PKG.1 $widget_dir/ticker - \; \
split-window -v -t $PKG.2 $widget_dir/ticker topNews \; \
split-window -h -t $PKG.0 $widget_dir/img2txt \; \
split-window -h -t $PKG.1 $widget_dir/newsbeuter \; \
split-window -v -t $PKG.1 $widget_dir/rsstail \; \
send-keys -t $PKG.3 "Enter" \; \
resize-pane -t $PKG.6 -y 3 \; \
resize-pane -t $PKG.5 -y 3 \; \
resize-pane -t $PKG.4 -y 3 \; \
resize-pane -t $PKG.0 -x 80 -y 80 \; \
resize-pane -t $PKG.3 -x 70 \; \
resize-pane -t $PKG.2 -y 30 \; \
set-option -g pane-active-border-bg "default" \; \
set-option -g pane-active-border-fg "default" \; \
>/dev/null 2>&1
fi
while true; do
if [ $(tmux list-panes -t $PKG 2>/dev/null | wc -l) -gt 0 ]; then
sleep 1
continue
fi
rm -rf "$TMPDIR"
exit 0
done
rm -rf "$TMPDIR"
|