alsi

alsi is a system information tool, designed for Arch Linux, related to archey and screenfetch, but more configurable.

All the configuration files are in: ~/.config/alsi

For example, to configure it for Gentoo, get the gentoo logo and put it in alsi.logo file, change something in alsi.output and alsi.conf files (if necessary) and then execute: alsi -f -l -c1=blue -c2=purple

Result:


1. Changing alsi.output:

my $b = "\b\b\b\b";

[
 {HARDCODED => "\b\e[1;37m\e[41mTHIS IS ALSI\e[0m"},
 {OS        => $b . '%13sOS:%s %s'},                   # Operating system
 {HOSTNAME  => $b . '%4sHostname:%s %s'},              # Hostname
 {UPTIME    => $b . '%9sUptime:%s %s'},                # Uptime
 {KERNEL    => $b . '%9sKernel:%s %s'},                # Kernel version
 {SHELL     => $b . '%10sShell:%s %s'},                # Shell
 {PACKAGES  => $b . '%sPackages:%s %s'},               # Number of installed packages
 {WM_DE     => $b . "%13s%s:%s %s"},                   # WM or DE

 {GTK2_THEME      => $b . '%10sTheme:%s %s'},          # Gtk2 theme
 {GTK2_ICON_THEME => $b . '%11sIcon:%s %s'},           # Gtk2 icon theme
 {GTK2_FONT_NAME  => $b . '%11sFont:%s %s'},           # Gtk2 font name

 {CPU  => $b . "%12sCPU:%s %s"},                       # CPU name
 {SWAP => $b . '%11sSWAP:%s %s'},                      # SWAP usage
 {RAM  => $b . '%12sRAM:%s %s'},                       # RAM usage

 {PARTITIONS => '...'},                                # Partitions goes here
]


2. More colors can be added by using the Term::ANSIColor module;

Add new colors into alsi.colors file, like this:

use Term::ANSIColor qw(:constants);

scalar {
        black   => {normal => "\e[0;30m",              bold => "\e[1;30m"},
        # ...
        ublue   => {normal => (UNDERLINE BRIGHT_BLUE), bold => (UNDERLINE BOLD BLUE)},
        reset   => (RESET)
}

Available constants are:

         CLEAR           RESET             BOLD            DARK
         FAINT           UNDERLINE         UNDERSCORE      BLINK
         REVERSE         CONCEALED

         BLACK           RED               GREEN           YELLOW
         BLUE            MAGENTA           CYAN            WHITE
         BRIGHT_BLACK    BRIGHT_RED        BRIGHT_GREEN    BRIGHT_YELLOW
         BRIGHT_BLUE     BRIGHT_MAGENTA    BRIGHT_CYAN     BRIGHT_WHITE

         ON_BLACK        ON_RED            ON_GREEN        ON_YELLOW
         ON_BLUE         ON_MAGENTA        ON_CYAN         ON_WHITE
         ON_BRIGHT_BLACK ON_BRIGHT_RED     ON_BRIGHT_GREEN ON_BRIGHT_YELLOW
         ON_BRIGHT_BLUE  ON_BRIGHT_MAGENTA ON_BRIGHT_CYAN  ON_BRIGHT_WHITE


Now, if you execute alsi -c1=ublue -c2=black, hopefully, you will get something like this:



3. Advanced options can be found in alsi.conf:

  • DEFAULT_COLOR_NORMAL
    • the default normal color (color1)
  • DEFAULT_COLOR_BOLD
    • the default bold color (color2)
  • USE_VALUES_COLOR
    • if is set to 1, alsi will use color1 for the displayed values.
  • USAGE_COLORS
    • use normal colors for RAM and partitions usage.
  • USAGE_COLORS_BOLD
    • use bold colors for RAM and partitions usage.
  • USAGE_PRECENT_GREEN
    • if the usage percent is less or equal with this value, use the green color.
  • USAGE_PRECENT_YELLOW
    • if the usage percent is less or equal with this value, use the yellow color.
  • USAGE_PRECENT_RED
    • if the usage percent is less or equal with this value, use the red color.
  • SCREENSHOT_COMMAND
    • if alsi is executed with the -s argument, this command will be executed before alsi exists.
  • PS_COMMAND
    • this command is used to get the running processes and determine the Window Manager or the Desktop Environment (last column is used, so ps -A works too).
  • DF_COMMAND
    • with this command, we get information for the available partitions in the system. -x argument means to skip a certain type of partition.
  • PACKAGES_PATH
    • this is a directory which contains all the installed packages as directories. alsi counts the number of directories, which results in the number of installed packages.
  • USE_LOGO_FROM_FILE
    • if this value is set to 1, alsi will use the logo found in alsi.logo file.

4. Special variables and escapes supported by alsi.logo file.

It supports the following color variables:
   $c1 : normal color (color1)
   $c2 : bold color (color2)
   $z   : reset color

and the following escaped characters:
  \t : a tab character.
  \e : escape character (example: \e[0;31m for the color red).
  \x : hex decimal character (example: \x{23} for the character '#').

NOTE: The variables are also valid as: ${c1}, ${c2} and ${z} if they are followed by a word character.

Github: https://github.com/trizen/alsi
AUR: https://aur.archlinux.org/packages/alsi/

Comments

  1. Could you add Terminal info in alsi please? If you can, it is more better than archey!

    ReplyDelete
  2. "/usr/bin/alsi: línea 1: !DOCTYPE: No existe el fichero o el directorio
    /usr/bin/alsi: línea 2: html: No existe el fichero o el directorio
    /usr/bin/alsi: línea 3: head: No existe el fichero o el directorio
    /usr/bin/alsi: línea 4: meta: No existe el fichero o el directorio
    /usr/bin/alsi: línea 5: title: No existe el fichero o el directorio
    /usr/bin/alsi: línea 5: /title: No existe el fichero o el directorio
    /usr/bin/alsi: línea 6: meta: No existe el fichero o el directorio
    /usr/bin/alsi: línea 7: meta: No existe el fichero o el directorio
    /usr/bin/alsi: línea 8: meta: No existe el fichero o el directorio
    /usr/bin/alsi: línea 9: meta: No existe el fichero o el directorio
    /usr/bin/alsi: línea 10: meta: No existe el fichero o el directorio
    /usr/bin/alsi: línea 11: base: No existe el fichero o el directorio
    /usr/bin/alsi: línea 12: $'\r': no se encontró la orden
    /usr/bin/alsi: línea 13: link: No existe el fichero o el directorio
    /usr/bin/alsi: línea 14: $'\r': no se encontró la orden
    /usr/bin/alsi: línea 15: $'\r': no se encontró la orden
    /usr/bin/alsi: línea 16: link: No existe el fichero o el directorio
    /usr/bin/alsi: línea 17: link: No existe el fichero o el directorio
    /usr/bin/alsi: línea 18: meta: No existe el fichero o el directorio
    /usr/bin/alsi: línea 19: meta: No existe el fichero o el directorio
    /usr/bin/alsi: línea 20: meta: No existe el fichero o el directorio
    /usr/bin/alsi: línea 21: meta: No existe el fichero o el directorio
    /usr/bin/alsi: línea 22: meta: No existe el fichero o el directorio
    /usr/bin/alsi: línea 23: $'\r': no se encontró la orden
    /usr/bin/alsi: línea 24: $'\r': no se encontró la orden
    /usr/bin/alsi: línea 25: !--: No existe el fichero o el directorio
    /usr/bin/alsi: línea 26: link: No existe el fichero o el directorio
    /usr/bin/alsi: línea 27: link: No existe el fichero o el directorio
    /usr/bin/alsi: línea 28: link: No existe el fichero o el directorio
    /usr/bin/alsi: línea 29: link: No existe el fichero o el directorio
    /usr/bin/alsi: línea 30: link: No existe el fichero o el directorio
    /usr/bin/alsi: línea 31: $'\r': no se encontró la orden
    /usr/bin/alsi: línea 32: !--: No existe el fichero o el directorio
    /usr/bin/alsi: línea 33: link: No existe el fichero o el directorio
    /usr/bin/alsi: línea 34: link: No existe el fichero o el directorio
    /usr/bin/alsi: línea 35: link: No existe el fichero o el directorio
    /usr/bin/alsi: línea 36: !--[if: No existe el fichero o el directorio
    /usr/bin/alsi: línea 37: error sintáctico cerca del elemento inesperado `<'



    Hi, im getting this, I searched in google/arch forum and didn't find anything.

    Any clue?

    ReplyDelete
    Replies
    1. Seems like you downloaded and executed an HTML file.
      Please try to re-download the real code from: http://code.google.com/p/trizen/downloads/detail?name=alsi or install the 'alsi' program from AUR: https://aur.archlinux.org/packages.php?ID=41468

      Delete

Post a Comment