You are not logged in.

#1 2017-09-10 16:29:09

adesh
Member
Registered: 2016-10-05
Posts: 167

[SOLVED] xrdb - remove a single resource entry

Is there a way to remove a single resource entry from resource databse?

man xrdb wrote:

-remove This option indicates that the specified properties  should  be
               removed from the server.

I tried following commands, but all three nuke the whole database.

xrdb -remove .Xresources
xrdb -remove "URxvt.perl-ext-common"
xrdb -remove

Last edited by adesh (2017-09-12 06:12:54)

Offline

#2 2017-09-10 16:45:46

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: [SOLVED] xrdb - remove a single resource entry

I believe that is impossible. You can do a query/sed/load cycle, though.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#3 2017-09-12 05:03:26

NoSuck
Member
Registered: 2015-03-04
Posts: 157
Website

Re: [SOLVED] xrdb - remove a single resource entry

A cursory review of the source shows that "-remove" is intended to delete the entire database, and documentation is wrong.  (Note final four lines.)

xrdb.c wrote:
if (doScreen) {
xdefs = XScreenResourceString (ScreenOfDisplay(dpy, scrno));
root = RootWindow(dpy, scrno);
res_prop = XInternAtom(dpy, SCREEN_RESOURCES, False);
} else {
xdefs = XResourceManagerString (dpy);
root = RootWindow(dpy, 0);
res_prop = XA_RESOURCE_MANAGER;
}
if (oper == OPSYMBOLS) {
printf ("%s\n", defines.val);
} else if (oper == OPQUERY) {
if (xdefs)
	printf ("%s", xdefs);	/* fputs broken in SunOS 4.0 */
} else if (oper == OPREMOVE) {
if (xdefs)
	XDeleteProperty(dpy, root, res_prop);
}

Offline

#4 2017-09-12 06:12:30

adesh
Member
Registered: 2016-10-05
Posts: 167

Re: [SOLVED] xrdb - remove a single resource entry

Thanks for your responses and even looking through the source code smile
I shall mark this "solved", although the problem is unsolvable without a workaround.

Offline

Board footer

Powered by FluxBB