Suckless-st: Difference between revisions

From wikinotes
No edit summary
No edit summary
Line 31: Line 31:
= Configuration =
= Configuration =
<blockquote>
<blockquote>
Suckless st does not have any dynamic configuration. To make changes, you change the source-code and then recompile it.
Suckless st does not have any dynamic configuration. To make changes, you change the source-code and then recompile it.
Most options you'll be interested in (keybindings, colours, fonts) can be found in <code>config.h</code>.
Most options you'll be interested in (keybindings, colours, fonts) can be found in <code>config.h</code>.
Line 48: Line 47:
/* Terminal colors (16 first used in escape sequence) */
/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = {
static const char *colorname[] = {
/* 8 normal colors */
    /* 8 normal colors */


"#000000", //"black",
    "#000000", //"black",
"#A93025", // "red3",
    "#A93025", // "red3",
"#93d44f", // "green3",
    "#93d44f", // "green3",
"#eab93d", // "yellow3",
    "#eab93d", // "yellow3",
"#306a87", // "blue2",
    "#306a87", // "blue2",
"#ce5c00", // "magenta3",
    "#ce5c00", // "magenta3",
"#89b6e2", // "cyan3",
    "#89b6e2", // "cyan3",
"#cccccc", // "gray90",
    "#cccccc", // "gray90",


/* 8 bright colors */
    /* 8 bright colors */
"#555753", // "gray50",
    "#555753", // "gray50",
"#ff8d8d", // "red",
    "#ff8d8d", // "red",
"#40a030", // "green",
    "#40a030", // "green",
"#ffc123", // "yellow",
    "#ffc123", // "yellow",
"#3465a9", // "#5c5cff",
    "#3465a9", // "#5c5cff",
"#f57900", // "magenta",
    "#f57900", // "magenta",
"#46a4ff", // "cyan",
    "#46a4ff", // "cyan",
"#ffffff", // "white",
    "#ffffff", // "white",


[255] = 0,
    [255] = 0,


/* more colors can be added after 255 to use with DefaultXX */
    /* more colors can be added after 255 to use with DefaultXX */
"#cccccc",
    "#cccccc",
};
};


Line 90: Line 89:
<source lang="c">
<source lang="c">
static Shortcut shortcuts[] = {
static Shortcut shortcuts[] = {
/* mask                keysym          function        argument */
    /* mask                keysym          function        argument */
     /* resize fonts */
     /* resize fonts */
     { ControlMask,          XK_equal,      zoom,          {.f = +1} },
     { ControlMask,          XK_equal,      zoom,          {.f = +1} },
Line 96: Line 95:


     /* paste */
     /* paste */
{ ShiftMask,            XK_Insert,      selpaste,      {.i =  0} },  /* shift-ins pastes selection buffer */
    { ShiftMask,            XK_Insert,      selpaste,      {.i =  0} },  /* shift-ins pastes selection buffer */
{ MODKEY|ShiftMask,    XK_Insert,      clippaste,      {.i =  0} },  /* alt-shift-ins pastes clipboard */
    { MODKEY|ShiftMask,    XK_Insert,      clippaste,      {.i =  0} },  /* alt-shift-ins pastes clipboard */
{ MODKEY|ControlMask,  XK_v,          clippaste,      {.i =  0} },  /* ctrl-alt-v pastes clipboard */
    { MODKEY|ControlMask,  XK_v,          clippaste,      {.i =  0} },  /* ctrl-alt-v pastes clipboard */
};
};
</source>
</source>
</blockquote><!-- Configuration -->

Revision as of 14:49, 2 July 2022

st is a termial emulator from the suckless project.

Documentation

homepage https://st.suckless.org/

Install

# download/extract
curl -O# https://dl.suckless.org/st/st-0.8.2.tar.gz
tar -xvf st-0.8.2.tar.gz

# patch, if desired
curl -#O 'https://st.suckless.org/patches/alpha/st-alpha-0.8.2.diff'
patch -ruN -d st-0.8.2 < st-alpha-0.8.2.diff

# compile/install
cd st
./configure
make
sudo make install

Configuration

Suckless st does not have any dynamic configuration. To make changes, you change the source-code and then recompile it. Most options you'll be interested in (keybindings, colours, fonts) can be found in config.h.

Font/shell

static char font[]  = "Droid Sans Mono:size=14:antialias=true";
static char shell[] = "/bin/zsh";

If UTF-8 characters are not being rendered, check that your /etc/locale.conf is set properly. See Also: Linux Fonts.

Colours

/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = {
    /* 8 normal colors */

    "#000000",	//"black",
    "#A93025",	//	"red3",
    "#93d44f",	//	"green3",
    "#eab93d",	//	"yellow3",
    "#306a87",	//	"blue2",
    "#ce5c00",	//	"magenta3",
    "#89b6e2",	//	"cyan3",
    "#cccccc",	//	"gray90",

    /* 8 bright colors */
    "#555753",	//	"gray50",
    "#ff8d8d",	//	"red",
    "#40a030",	//	"green",
    "#ffc123",	//	"yellow",
    "#3465a9",	//	"#5c5cff",
    "#f57900",	//	"magenta",
    "#46a4ff",	//	"cyan",
    "#ffffff",	//	"white",

    [255] = 0,

    /* more colors can be added after 255 to use with DefaultXX */
    "#cccccc",
};

/*
 * Default colors (colorname index)
 * foreground, background, cursor
 */
unsigned int defaultfg = 243;
unsigned int defaultbg = 236;
static unsigned int defaultcs = 245;
static unsigned int defaultrcs = 257;

Hotkeys

Use xev to retrieve keysym

static Shortcut shortcuts[] = {
    /* mask                 keysym          function        argument */
    /* resize fonts */
    { ControlMask,          XK_equal,       zoom,           {.f = +1} },
    { ControlMask,          XK_minus,       zoom,           {.f = -1} },

    /* paste */
    { ShiftMask,            XK_Insert,      selpaste,       {.i =  0} },  /* shift-ins pastes selection buffer */
    { MODKEY|ShiftMask,     XK_Insert,      clippaste,      {.i =  0} },  /* alt-shift-ins pastes clipboard */
    { MODKEY|ControlMask,   XK_v,           clippaste,      {.i =  0} },  /* ctrl-alt-v pastes clipboard */
};