Skip to content

Commit 5f6dee6

Browse files
committed
cleanup: added some uncommited things
1 parent eee0699 commit 5f6dee6

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ rofi/config.rasi
88
nvim/.netrwhist
99
nvim/plugged
1010
nvim/plugin
11+
nvim/spell
1112
#protects against accidental commits of sensitive data
1213
aliases
1314
aerc/accounts.conf

kanshi/pollux.single.config

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
profile default {
2+
output DP-3 disable
3+
output DP-2 enable scale 1.0 position 2160,1680
4+
}

scripts/histplot

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/bin/sh
2+
3+
4+
die() {
5+
echo "error: $*" >&2
6+
exit 2
7+
}
8+
9+
usage() {
10+
echo "histplot [options] [input-file]"
11+
echo "Options:"
12+
echo " -d [char] - Set seperator"
13+
echo " -h - Help"
14+
echo "Arguments:"
15+
echo " Input file is a CSV or TSV file"
16+
exit 0
17+
}
18+
19+
separator=" "
20+
21+
while getopts :hd:x:y: ARG; do
22+
case $ARG in
23+
d)
24+
separator=$OPTARG
25+
;;
26+
h)
27+
usage
28+
;;
29+
x)
30+
xlabel=$OPTARG
31+
;;
32+
y)
33+
ylabel=$OPTARG
34+
;;
35+
\?)
36+
die "Invalid option: -$ARG"
37+
;;
38+
esac
39+
done
40+
41+
shift "$(( OPTIND - 1 ))"
42+
43+
[ -z "$1" ] && die "CSV or TSV input file required"
44+
45+
case "$1" in
46+
*.csv)
47+
separator=","
48+
infile="$1"
49+
outfile=$(basename -s csv "$infile")
50+
;;
51+
*.tsv)
52+
separator="\t"
53+
infile="$1"
54+
outfile=$(basename -s .tsv "$infile")
55+
;;
56+
*)
57+
infile="$1"
58+
outfile=$(basename "$infile")
59+
;;
60+
esac
61+
62+
outfile="$outfile.png"
63+
64+
gnuplot -p -e "set term png; set output '$outfile'; set datafile separator '$separator'; set style fill solid; set sty d hist; set xlabel '$xlabel'; set ylabel "$ylabel"; set yrange [0:50]; plot "$infile" u 2:xtic(1) notitle"
65+

0 commit comments

Comments
 (0)