pGtk-theme-refresh-1.1 in C Code

Window managers, icon programs, widgets, etc.
Post Reply
Message
Author
User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

pGtk-theme-refresh-1.1 in C Code

#1 Post by trio »

Hi,

This is a commandline gtk theme setter. I hacked a C code without any C Coding knowledge. And compiled in Quirky :)

I attached binary and source, also a .pet

Version 1.1: add warning if gtkrc supplied doesn't exist, add version

Code: Select all

Usage:
pGtkthemerefresh /path/to/your/gtkrc_theme/gtkrc
example:
pGtkthemerefresh /usr/share/themes/Default/gtk-2.0/gtkrc

WARNING! Be sure the file is a valid gtkrc
Passing no command line arguments will print this message
one glitch, it won't refresh browser's theme (in my case mozilla) on the fly

Regards,

Trio

PS: There's a perl version of it, but can't run in puppy. needs more lib for perl (Gtk2.pm)

Code: Select all

#!/usr/bin/perl
# License: Same as GTK2
use strict;
use warnings;
use Gtk2 '-init';

my $event = Gtk2::Gdk::Event->new("GDK_CLIENT_EVENT");
$event->send_event(1);
$event->window(undef);
$event->message_type(Gtk2::Gdk::Atom->intern("_GTK_READ_RCFILES", 0));
$event->data_format(8);
Gtk2::Gdk::Event->send_clientmessage_toall($event);	
a python version, requires pygtk:

Code: Select all

#!/usr/bin/python

import pygtk

import gtk

events=gtk.gdk.Event(gtk.gdk.CLIENT_EVENT)

data=gtk.gdk.atom_intern("_GTK_READ_RCFILES", True)

events.data_format=8

events.send_event=True

events.message_type=data

events.send_clientmessage_toall()
Attachments
pGtk-theme-refresh-1.1.pet
/usr/bin/pGtkthemerefresh
(3.62 KiB) Downloaded 901 times
pGtkthemerefresh-1.1.tar.gz
my binary and source
(4.18 KiB) Downloaded 410 times
gtkrc-reload.tar.gz
binary and source
(4.02 KiB) Downloaded 409 times
gtkrefresh.tar.gz
MU's gtk refresh binary and source
(3.17 KiB) Downloaded 371 times
Last edited by trio on Sat 29 Nov 2014, 09:46, edited 6 times in total.

User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

#2 Post by trio »

I hacked a C code without any C Coding knowledge. And compiled in Quirky :)

I attached binary and source

Code: Select all

Usage:
pGtkthemerefresh /path/to/your/gtkrc_theme/gtkrc
example:
pGtkthemerefresh /usr/share/themes/Default/gtk-2.0/gtkrc

WARNING! Be sure the file is a valid gtkrc
Passing no command line arguments will print this message
see main post

User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

#3 Post by trio »

Version 1.1: add warning if gtkrc supplied doesn't exist, add version

download above, please test

Post Reply