gtkColor

Submitted scripts and programs
Forum rules
Your own work only.
User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

gtkColor

Unread post by dkeg » Sun Sep 13, 2015 8:42 pm

A script I've been thinking about for awhile. I generally update a few colors on my current gtk theme to match my current xcolors, then save as new. Soon, if you're like me, your .themes/ gets crowded.
The goal was to only have a base gtk theme, which could be automatically updated to use your current xcolors. So today was the day to get it done, aptly named gtkColor. I did leverage some logic I used in my 2bwm border color script.
It requires a $HOME/tmp directory and some sort of xrdb color scraper.
When you change you xcolors, run this. It will update all color values in your base gtk theme. To assist, I've uploaded a base gtk theme also.
Check it out!
https://github.com/dkeg/inspin/blob/master/gtkColor

Work hard; Complain less

User avatar
Dr_Chroot
Alfalfa
Posts: 1100
Joined: Mon Jun 09, 2014 9:49 pm
Location: among the sagebrush
Contact:

Re: gtkColor

Unread post by Dr_Chroot » Sun Sep 13, 2015 10:04 pm

I actually haven't played with GTK much so this should be a learning curve :D Thanks, dkeg!
Fight internet censorship.
EFF | Tor Project | Bitcoin

"There have been times throughout American history where what is right is not the same as what is legal. Sometimes to do the right thing you have to break the law." - Edward Snowden

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: gtkColor

Unread post by dkeg » Mon Sep 14, 2015 2:20 am

Thanks DC. You want to keep your schemes consistent, no?

Updated to take current theme as set in your $HOME/.gtkrc. I'd still recommend to just use the 'base' gtk theme. Its tested and a nice generic name/theme. Enjoy.

I should just rename the fucker. So in the end its always just 'base'.

Work hard; Complain less

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: gtkColor

Unread post by machinebacon » Mon Sep 14, 2015 4:32 am

Ah here it is, thanks for sharing, I will test this tonight together with colr and link to xcolors/xcolor_code. Very excited :D
..gnutella..

User avatar
wuxmedia
Grasshopper
Posts: 6445
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: gtkColor

Unread post by wuxmedia » Mon Sep 14, 2015 9:40 am

What a smart idea, might be able to not need a tmp file, sometimes need to quote a var to have it print out exactly, if that's what it was.
anyway i'm no script master, if it works - it works :)
"Seek, and Ye shall find"
"Github | Chooons | Site"

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: gtkColor

Unread post by dkeg » Mon Sep 14, 2015 10:50 am

Cool MB, let me know how it goes

Wux, yeah, I don't know. The string was difficult to work with. This was the most elegant solution I would come up with.
Edit: *the only solution*. To add though, I am not aware of anything else out there similar.

Work hard; Complain less

User avatar
rhowaldt
Dog
Posts: 4565
Joined: Wed Oct 17, 2012 9:01 am
Contact:

Re: gtkColor

Unread post by rhowaldt » Mon Sep 14, 2015 1:38 pm

i think when you try to get out of tmp-files you get into shit with here-documents, and i find those so strange and illogical that i kinda prefer a tmp-file. indeed, if it works, it works.
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.

User avatar
wuxmedia
Grasshopper
Posts: 6445
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: gtkColor

Unread post by wuxmedia » Mon Sep 14, 2015 2:00 pm

yeah where is Raffles and the DR :^S
"Seek, and Ye shall find"
"Github | Chooons | Site"

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: gtkColor

Unread post by dkeg » Sun Sep 20, 2015 1:40 am

updated version adds a check for ~/tmp, creates if ! exists, adds a satisfying output.

Work hard; Complain less

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: gtkColor

Unread post by dkeg » Sat Jun 11, 2016 7:58 pm

Updated: scrapes xrdb directly, sets current gtk theme to match xcolor scheme. Works only with gtk2

Work hard; Complain less

Post Reply