소스 검색

Add utility function to print horizontal "ruler"

Mostly for easier visual distinction and also for fun.
Alois Mahdal 5 년 전
부모
커밋
cd90fa9d87
1개의 변경된 파일17개의 추가작업 그리고 0개의 파일을 삭제
  1. 17
    0
      dotfiles/bash/main.bashrc

+ 17
- 0
dotfiles/bash/main.bashrc 파일 보기

33
     __bashum_run_n "${1:-1}" xfce4-terminal
33
     __bashum_run_n "${1:-1}" xfce4-terminal
34
 }
34
 }
35
 
35
 
36
+hr() {
37
+    #
38
+    # Make horizontal ruler
39
+    #
40
+    local i
41
+    local line
42
+    for i in $(seq 1 "$COLUMNS"); do
43
+        case $((i%10)) in
44
+            0)  line+='#' ;;
45
+            *)  line+='-' ;;
46
+        esac
47
+    done
48
+    echo "$line"
49
+    echo "$line"
50
+    echo "$line"
51
+}
52
+
36
 __bashum_run_n() {
53
 __bashum_run_n() {
37
     #
54
     #
38
     # Run $2 in background $1 times
55
     # Run $2 in background $1 times