feat: add Konsole recipe source and patches
This commit is contained in:
@@ -0,0 +1 @@
|
||||
all: signaltests
|
||||
@@ -0,0 +1,53 @@
|
||||
#!/bin/bash --
|
||||
#
|
||||
# display ANSI colours and test bold/blink attributes
|
||||
# orginates from Eterm distribution
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
ESC=$'\x1b'
|
||||
CSI="${ESC}["
|
||||
RST="${CSI}m"
|
||||
|
||||
echo ""; echo "${RST}"
|
||||
echo " 40 41 42 43 44 45 46 47 49"
|
||||
echo " 40 41 42 43 44 45 46 47 49"
|
||||
for fg in 30 31 32 33 34 35 36 37 39 90 91 92 93 94 95 96 97
|
||||
do
|
||||
l1="$fg ";
|
||||
l2=" ";
|
||||
l3=" ";
|
||||
l4=" ";
|
||||
l5=" ";
|
||||
l6=" ";
|
||||
l7=" ";
|
||||
l8=" ";
|
||||
l9=" ";
|
||||
l10=" ";
|
||||
l11=" ";
|
||||
for bg in 40 41 42 43 44 45 46 47 49
|
||||
do
|
||||
l1="${l1}${CSI}${fg};${bg}m Normal ${RST}"
|
||||
l2="${l2}${CSI}${fg};${bg};1m Bold ${RST}"
|
||||
l3="${l3}${CSI}${fg};${bg};2m Faint ${RST}"
|
||||
l4="${l4}${CSI}${fg};${bg};3m Italic ${RST}"
|
||||
l5="${l5}${CSI}${fg};${bg};4m Underl ${RST}"
|
||||
l6="${l6}${CSI}${fg};${bg};5m Blink ${RST}"
|
||||
l7="${l7}${CSI}${fg};${bg};8m Concel ${RST}"
|
||||
l8="${l8}${CSI}${fg};${bg};9m Strike ${RST}"
|
||||
l9="${l9}${CSI}${fg};${bg};53m Overli ${RST}"
|
||||
l10="${l10}${CSI}${fg};${bg};1;5m Bold! ${RST}"
|
||||
l11="${l11}${CSI}${fg};${bg};3;4m It/Und ${RST}"
|
||||
|
||||
done
|
||||
echo "$l1"
|
||||
echo "$l2"
|
||||
echo "$l3"
|
||||
echo "$l4"
|
||||
echo "$l5"
|
||||
echo "$l6"
|
||||
echo "$l7"
|
||||
echo "$l8"
|
||||
echo "$l9"
|
||||
echo "$l10"
|
||||
echo "$l11"
|
||||
done
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh --
|
||||
#
|
||||
# display ANSI colours and test bold/blink attributes
|
||||
# orginates from Eterm distribution
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
echo ""; echo "[m"
|
||||
echo " 40 41 42 43 44 45 46 47 49"
|
||||
for fg in 30 31 32 33 34 35 36 37 39
|
||||
do
|
||||
l1=" $fg ";
|
||||
l2="[1m $fg [m";
|
||||
for bg in 40 41 42 43 44 45 46 47 49
|
||||
do
|
||||
l1="${l1}[${fg};${bg}m xx [m"
|
||||
l2="${l2}[${fg};${bg};1m XX [m"
|
||||
done
|
||||
echo "$l1"
|
||||
echo "$l2"
|
||||
done
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
# Prints tables with all characters supported by LineBlockCharactersDrawer,
|
||||
# one for normal weight and one for bold.
|
||||
|
||||
first = 0x2500
|
||||
last = 0x259F
|
||||
|
||||
cpPerLine = 32
|
||||
|
||||
lineFmt = "\033[48;5;243;38;5;231m"
|
||||
|
||||
def fmtLine(text):
|
||||
return "{}\033[{}X {}\033[49;39m".format(lineFmt, cpPerLine*2+1, text)
|
||||
def fmtCh(text):
|
||||
return "\033[48;5;231;38;5;16m{}{}".format(text, lineFmt)
|
||||
def fmtRefCh(text):
|
||||
return "\033[48;5;252;38;5;16m{}{}".format(text, lineFmt)
|
||||
def setNoWrap(enable):
|
||||
print("\033[?7l" if enable else "\033[?7h", end="")
|
||||
def setBold(enable):
|
||||
print("\033[1m" if enable else "\033[21m", end="")
|
||||
def fmtBold(text):
|
||||
return "\033[1m{}\033[21m".format(text)
|
||||
|
||||
refChars = [["|", "│┃"], ["_-", "─━"], ["L", "└┗"], ["+", "┼╋"], ["=F", "╒╬"],
|
||||
["/", "╱"], ["\\", "╲"], ["X", "╳"]]
|
||||
boxes = \
|
||||
" +-----------+ ************* ,============, ╲\\ ╱/\n" \
|
||||
" | ┌───────┐ | @ ┏━━━━━━━┓ @ # ╔════════╗ # ╲\\╱/ \n" \
|
||||
" | │ Light │ | @ ┃ Heavy ┃ @ # ║ Double ║ # ╳X \n" \
|
||||
" | └───────┘ | @ ┗━━━━━━━┛ @ # ╚════════╝ # ╱/╲\\ \n" \
|
||||
" +-----------+ ************* \"============\" ╱/ ╲\\\n" \
|
||||
|
||||
lines = []
|
||||
for cp in range(first, last+1):
|
||||
columnId = int((cp - first) % cpPerLine)
|
||||
lineId = int((cp - first) / cpPerLine)
|
||||
if columnId == 0:
|
||||
lines.append([])
|
||||
lines[lineId].append(chr(cp))
|
||||
|
||||
setNoWrap(True)
|
||||
|
||||
refCharsLine = " ".join(fmtRefCh(rc[0]) + fmtCh(rc[1]) for rc in refChars)
|
||||
print(fmtLine("{:8s} line width reference: {}".format("Normal", refCharsLine)))
|
||||
|
||||
print(fmtLine(""))
|
||||
for line in lines:
|
||||
print(fmtLine(" ".join(fmtCh(ch) for ch in line)))
|
||||
print(fmtLine(""))
|
||||
|
||||
print("\n" + boxes)
|
||||
|
||||
setBold(True)
|
||||
refCharsLine = " ".join(fmtRefCh(rc[0]) + fmtCh(rc[1]) for rc in refChars)
|
||||
print(fmtLine("{:8s} line width reference: {}".format("Bold", refCharsLine)))
|
||||
|
||||
print(fmtLine(""))
|
||||
for line in lines:
|
||||
print(fmtLine(" ".join(fmtCh(ch) for ch in line)))
|
||||
print(fmtLine(""))
|
||||
|
||||
print("\n" + boxes)
|
||||
|
||||
setBold(False)
|
||||
setNoWrap(False)
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh --
|
||||
#
|
||||
# faint intensity support (SGR 2)
|
||||
# conceal support (SGR 8)
|
||||
# strikeout support (SGR 9)
|
||||
# overline support (SGR 53)
|
||||
|
||||
# echo 'D\e[2mD\e[9mD\e[53mD\e[8mD'
|
||||
|
||||
echo ""; echo "[m"
|
||||
echo " faint concel strikeout overline"
|
||||
#for fg in 30 31 32 33 34 35 36 37 39
|
||||
for fg in 30
|
||||
do
|
||||
for bg in 40 41 42 43 44 45 46 47 49
|
||||
do
|
||||
for sgr in 2 8 9 53
|
||||
do
|
||||
l1="${l1}[${fg};${bg};1m XX [m"
|
||||
l1="${l1}[${fg};${bg};${sgr}m XX [m"
|
||||
done
|
||||
l1="${l1}\n"
|
||||
done
|
||||
echo "$l1"
|
||||
done
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
Author: Kasper Laudrup <laudrup@stacktrace.dk>
|
||||
This code is in the public domain.
|
||||
From patch from bko 214908
|
||||
*/
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int signals[] = {SIGSTOP, SIGCONT, SIGHUP, SIGINT, SIGTERM, SIGKILL, SIGUSR1, SIGUSR2};
|
||||
|
||||
print_signal_name(int signal)
|
||||
{
|
||||
char *signame;
|
||||
switch (signal) {
|
||||
case SIGSTOP:
|
||||
signame = "SIGSTOP";
|
||||
break;
|
||||
case SIGCONT:
|
||||
signame = "SIGCONT";
|
||||
break;
|
||||
case SIGHUP:
|
||||
signame = "SIGHUP";
|
||||
break;
|
||||
case SIGINT:
|
||||
signame = "SIGINT";
|
||||
break;
|
||||
case SIGTERM:
|
||||
signame = "SIGTERM";
|
||||
break;
|
||||
case SIGKILL:
|
||||
signame = "SIGKILL";
|
||||
break;
|
||||
case SIGUSR1:
|
||||
signame = "SIGUSR1";
|
||||
break;
|
||||
case SIGUSR2:
|
||||
signame = "SIGUSR1";
|
||||
break;
|
||||
default:
|
||||
signame = "UNKNOWN";
|
||||
break;
|
||||
}
|
||||
printf("Caught signal: %s\n", signame);
|
||||
}
|
||||
|
||||
void handler(int signal)
|
||||
{
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
sigset_t waitset;
|
||||
struct sigaction sigact;
|
||||
int signal, result, i;
|
||||
int signals_size = sizeof(signals) / sizeof(int);
|
||||
|
||||
sigemptyset(&sigact.sa_mask);
|
||||
sigemptyset(&waitset);
|
||||
sigact.sa_flags = 0;
|
||||
sigact.sa_handler = handler;
|
||||
for (i = 0; i < signals_size; i++) {
|
||||
sigaction(signals[i], &sigact, NULL);
|
||||
sigaddset(&waitset, signals[i]);
|
||||
}
|
||||
|
||||
printf("Waiting for signal\n");
|
||||
result = sigwait(&waitset, &signal);
|
||||
if (result == 0) {
|
||||
print_signal_name(signal);
|
||||
return 0;
|
||||
} else {
|
||||
char *error = strerror(result);
|
||||
printf("Error calling sigwait: %s\n", error);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
do_tests() {
|
||||
tput cup 0 0; printf "$@"
|
||||
|
||||
for i in {0..16}; do tput cup $i 0; printf "\e#6"; done
|
||||
|
||||
tput cup 0 $((COLUMNS/2-1)); printf "AB"
|
||||
tput cup 3 $((COLUMNS/2-1)); printf "A\bB"
|
||||
tput cup 6 $((COLUMNS/2-1)); printf A; tput cud 1; printf B
|
||||
tput cup 9 $((COLUMNS/2-1)); printf A; tput cuu 1; printf B
|
||||
tput cup 12 $((COLUMNS/2-1)); printf A; tput cub 1; printf B
|
||||
tput cup 15 $((COLUMNS/2-1)); printf A; tput cuf 1; printf B
|
||||
|
||||
tput cup 18 1; echo -n -- "-- Press RETURN to run next test --"
|
||||
read
|
||||
#sleep 5
|
||||
}
|
||||
|
||||
clear; tput smam
|
||||
do_tests "No Reverse Wrap - AutoWrap Mode"
|
||||
|
||||
clear; tput rmam
|
||||
do_tests "No Reverse Wrap - No AutoWrap Mode"
|
||||
|
||||
|
||||
clear; tput smam; printf "\e[?45h"
|
||||
do_tests "Reverse Wrap - AutoWrap Mode"
|
||||
|
||||
clear; tput rmam; printf "\e[?45h"
|
||||
do_tests "Reverse Wrap - No AutoWrap Mode"
|
||||
|
||||
|
||||
clear; tput smam; printf "\e[?45l"
|
||||
@@ -0,0 +1,30 @@
|
||||
do_tests() {
|
||||
tput cup 0 0; printf "$@"
|
||||
|
||||
tput cup 0 $((COLUMNS-1)); printf "AB"
|
||||
tput cup 3 $((COLUMNS-1)); printf "A\bB"
|
||||
tput cup 6 $((COLUMNS-1)); printf A; tput cud 1; printf B
|
||||
tput cup 9 $((COLUMNS-1)); printf A; tput cuu 1; printf B
|
||||
tput cup 12 $((COLUMNS-1)); printf A; tput cub 1; printf B
|
||||
tput cup 15 $((COLUMNS-1)); printf A; tput cuf 1; printf B
|
||||
|
||||
tput cup 18 1; echo -n -- "-- Press RETURN to run next test --"
|
||||
read
|
||||
#sleep 5
|
||||
}
|
||||
|
||||
clear; tput smam
|
||||
do_tests "No Reverse Wrap - AutoWrap Mode"
|
||||
|
||||
clear; tput rmam
|
||||
do_tests "No Reverse Wrap - No AutoWrap Mode"
|
||||
|
||||
|
||||
clear; tput smam; printf "\e[?45h"
|
||||
do_tests "Reverse Wrap - AutoWrap Mode"
|
||||
|
||||
clear; tput rmam; printf "\e[?45h"
|
||||
do_tests "Reverse Wrap - No AutoWrap Mode"
|
||||
|
||||
|
||||
clear; tput smam; printf "\e[?45l"
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh --
|
||||
#
|
||||
# display [user@host/path] in title
|
||||
|
||||
export PS1="\\[]2;\\u@\\H\\w\\]$ "
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash --
|
||||
#
|
||||
# Switch utf-8 mode
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
case $1 in
|
||||
on) echo $'\033%G'"UTF-8 on";;
|
||||
off) echo $'\033%@'"UTF-8 off";;
|
||||
*) echo "usage: $0 [on|off]";;
|
||||
esac
|
||||
Reference in New Issue
Block a user