~fultonbrowne/rc-scripts

ref: 1548cc3d3364e742e401026593c24123c7b17457 rc-scripts/patches/abaco-ddg.diff -rw-r--r-- 3.6 KiB
1548cc3d — glenda added yet another handy script 7 months ago
                                                                                
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
diff -r 4bafb394707a sys/src/cmd/abaco/exec.c
--- a/sys/src/cmd/abaco/exec.c	Sun Feb 28 13:31:49 2021 +0100
+++ b/sys/src/cmd/abaco/exec.c	Sun Feb 28 14:26:31 2021 -0800
@@ -18,7 +18,7 @@
 void	exit(Text *, Text *, int, int, Rune *, int);
 void	get(Text *, Text *, int, int, Rune *, int);
 void	go(Text *,Text *,  int, int, Rune *, int);
-void	google(Text *,Text *,  int, int, Rune *, int);
+void	ddg(Text *,Text *,  int, int, Rune *, int);
 void	new(Text*, Text *, int, int, Rune *, int);
 void	newcol(Text*, Text *, int, int, Rune *, int);
 void	paste(Text *, Text *, int, int, Rune *, int);
@@ -43,7 +43,7 @@
 	{ L"Delcol",	delcol,	FALSE,	TRUE	},
 	{ L"Exit",		exit,		XXX,		XXX		},
 	{ L"Get",		get,		XXX,		XXX		},
-	{ L"Google",	google,	XXX,		XXX		},
+	{ L"Ddg",	ddg,	XXX,		XXX		},
 	{ L"New",		new,		XXX,		XXX		},
 	{ L"Newcol",	newcol,	XXX,		XXX		},
 	{ L"Next",		go,		TRUE,	XXX		},
@@ -517,13 +517,13 @@
 }
 
 void
-google(Text *, Text *, int, int, Rune *arg, int narg)
+ddg(Text *, Text *, int, int, Rune *arg, int narg)
 {
 	Runestr rs;
 	Rune *s;
 
 	s = ucvt(arg);
-	rs.r = runesmprint("http://www.google.com/search?hl=en&ie=UTF-8&q=%.*S", narg, s);
+	rs.r = runesmprint("http://duckduckgo.com/lite?q=%.*S", narg, s);
 	rs.nr = runestrlen(rs.r);
 	openpage(nil, &rs);
 	free(s);
diff -r 4bafb394707a sys/src/cmd/abaco/main.c
--- a/sys/src/cmd/abaco/main.c	Sun Feb 28 13:31:49 2021 +0100
+++ b/sys/src/cmd/abaco/main.c	Sun Feb 28 14:26:31 2021 -0800
@@ -347,19 +347,17 @@
 	Rectangle r;
 
 	/* Green */
-	tagcols[BACK] = allocimagemix(display, DPalegreen, DWhite);
-	if(tagcols[BACK] == nil)
-		error("allocimagemix");
-	tagcols[HIGH] = eallocimage(display, Rect(0,0,1,1), screen->chan, 1, DDarkgreen);
-	tagcols[BORD] = eallocimage(display, Rect(0,0,1,1), screen->chan, 1, DMedgreen);
+	tagcols[BACK] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xddddddFF);
+	tagcols[HIGH] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x404040FF);
+	tagcols[BORD] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x404040FF);
 	tagcols[TEXT] = display->black;
 	tagcols[HTEXT] = display->black;
 
 	/* Grey */
-	textcols[BACK] = display->white;
-	textcols[HIGH] = eallocimage(display, Rect(0,0,1,1), CMAP8,1, 0xCCCCCCFF);
-	textcols[BORD] = display->black;
-	textcols[TEXT] = display->black;
+	textcols[BACK] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x9a9a9aFF);
+	textcols[HIGH] =  allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xddddddFF);
+	textcols[BORD] =  allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0xddddddFF);
+	textcols[TEXT] = display->white;
 	textcols[HTEXT] = display->black;
 
 	r = Rect(0, 0, Scrollsize+2, font->height+1);
@@ -369,10 +367,10 @@
 	border(button, r, 2, tagcols[BORD], ZP);
 
 	r = button->r;
-	colbutton = eallocimage(display, r, screen->chan, 0, 0x00994CFF);
+	colbutton = allocimage(display, r, screen->chan, 0, 0x404040FF);
 
-	but2col = eallocimage(display, Rect(0,0,1,2), screen->chan, 1, 0xAA0000FF);
-	but3col = eallocimage(display, Rect(0,0,1,2), screen->chan, 1, 0x444488FF);
+	but2col = allocimage(display, r, screen->chan, 1, 0xAA0000FF);
+	but3col = allocimage(display, r, screen->chan, 1, 0x006600FF);
 
 	passfont = openfont(display, fontnames[1]);
 	if(passfont == nil)
diff -r 4bafb394707a sys/src/cmd/abaco/rows.c
--- a/sys/src/cmd/abaco/rows.c	Sun Feb 28 13:31:49 2021 +0100
+++ b/sys/src/cmd/abaco/rows.c	Sun Feb 28 14:26:31 2021 -0800
@@ -33,7 +33,7 @@
 	r1.min.y = r1.max.y;
 	r1.max.y += Border;
 	draw(screen, r1, display->black, nil, ZP);
-	textinsert(t, 0, L"Newcol Google Exit ", 19);
+	textinsert(t, 0, L"Newcol Ddg Exit ", 19);
 	textsetselect(t, t->rs.nr, t->rs.nr);
 }