Over the weekend I started playing with changing Vim's cursor colour and shape depending on the editing mode see Micah Elliot's great post Vi-Mode Ubiquitous Cursor Indicator. As I spend most of my time in i3 it got me thinking about using a more light-weight terminal emulator, XTerm. I suppose like everyone I used XTerm a long time ago, but as the default environments went with more sophisticated options I haven't kept up with it.
It's got a lot going for it including speed, flexibility and memory size. The initial bare-bones launch isn't particularly encouraging, but there's a lot we can do with it. The manual page for it is gigantic and takes a long time to get through, so I'm going to cover the important basics. When you first launch XTerm on Ubuntu There are simple options for turning on the scrollbar, but with the keyboard scroll option and mouse-wheel I don't think I need it and am saving the pixels!
XTerm can be configured through command line switches, or through X11 resources . X11 resources aren't used by modern X UI toolkits e. The important thing to know is that X is object orientated so the configuration strings are matching object paths in the X server. To use X11 resources the steps are:. Technically, it can be any file you want and you can include others, but this is the standard one to use.
X loads configuration into itself using the xrdb command:.
To check it's loading the X resources go to the new XTerm and use xrdb again. The output should be the same as the. Xresources file you loaded. For manual testing that's fine, but depending on how you're starting X you have to tell it to load in the X11 resources that you've defined.
I'm using startx so in my. We can improve XTerm's looks by setting a nice looking font. Fonts in X are a mess as there are old and new systems, luckily end-users don't generally see this. But for XTerm, we have to explicitly configure the font we want. The important difference is that there are old-style bitmapped fixed width fonts and newer TrueType fonts.
Lots of advanced users prefer using bitmapped fixed width fonts in a terminal, search Google for more information. Personally, I prefer a TrueType font with fixed width. This is how you configure them for XTerm:. These can be configured to whatever size you want.
We can do the same in XTerm. The xterm. Another bit of X history.It can be used to set X resourceswhich are configuration parameters for X client applications. Install the xorg-xrdb package. Resources are stored in the X server, so have to only be read once. They are also accessible to remote X11 clients such as those forwarded over SSH. Load a resource file such as the conventional. Xresourcesreplacing any current settings:.
If you are using a copy of the default xinitrc as your. Detailed information on program-specific resources is usually provided in the man page for the program. The asterisk can be used as a wildcard, making it easy to write a single rule that can be applied to many different applications or elements. Using the previous example, if you want to apply the same font to all programs not just XScreenSaver that contain the class name Dialog which contains the resource name headingFontyou would write:.
If you want to apply this same rule to all programs that contain the resource headingFontregardless of its class, you would write:. To add a comment to your Xresources file, simply prefix it with an exclamation mark!
Subscribe to RSS
To use different files for each application, use include in the main file. For example:. If files fail to load, specify the directory to xrdb with the -I parameter. The following samples should provide a good understanding of how application settings can be modified using an Xresources file. See  for more examples. Refer to the man page of the application in question otherwise. See Color output in console Terminal emulators.Customizing Your Terminal - Linux Terminal Beautification
See Cursor themes X resources. See Font configuration Applications without fontconfig support. See Rxvt-unicode Configuration.
See Options in man xpdf. Display managers such as GDM may use the --nocpp argument for xrdb. Jump to: navigationsearch. They can do many operations, including: defining terminal colours configuring terminal preferences setting DPI, antialiasing, hinting and other X font settings changing the Xcursor theme theming xscreensaver altering preferences on low-level X applications xclock xorg-xclockxpdfrxvt-unicodeetc.
Remove the '! Other X Resource files may be included in-place with include. Resources are applied in order; later ones override earlier ones. Similarly, if the same resource setting appears more than once in the same file, the last one prevails.
Xdefaults file. Xdefaults-hostname where "hostname" is the name of a machine where you have a login directory. Note that X Resource settings in this file affect all X applications. Changes for one application here may have undesirable consequences on other applications, and changes to this file these will not take effect until your next login session. Classes are hierarchical and the sequence of classes in a resource setting follows a path down the hierarchy.
This is called "loose binding". A period in the hierarchy separates adjacent classes and must exactly follow the hierarchy. This is called "tight binding".
In general it is easier to use loose binding because you do not have to know the exact hierarchy for each application. Useful and safe settings for other resources should be well documented in X resource file comments and examples provided by the application vendor.
These are designations for traditional, server-rendered X11 fonts. There is an introductory description in the X man page. An XLFD contains 14 fields, each prefixed by a dash. The position of the field determines its meaning: foundry, family, weight, etc.
For example:. You can run xfontsel to browse the available fonts on your system. For bitmap fonts, xfontsel lists all available sizes. For vector fonts, you can pick any size. Many applications support client-rendered fonts nowadays, which allows for nice features such as antialiasing. These use fontconfig to look up fonts, with completely different naming conventions.
Sign up to join this community. The best answers are voted up and rise to the top. Xresources font names Ask Question. Asked 5 years, 11 months ago. Active 5 years, 11 months ago. Viewed 6k times. Gilles 'SO- stop being evil' k gold badges silver badges bronze badges. Active Oldest Votes. Gilles 'SO- stop being evil' Gilles 'SO- stop being evil' k gold badges silver badges bronze badges. That's very helpful. Thanks for the examples as well as for pointing me to the XLFD for the full specifications.
I wasn't aware of xfontselbut find it to be a rather helpful tool for viewing the effect of varying parameters. Your answer also explains why changing the number in the font designation in my question wasn't changing the font size: the number was in the adstyl column rather than the pxlsz column. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password.
Post as a guest Name. Email Required, but never shown. The Overflow Blog. The Overflow Checkboxland.GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
If nothing happens, download GitHub Desktop and try again. If nothing happens, download Xcode and try again. If nothing happens, download the GitHub extension for Visual Studio and try again. Fork of the suckless terminal st with additional patches. Xresources using the syntax st. When you right click the selected text will be plumbed to the set command, if no text is selected then the word below the cursor will be automatically selected.
Skip to content. Fork of the suckless terminal with additional patches. MIT License. Dismiss Join GitHub today GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up. Branch: master. Go back. Launching Xcode If nothing happens, download Xcode and try again. Latest commit. Git stats 1, commits 1 branch 16 tags. Failed to load latest commit information. View code. Applied Patches: scrollback xresources boxdraw right click to plumb Requirements In order to build st you need the Xlib header files.
Installation Copy and edit config. Afterwards enter the following command to build and install st if necessary as root : make clean install. About Fork of the suckless terminal with additional patches.
Releases 16 tags. Contributors You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window.When I say xtermI'm talking about Thomas E. Dickey's xtermwhich came from XFree Although every free desktop ships its own terminal emulator, I always install xterm on my systems. Xresources file to make xterm look and feel a lot better than its default settings. Here they are, in easily digestible and copy-paste-able pieces:.
First, pick a nice font. I quite like proggy fonts. Also good are Terminus and Triskweline. Note: the above is just an example. On a Debian-like system, simply apt-get install xfonts-terminus. On another system, download the font you want to use, add it to your X fontpath, and work out its full name, usually using xlsfonts.
Linux xterm command
Don't just add the above line, not install the font, and then wonder why it isn't working. Next, I like all my terminals being login shells. Ones that honor. I have no idea why the default is to not do this.
Next, size: I'm very particular about having an 80x50 terminal. Note the vt above. If you write out this line without it, the geometry setting will affect things other than the size of the xterm. Thanks to Alex Peters for figuring this out and telling me about it.
Note that I don't turn on any scrollbars. They even make the gnome-terminal that comes with the Sun Java Desktop behave like this. Next, I like being able to double-click to select a word. The definition of a "word" depends on the character class resource.
Here's what I use:. Some systems get confused about xterm 's TERM type. It's xterm-color. If you're using an outdated OS, like Solaris, you'll need to install the xterm-color terminfo file into the appropriate place.
I've seen this problem on modern Linux systems. Now the fun bit: I actually really like the DOS-box colors. These are taken from a screen capture:. Note that foreground is lightgray color7 and background is black color0. Dark text on a light background is evil and wrong.Skip to content. Instantly share code, notes, and snippets. Xresources Created Aug 27, Code Revisions 1 Stars 13 Forks 4.
Embed What would you like to do? Embed Embed this gist in your website. Share Copy sharable link for this gist.
Learn more about clone URLs. Download ZIP. Xresources example. Resolution for Xft in dots per inch e. Type of subpixel antialiasing none, rgb, bgr, vrgb or vbgr! What degree of hinting to use hintnone, hintslight, hintmedium, or hintfull! URxvt URxvt.
UTF-8 URxvt. M-c: perl:clipboard:copy! M-v: perl:clipboard:paste! Base16 Flat! Base16 Eighties define base00 2d2d2d define base01 define base02 define base03 define base04 a09f93 define base05 d3d0c8 define base06 e8e6df define base07 f2f0ec define base08 fa define base09 f define base0A ffcc66 define base0B 99cc99 define base0C 66cccc define base0D cc define base0E cc99cc define base0F d27b53!!
Base16 Atelier Dune! Solarized color scheme for the X Window System!! Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Type of subpixel antialiasing none, rgb, bgr, vrgb or vbgr. What degree of hinting to use hintnone, hintslight, hintmedium, or hintfull. M-c: perl:clipboard:copy.
M-v: perl:clipboard:paste. Base16 Atelier Dune.