|ohnonot 978f5b39b6 github to notabug||4 months ago|
|xbm||4 months ago|
|README.md||2 years ago|
|config||4 months ago|
|dmenu||2 years ago|
|getcolors_gtk2.py||4 months ago|
|getcolors_gtk3.py||4 months ago|
|gtkroot||2 years ago|
|new.xml||4 months ago|
|posix_compliant_random_functions||2 years ago|
|rc.xml||4 months ago|
|test_tv3.py||4 months ago|
|wait_for_theme_change||4 months ago|
|xappspicker||4 months ago|
|xappspicker.old||2 years ago|
Many applications are stylable, but do not follow your current GTK theme's style.
The idea is to extract a few key colors, namely
from your current GTK2 theme and apply them to these applications.
That is, if you like and use apps like
dmenu, or Xapps like
xsetroot (and its use of 2-tone bitmaps).
By default, not much. It will only change background and foreground colors for some X apps, namely XFontSel, Display, Bitmap, Xmag, Xman, Xpdf, Xscreensaver.
You can simply execute the script everytime you want to.
You can make a symlink to the executable somewhere in your
cd $HOME/bin ln -s /path/to/xscripts/xappspicker
But do not copy the script over, because it relies on some files to be in the same directory.
There are many modules that aren't enabled by default.
You should copy the
config file from the script's folder to
and make your adjustments:
xapps_enabled=1 # custom Xresources will be merged with xrdb. see $xres below. xsetroot_enabled=0 # background will be set according to color manipulations and other rules below dmenu_enabled=1 #dmenurc="$HOME/.config/dmenu/dmenurc" # dmenu colors will be set, if a dmenurc file is found (to actually use this, # one needs a wrapper around dmenu. an example is included in this repo). tint2_enabled=0 # if the theme folder includes tint2/tint2rc (a tint2rc file in a tint2 subfolder) # it will be launched. an instance of tint2 previously launched by this script will be killed. tint2_is_essential=1 # 1: if the theme does not contain a tint2rc, launch the default # 0: if the theme does not contain a tint2rc, don't launch anything. # an instance of tint2 previously launched by this script will still be killed. conky_enabled=0 # if the theme folder includes conky/conkyrc (a conkyrc file in a conky subfolder) # it will be launched. an instance of conky previously launched by this script will be killed. conky_is_essential=0 # 1: if the theme does not contain a conkyrc, launch the default # 0: if the theme does not contain a conkyrc, don't launch anything. # an instance of conky previously launched by this script will still be killed. openbox_enabled=0 #obrc="$HOME/.config/openbox/rc.xml" # if an openbox theme exists for the current gtk2 theme, replace the theme name # in openbox' rc.xml, and reconfigure. # If items in rc.xml are in an unusal, yet valid order, this might go wrong (e.g. # if a theme name is the same as a font name, and the font is defined before the theme). exec_enabled=0 #exec_path="" # defaults to $themepath/xappspicker.exec # search for an executable, and execute it. does not need to be a shell script or # even a script at all. dmenufont="terminus" # font definitions in dmenu 4.6 are unclear to me. they also differ from # suckless-tools 4.5 - one cannot pass xfont-strings. # the one below should work on all systems, or at least fail silently. # set to empty string to use default font. # prepare the values for xsetroot. please see man xsetroot. # 1.: do you want to choose a random bitmap from the following dir? # if not, set this to "", and xsetroot will choose: # a) the file xsetrootbitmap.xbm from $themedir, or, failing that # b) a random -mod. # bitmap directory, relative to the script's path bitmapdir="xbm/squidfingers" # 2.: which color to choose as a base for the background? I choose the background for # selected text, usually the most colorful accent in the theme. It's the 4th and # last color in the array generated by grepcol() = $sel_txt_bg # 3.: manipulate that color. # a) i prefer to darken the background to 20%, and the foreground to 10% xsetrootbg="$(fixed_value "$sel_txt_bg" "0.2")" xsetrootfg="$(fixed_value "$sel_txt_bg" "0.1")" # b) another possibility: color-invert (=negative) the colors #~ xsetrootbg="$(invert "$base_fg")" # that is the foreground #~ xsetrootfg="$(invert "$base_bg")" # that is the background # functions can be combined, too. # which xapps will be affected, and which color chosen? un/comment or add values. # this multiline variable will be piped to xrdb. see "man xrdb" for valid syntax. # also have a look at /usr/share/X11/app-defaults # please keep in mind that a leading '!' means 'commented out' ### start of xres variable ### xres="!!! background values ! XCalc.ti.Command.background: $base_bg ! XCal*background: $base_bg XFontSel*background: $base_bg display.background: $base_bg bitmap*background: $base_bg Xmag*background: $base_bg Xmag*helpLabel*background: $base_fg Xman*background: $base_bg xpdf*background: $base_bg xpdf*matteColor: $base_bg xscreensaver*background: $base_bg ! URxvt*borderColor: $base_bg ! *background: $base_bg !!! foreground values ! XCalc.ti.Command.foreground: $base_fg ! XCal*foreground: $base_fg XFontSel*foreground: $base_fg display.foreground: $base_fg bitmap*foreground: $base_fg Xmag*foreground: $base_fg Xmag*helpLabel*foreground: $base_bg Xman*foreground: $base_fg xpdf*foreground: $base_fg xscreensaver*foreground: $base_fg ! *foreground: $base_fg" ### end of xres variable ###*
The current theme folder is chosen through the file
~/.gtkrc-2.0, which is
typically modified by an application like
lxapearance (works great on any
desktop), but can also be edited manually.
It is possible to simply run the script as is at login.
However, it isn't exactly fast and might create a noticeable lag during login.
To avoid that, the script generates a file
The idea is:
inotifywatch(or some such) to watch for changes in
~/.gtkrc-2.0and execute the script only when needed.
You can achieve this by adding something like this to your autostart file (typically
dash -c '. "$HOME/.local/share/xorg/xappspicker_rc";sleep 5; while :; do inotifywait -e modify $HOME/.gtkrc-2.0; /path/to/xappspicker; done' &
I recommend using dash instead of bash; it is much faster, and everything has been tested to work with dash's limited capabilities.
I have added a large collection of .xbm tiles suitable for xsetroot; they're in
xbm and subfolders.
python 2.x, and the
gtkmodule. I'm fairly sure that this is included in a package called
pygtk. And you most probably already have it.
bash, I'd guess.
bc(command line calculator).
shuffor the posix compliant random functions.
adjust_conkyfunctions rely on
change_openbox_themefunction relies on
You can quickly create .xbm tiles with the
Try out the
xappspicker.py script to see what other color values can be accessed
(un/comment some sections).
xmllint, but replaced with
-a xappspicker_identifier. to my knowledge, conky is not affected by that.
also see this forum thread.