SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-04-30 09:31:01

ivo
#! Junkie
From: the six feet under the ground
Registered: 2011-05-06
Posts: 293

dsetcolor - Set background color whit Dmenu & Xsetroot

Hi monsters! big_smile

For all who do not use wallpaper,and for those who use. smile
I created simple, stupid script to set background color whit Dmenu & Xsetroot. (more than 100 colors)


#!/bin/bash
# 
# Set background color whit Dmenu & Xsetroot
# Autor:Ivo

#if [ -f $HOME/.dmenurc ]; then
#  . $HOME/.dmenurc
#else
#  DMENU='dmenu -i'
#fi
  
DMENU="dmenu -i -fn -*-terminus-medium-r-*-*-14-*-*-*-*-*-*-* -nb black -nf lightgreen -sb blue -sf white" 
 
# X11 color names  
COLOR=" 
AliceBlue\n 
AntiqueWhite\n
Aquamarine\n 
Azure\n 
Beige\n  
Bisque\n
Black\n  
BlanchedAlmond\n
Blue\n 
BlueViolet\n  
Brown\n 
Burlywood\n 
CadetBlue\n  
Chartreuse\n  
Chocolate\n 
Coral\n
Cornsilk\n 
Cyan\n 
DarkBlue\n 
DarkCyan\n 
DarkGoldenrod\n 
DarkGray\n 
DarkGreen\n
DarkKhaki\n 
DarkMagenta\n 
DarkOliveGreen\n 
DarkOrange\n  
DarkOrchid\n
DarkRed\n 
DarkSalmon\n 
DarkSeaGreen\n 
DarkSlateBlue\n
DarkSlateGray\n 
DarkTurquoise\n 
DarkViolet\n  
DeepPink\n 
DeepSkyBlue\n 
DimGray\n 
DodgerBlue\n 
Firebrick\n 
FloralWhite\n 
ForestGreen\n 
Gainsboro\n 
GhostWhite\n 
Gold\n 
Goldenrod\n  
Gray\n 
Green\n 
GreenYellow\n
Honeydew\n 
HotPink\n 
IndianRed\n 
Ivory\n  
Khaki\n 
Lavender\n 
LavenderBlush\n 
LawnGreen\n 
LemonChiffon\n 
LightBlue\n 
LightCoral\n 
LightCyan\n  
LightGoldenrod\n 
LightGray\n 
LightGreen\n 
LightPink\n 
LightSalmon\n 
LightSeaGreen\n 
LightSkyBlue\n  
LightSlateGray\n 
LightSteelBlue\n 
LightYellow\n 
Lime\n
Linen\n 
Magenta\n 
Maroon\n  
MediumAquamarine\n
MediumBlue\n 
MediumOrchid\n 
MediumPurple\n 
MediumSeaGreen\n 
MediumSlateBlue\n 
MediumSpringGreen\n 
MediumTurquoise\n 
MediumVioletRed\n 
MidnightBlue\n 
MintCream\n 
MistyRose\n 
Moccasin\n 
NavajoWhite\n 
Navy\n 
OldLace\n 
OliveDrab\n 
Orange\n 
OrangeRed\n 
Orchid\n 
PaleGoldenrod\n 
PaleGreen\n 
PaleTurquoise\n 
PaleVioletRed\n 
PapayaWhip\n 
PeachPuff\n 
Peru\n 
Pink\n 
Plum\n 
PowderBlue\n 
Purple\n 
Red\n 
RosyBrown\n 
RoyalBlue\n  
SaddleBrown\n 
Salmon\n
SandyBrown\n 
SeaGreen\n 
Seashell\n 
Sienna\n 
Silver\n 
SkyBlue\n 
SlateBlue\n 
SlateGray\n 
Snow\n 
SpringGreen\n 
SteelBlue\n 
Tan\n 
Thistle\n 
Tomato\n
Turquoise\n
Violet\n 
Wheat\n 
White\n
WhiteSmoke\n
Yellow\n 
YellowGreen\n
" 

cmd=`echo -e "${COLOR}" | $DMENU -p "Color name"` 
  
case $cmd in 
       AliceBlue)   
              xsetroot -solid  AliceBlue  
              ;; 

       AntiqueWhite)
              xsetroot -solid AntiqueWhite  
              ;;
  
       Aquamarine)
              xsetroot -solid Aquamarine  
              ;;
 
       Azure)
              xsetroot -solid Azure  
              ;;
       
       Beige) 
              xsetroot -solid Beige  
              ;; 
         
       Bisque) 
              xsetroot -solid Bisque  
              ;;  
      
       Black) 
              xsetroot -solid Black  
              ;; 
      
       BlanchedAlmond) 
              xsetroot -solid BlanchedAlmond  
              ;;
 
       Blue) 
              xsetroot -solid Blue  
              ;;
     
       BlueViolet) 
              xsetroot -solid BlueViolet  
              ;;
 
       Brown) 
              xsetroot -solid Brown  
              ;; 
 
       Burlywood) 
              xsetroot -solid Burlywood  
              ;;  
 
       CadetBlue) 
              xsetroot -solid CadetBlue  
              ;; 
        
       Chartreuse) 
              xsetroot -solid Chartreuse  
              ;;
 
       Chocolate) 
              xsetroot -solid Chocolate  
              ;;
 
       Coral) 
              xsetroot -solid Coral  
              ;;
 
       Cornsilk) 
              xsetroot -solid Cornsilk  
              ;;
 
       Cyan) 
              xsetroot -solid Cyan  
              ;;
      
       DarkBlue) 
              xsetroot -solid DarkBlue  
              ;;
         
       DarkCyan) 
              xsetroot -solid DarkCyan  
              ;;
      
       DarkGoldenrod) 
              xsetroot -solid DarkGoldenrod  
              ;;
 
       DarkGray) 
              xsetroot -solid DarkGray  
              ;;
 
       DarkGreen) 
              xsetroot -solid DarkGreen  
              ;;
 
       DarkKhaki) 
              xsetroot -solid DarkKhaki  
              ;;
 
       DarkMagenta) 
              xsetroot -solid DarkMagenta  
              ;; 

       DarkOliveGreen) 
              xsetroot -solid DarkOliveGreen  
              ;; 
 
       DarkOrange) 
              xsetroot -solid DarkOrange  
              ;; 
 
       DarkOrchid) 
              xsetroot -solid DarkOrchid  
              ;;
       
       DarkRed) 
              xsetroot -solid DarkRed  
              ;;  
 
       DarkSalmon) 
              xsetroot -solid DarkSalmon  
              ;; 
 
       DarkSeaGreen) 
              xsetroot -solid DarkSeaGreen  
              ;; 
 
       DarkSlateBlue) 
              xsetroot -solid DarkSlateBlue  
              ;; 
 
       DarkSlateGray) 
              xsetroot -solid DarkSlateGray  
              ;; 
      
       DarkTurquoise) 
              xsetroot -solid DarkTurquoise  
              ;; 
       
       DarkViolet) 
              xsetroot -solid DarkViolet  
              ;; 
      
       DeepPink) 
              xsetroot -solid DeepPink  
              ;; 
 
       DeepSkyBlue) 
              xsetroot -solid DeepSkyBlue  
              ;;

       DimGray) 
              xsetroot -solid DimGray  
              ;;
 
       DodgerBlue) 
              xsetroot -solid DodgerBlue  
              ;;
 
       Firebrick) 
              xsetroot -solid Firebrick  
              ;; 
     
       FloralWhite) 
              xsetroot -solid FloralWhite  
              ;; 
     
       ForestGreen) 
              xsetroot -solid ForestGreen  
              ;; 
  
       Gainsboro) 
              xsetroot -solid Gainsboro  
              ;;
  
       GhostWhite) 
              xsetroot -solid GhostWhite  
              ;;
 
       Gold) 
              xsetroot -solid Gold  
              ;;  
 
       Goldenrod) 
              xsetroot -solid Goldenrod  
              ;;  
  
       Gray) 
              xsetroot -solid Gray  
              ;;   
 
       Green) 
              xsetroot -solid Green  
              ;;  
 
       GreenYellow) 
              xsetroot -solid GreenYellow  
              ;; 
 
       Honeydew) 
              xsetroot -solid Honeydew  
              ;; 
  
       HotPink) 
              xsetroot -solid HotPink  
              ;;
 
       IndianRed) 
              xsetroot -solid IndianRed 
              ;; 
  
       Ivory) 
              xsetroot -solid Ivory
              ;; 
 
       Khaki) 
              xsetroot -solid Khaki
              ;;
 
       Lavender) 
              xsetroot -solid Lavender
              ;;

       LavenderBlush) 
              xsetroot -solid LavenderBlush
              ;;
 
       LawnGreen) 
              xsetroot -solid LawnGreen
              ;;     
 
       LemonChiffon) 
              xsetroot -solid LemonChiffon
              ;;  
 
       LightBlue) 
              xsetroot -solid LightBlue
              ;; 
 
       LightCoral) 
              xsetroot -solid LightCoral
              ;;  
 
       LightCyan) 
              xsetroot -solid LightCyan
              ;;  
 
       LightGoldenrod) 
              xsetroot -solid LightGoldenrod
              ;;
 
       LightGray) 
              xsetroot -solid LightGray
              ;;
 
       LightGreen) 
              xsetroot -solid LightGreen
              ;;
 
       LightPink) 
              xsetroot -solid LightPink
              ;; 
 
       LightSalmon) 
              xsetroot -solid LightSalmon
              ;; 
  
       LightSeaGreen) 
              xsetroot -solid LightSeaGreen
              ;;  
 
       LightSkyBlue) 
              xsetroot -solid LightSkyBlue
              ;; 
     
       LightSlateGray) 
              xsetroot -solid LightSlateGray
              ;; 
 
       LightSteelBlue) 
              xsetroot -solid LightSteelBlue
              ;; 
      
       LightYellow) 
              xsetroot -solid LightYellow
              ;;
      
       Lime) 
              xsetroot -solid Lime
              ;; 
 
       Linen) 
              xsetroot -solid Linen     
              ;;       
 
       Magenta) 
              xsetroot -solid Magenta    
              ;; 
 
       Maroon) 
              xsetroot -solid Maroon    
              ;; 
     
       MediumAquamarine) 
              xsetroot -solid MediumAquamarine   
              ;; 
 
       MediumBlue) 
              xsetroot -solid MediumBlue   
              ;; 
  
       MediumOrchid) 
              xsetroot -solid MediumOrchid  
              ;; 

       MediumPurple) 
              xsetroot -solid MediumPurple  
              ;;
       
       MediumSeaGreen) 
              xsetroot -solid MediumSeaGreen  
              ;;
   
       MediumSlateBlue) 
              xsetroot -solid MediumSlateBlue  
              ;;
 
       MediumSpringGreen) 
              xsetroot -solid MediumSpringGreen  
              ;; 
 
       MediumTurquoise) 
              xsetroot -solid MediumTurquoise  
              ;;  
 
       MediumVioletRed) 
              xsetroot -solid MediumVioletRed 
              ;; 
  
       MidnightBlue) 
              xsetroot -solid Midnight Blue
              ;;
 
       MintCream) 
              xsetroot -solid MintCream
              ;; 
  
       MistyRose) 
              xsetroot -solid MistyRose
              ;; 
       
       NavajoWhite) 
              xsetroot -solid NavajoWhite
              ;;      
 
       Navy) 
              xsetroot -solid Navy
              ;;     
 
       OldLace) 
              xsetroot -solid OldLace
              ;;      

       OliveDrab) 
              xsetroot -solid OliveDrab
              ;;    
 
       Orange) 
              xsetroot -solid Orange
              ;; 
 
       OrangeRed) 
              xsetroot -solid OrangeRed
              ;; 
 
       Orchid) 
              xsetroot -solid Orchid
              ;;
  
       PaleGoldenrod) 
              xsetroot -solid PaleGoldenrod
              ;;
       
       PaleGreen) 
              xsetroot -solid PaleGreen
              ;;

       PaleTurquoise) 
              xsetroot -solid PaleTurquoise
              ;;
 
       PaleVioletRed) 
              xsetroot -solid PaleVioletRed
              ;;    
 
       PapayaWhip) 
              xsetroot -solid PapayaWhip
              ;;  
 
       PeachPuff) 
              xsetroot -solid PeachPuff
              ;; 
 
       Peru) 
              xsetroot -solid Peru
              ;; 
 
       Ping) 
              xsetroot -solid Ping
              ;;  
 
       Plum) 
              xsetroot -solid Plum
              ;;  
 
       PowderBlue) 
              xsetroot -solid PowderBlue
              ;;  
 
       Purple) 
              xsetroot -solid Purple 
              ;;  
  
       Red) 
              xsetroot -solid Red 
              ;;   
 
       RosyBrown) 
              xsetroot -solid RosyBrown
              ;; 
  
       RoyalBlue) 
              xsetroot -solid RoyalBlue
              ;;  
 
       SaddleBrown) 
              xsetroot -solid SaddleBrown
              ;;  
 
       Salmon) 
              xsetroot -solid Salmon
              ;;  
 
       SandyBrown) 
              xsetroot -solid SandyBrown
              ;; 
 
       SeaGreen) 
              xsetroot -solid SeaGreen
              ;;
 
       Seashell) 
              xsetroot -solid Seashell
              ;;
  
       Sienna) 
              xsetroot -solid Sienna
              ;;
 
       Silver) 
              xsetroot -solid Silver
              ;;
        
       SkyBlue) 
              xsetroot -solid SkyBlue
              ;;

       SlateBlue) 
              xsetroot -solid SlateBlue
              ;;
 
       SlateGray) 
              xsetroot -solid SlateGray
              ;; 
 
       Snow) 
              xsetroot -solid Snow
              ;;
 
       SpringGreen) 
              xsetroot -solid SpringGreen    
              ;; 

       SteelBlue) 
              xsetroot -solid SteelBlue   
              ;;
 
       Tan) 
              xsetroot -solid Tan  
              ;; 
 
       Thistle) 
              xsetroot -solid Thistle 
              ;;
 
       Tomato) 
              xsetroot -solid Tomato 
              ;; 
 
       Turquoise) 
              xsetroot -solid Turquoise
              ;;  
 
       Violet) 
              xsetroot -solid Violet
              ;;  
 
       Wheat) 
              xsetroot -solid Wheat
              ;; 
 
       White) 
              xsetroot -solid White
              ;; 
  
       WhiteSmoke) 
              xsetroot -solid WhiteSmoke
              ;; 
 
       Yellow) 
              xsetroot -solid Yellow
              ;; 
 
       YellowGreen) 
              xsetroot -solid YellowGreen
              ;; 

esac 

 
The colors are taken from http://en.wikipedia.org/wiki/X11_color_names
I have not tested all, so pardon me, if some color does not work!!

Last edited by ivo (2012-04-30 16:51:45)


Arch || Github || Calavera-wm ☠
Head Banger..

Online

Help fund CrunchBang, donate to the project!

#2 2012-04-30 13:30:21

Doomicide
#! Junkie
From: the Nightosphere
Registered: 2011-06-24
Posts: 434
Website

Re: dsetcolor - Set background color whit Dmenu & Xsetroot

The following colors don't work with xsetroot:

~> for i in {1..139}; do col=$(sed -n ${i}'p' x11list | sed s'/ *$//' ); xsetroot -solid "${col}"; done 
xsetroot:  unknown color "Aqua"
xsetroot:  unknown color "Cornflower"
xsetroot:  unknown color "Crimson"
xsetroot:  unknown color "Fuchsia"
xsetroot:  unknown color "Indigo"
xsetroot:  unknown color "Laser Lemon"
xsetroot:  unknown color "Olive"
xsetroot:  unknown color "Teal"

I just wrote this little python-script, which uses the same list wink


“From each according to his faculties; to each according to his needs”
Look at the code. Look at the silly code!

Offline

#3 2012-04-30 16:57:58

ivo
#! Junkie
From: the six feet under the ground
Registered: 2011-05-06
Posts: 293

Re: dsetcolor - Set background color whit Dmenu & Xsetroot

Editied thanks!! roll


Arch || Github || Calavera-wm ☠
Head Banger..

Online

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo