aboutsummaryrefslogtreecommitdiff
path: root/colors/konsole.sh
blob: 602b0d97a35a2694bd0af25672bec048f62c1bca (plain) (blame)
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
#!/bin/sh
. ./colors.sh

# $1 is the combined value
# $2 is R, G or B
extract() {
	case "$2" in
		R) awk "BEGIN{print substr(\"$1\", 1, 2)}" ;;
		G) awk "BEGIN{print substr(\"$1\", 3, 2)}" ;;
		B) awk "BEGIN{print substr(\"$1\", 5, 2)}" ;;
		*) return 1 ;;
	esac
}

# hex 2 decimal
# $1 is a number in hex
h2d() {
	printf '%d' 0x"$1"
}

# $1: color value
# prints r,g,b
rgb() {
	_rgb_r=$(h2d $(extract $1 R))
	_rgb_g=$(h2d $(extract $1 G))
	_rgb_b=$(h2d $(extract $1 B))
	echo $_rgb_r,$_rgb_g,$_rgb_b
}

cat <<HEREDOC
[Background]
Color=$(rgb $background)

[BackgroundIntense]
Color=$(rgb $background)

[Color0]
Color=$(rgb $black)

[Color0Intense]
Color=$(rgb $brblack)

[Color1]
Color=$(rgb $red)

[Color1Intense]
Color=$(rgb $brred)

[Color2]
Color=$(rgb $green)

[Color2Intense]
Color=$(rgb $brgreen)

[Color3]
Color=$(rgb $yellow)

[Color3Intense]
Color=$(rgb $bryellow)

[Color4]
Color=$(rgb $blue)

[Color4Intense]
Color=$(rgb $brblue)

[Color5]
Color=$(rgb $magenta)

[Color5Intense]
Color=$(rgb $brmagenta)

[Color6]
Color=$(rgb $cyan)

[Color6Intense]
Color=$(rgb $brcyan)

[Color7]
Color=$(rgb $white)

[Color7Intense]
Color=$(rgb $brwhite)

[Foreground]
Color=$(rgb $foreground)

[ForegroundIntense]
Color=$(rgb $foreground)

[General]
Description=Starlight
Opacity=0.96
Wallpaper=
HEREDOC