added tsvsummaryin path. skel/disp automates lxpanel positioning
This commit is contained in:
1
bin/tsvsummary
Symbolic link
1
bin/tsvsummary
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../tsv/tsvsummary
|
||||||
65
skel/disp
65
skel/disp
@@ -4,17 +4,60 @@
|
|||||||
LAPTOP=LVDS1
|
LAPTOP=LVDS1
|
||||||
ANALOG=VGA1
|
ANALOG=VGA1
|
||||||
DIGITAL=HDMI1
|
DIGITAL=HDMI1
|
||||||
|
|
||||||
# You hay have to change ANALOG/DIGITAL in the outputs, especially for Workstation choices
|
# You hay have to change ANALOG/DIGITAL in the outputs, especially for Workstation choices
|
||||||
|
# The choices may be the same!
|
||||||
|
PRESENTATION=$ANALOG
|
||||||
|
WORKSTATION=$ANALOG
|
||||||
|
|
||||||
|
#Helper functions when using lxpanel (Lubuntu / LXDE)
|
||||||
|
function reset_lxpanel() {
|
||||||
|
if lxpanel_running; then
|
||||||
|
PROFILE=$( lxpanel_profile )
|
||||||
|
sed -i -e 's,edge=.*,edge=bottom,' -e "s,allign=.*,allign=left," -e "s,widthtype=.*,widthtype=percent," -e "s,width=.*,width=100," $HOME/.config/lxpanel/${PROFILE}/panels/panel
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function side_lxpanel() {
|
||||||
|
if lxpanel_running; then
|
||||||
|
PROFILE=$( lxpanel_profile )
|
||||||
|
sleep 1
|
||||||
|
LAPTOPWIDTH=$( xrandr -q | grep $LAPTOP | cut -d" " -f3 | cut -dx -f1 )
|
||||||
|
sed -i -e 's,edge=.*,edge=bottom,' -e "s,allign=.*,allign=$1," -e "s,widthtype=.*,widthtype=pixel," -e "s,width=.*,width=$LAPTOPWIDTH," $HOME/.config/lxpanel/${PROFILE}/panels/panel
|
||||||
|
echo "Warning: if LAPTOP has more pixels in the vertical direction, panel is invisible! change configuration of this script, and/or current setup ( lxpanelctl config )"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function restart_lxpanel() {
|
||||||
|
if lxpanel_running; then
|
||||||
|
LXCMD=$( ps -ocommand= --pid $( pgrep -u $USER -n lxpanel ) )
|
||||||
|
lxpanelctl restart
|
||||||
|
sleep 2
|
||||||
|
lxpanel_running || {
|
||||||
|
echo "lxpanel segfaulted. restarting..."
|
||||||
|
$LXCMD &> /dev/null &
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function lxpanel_running() {
|
||||||
|
pgrep -u $USER -n lxpanel &> /dev/null
|
||||||
|
}
|
||||||
|
function lxpanel_profile() {
|
||||||
|
ps -ocommand= --pid $( pgrep -u $USER -n lxpanel ) | sed 's/.*--profile \([^ ]\+\).*/\1/'
|
||||||
|
}
|
||||||
|
|
||||||
if [ -z "$1" ]
|
if [ -z "$1" ]
|
||||||
then
|
then
|
||||||
echo 'Choose display mode:
|
echo 'Choose display mode:
|
||||||
1) Laptop only
|
1) Laptop only
|
||||||
2) Presentation (2nd arg for gamma correction)
|
2) Presentation (2nd arg for gamma correction)
|
||||||
3) Workstation with 2nd screen
|
3) Workstation: 2nd screen on the right
|
||||||
4) External display only
|
4) Workstation: 2nd screen on the left
|
||||||
|
5) Workstation: external display only
|
||||||
'
|
'
|
||||||
read i
|
read -N 1 i
|
||||||
|
echo ""
|
||||||
else
|
else
|
||||||
i=$1
|
i=$1
|
||||||
fi
|
fi
|
||||||
@@ -22,11 +65,15 @@ if [ -z "$2" ]
|
|||||||
then g=1
|
then g=1
|
||||||
else g=$2
|
else g=$2
|
||||||
fi
|
fi
|
||||||
|
oppos=left
|
||||||
|
if [ "$2" = "left" ]
|
||||||
|
then oppos=right
|
||||||
|
fi
|
||||||
case $i in
|
case $i in
|
||||||
1) xrandr --output $LAPTOP --auto --gamma $g:$g:$g --output $ANALOG --off --output $DIGITAL --off ;;
|
1) xrandr --output $LAPTOP --auto --gamma $g:$g:$g --output $PRESENTATION --off --output $WORKSTATION --off; reset_lxpanel; ;;
|
||||||
2) xrandr --output $LAPTOP --mode 1024x768 --pos 0x0 --output $ANALOG --mode 1024x768 --pos 0x0 --gamma $g:$g:$g ;;
|
2) xrandr --output $LAPTOP --mode 1024x768 --pos 0x0 --output $PRESENTATION --mode 1024x768 --pos 0x0 --gamma $g:$g:$g; reset_lxpanel; ;;
|
||||||
3) xrandr --output $LAPTOP --auto --output $ANALOG --auto --right-of $LAPTOP ;;
|
3) xrandr --output $LAPTOP --auto --output $WORKSTATION --auto --right-of $LAPTOP; side_lxpanel right; ;;
|
||||||
4) xrandr --output $LAPTOP --off --output $ANALOG --auto ;;
|
4) xrandr --output $LAPTOP --auto --output $WORKSTATION --auto --left-of $LAPTOP; side_lxpanel left; ;;
|
||||||
|
5) xrandr --output $LAPTOP --off --output $WORKSTATION --auto; reset_lxpanel; ;;
|
||||||
esac
|
esac
|
||||||
|
restart_lxpanel
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ Usage: tsvsummary [-c column] [-t type] tsv_file
|
|||||||
-t Type of statistics: mean, max, min, sum, stdev, nas, unique
|
-t Type of statistics: mean, max, min, sum, stdev, nas, unique
|
||||||
-h Help
|
-h Help
|
||||||
'
|
'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TYPEOF=mean
|
TYPEOF=mean
|
||||||
TYPELIST=( mean max min sum stdev nas unique )
|
TYPELIST=( mean max min sum stdev nas unique )
|
||||||
while getopts c:ht: opt
|
while getopts c:ht: opt
|
||||||
@@ -45,6 +45,9 @@ then usage
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
which ncsv &> /dev/null || ( echo ncsv required: "https://code.google.com/p/nicecsv/"; exit 1 )
|
||||||
|
which csvcut &> /dev/null || ( echo csvkit required: "https://csvkit.readthedocs.org/"; exit 1 )
|
||||||
|
|
||||||
if [ -z "$LABEL" ]
|
if [ -z "$LABEL" ]
|
||||||
then ncsv --stat "$1" | sed -n "1p;/^$TYPEOF/Ip"
|
then ncsv --stat "$1" | sed -n "1p;/^$TYPEOF/Ip"
|
||||||
exit
|
exit
|
||||||
|
|||||||
Reference in New Issue
Block a user