sistema_progs

Programas para customizar o meu entorno de traballo nos meus equipos persoais
Log | Files | Refs

README.md (2520B)


      1 # GCOLORS - Gerardet Colors
      2 This color library (header files and some utilities) are meant to have
      3 several color schemes (.h files). This color schemes can be included
      4 directly in C programs (such us suckless programs) to avoid opening Xresources
      5 file, for example, which is slow.
      6 
      7 It can also set environment variables with the colors formatted in `#rrggbb`
      8 
      9 ## Installation
     10 Simply run
     11 ```bash
     12 sudo ./install
     13 ```
     14 and header files will be installed at _/usr/include_ and scripts in _/opt/gcolors_
     15 
     16 ## Color schemes
     17 This are the available color schemes
     18 - nord
     19 - dracula
     20 
     21 Edit gcolors folder (_/usr/include/gcolors/_) to add/del/change color schemes.
     22 Don't forget to include them all in _/usr/include/gcolors.h_
     23 
     24 ## Usage
     25 ### Use colors
     26 #### In C files:
     27 Just type
     28 ```c
     29 #include <gcolors.h>
     30 ```
     31 and you can add COL\_GROC, for example, to get the yellow color (see definitions
     32 in _/usr/include/gcolors/your_theme.h_)
     33 #### In scripts
     34 If you have set environment variables (see it below) then you can
     35 echo "$COL\_GROC" to display the yellow color.
     36 
     37 This is useful for example for configuring dwmblocks with status2d, which
     38 allows you typing any color in the hex format, which is the format followed by gcolors
     39 
     40 ### Change color scheme
     41 ```bash
     42 sudo /opt/gcolors/change.sh [theme_name (nord, dracula, ...)]
     43 ```
     44 ### Remake pkgs that need gcolors.h
     45 Edit the file _/opt/gcolors/makepkgs_, which contains a list of folders that
     46 contain programs (such us dwm or dmenu) that need to be recompiled.
     47 
     48 **NOTE 1**: Run it with regular user! (**don't run it with sudo**)
     49 
     50 **NOTE 2**: To enter HOME directory, please type `~/` instead of `$HOME` in that file,
     51 as you can see in the example included in this repository
     52 
     53 Then, run
     54 ```bash
     55 /opt/remake.sh
     56 ```
     57 to re-make (install clean) those packages
     58 
     59 ### Set environment variables
     60 Just add the following to the autostart (maybe ~/.xinitrc)
     61 ```bash
     62 . /opt/gcolors/colors_env.sh
     63 ```
     64 Notice that it must be sourced (with `.` or `source`). You can run it also in the
     65 fly to refresh color variables
     66 
     67 ### Make all this with dmenu!
     68 Run the following:
     69 ```bash
     70 /opt/gcolors/theme_dmenu.sh
     71 ```
     72 to open dmenu (must be installed). There you can select the theme and it will
     73 be changed, remaked and set the env. variables! Make sure you have a program
     74 to ask SUDO\_ASKPASS to enter the password to change the theme
     75 
     76 ## Colors
     77 The name of the colors are in catalan. You can see the header files (in _/usr/include/gcolors_)
     78 to see the colors.
     79 
     80 If you want to add more themes, please follow the same syntax.