Xterm Linux установка

Настройка Xorg

Xterm Linux установка

☰ Оглавление

  • Первая страница
  • Онлайн инструменты ▽
  • Инструменты ▽
  • CS: Искусственный интеллект ▽
  • CS: Разное ▽
  • Теория относительности ▽
  • Теория вероятностей ▽
    • Как нас обманывает интуиция
    • Парадокс Монти Холла
    • Парадокс двух конвертов
  • Квантовая механика ▽
    • Принцип неопределённости на классических примерах
  • Фракталы ▽
  • Гиперкуб
  • Обучение и преподавание ▽
  • Как я худел
  • Личное ▽

Сразу оговорюсь, я настраиваю Xorg руками и предпочитаюлёгкие оконные менеджеры. Я знаю, что большинство пользователейделает не так, но надеюсь, что и они найдут здесь что-нибудь полезное.

Информационные утилиты Xorg

При настройке оконного интерфейса (оконного менеджера)часто оказывается необходимаинформация об окнах того или иного приложения. Получить её можнодвумя командами xwininfo и xprop.

При настройке обработки событий (клавиатура/мышь) оченьполезна бывает утилита xev.

Xterm

.Xresources для древних систем. Тут используютсядревние шрифты, восьмибитная кодировка… Но это работает всегда:

Xft.rgba: noneXft.hinting: trueXft.autohint: falseXft.hintstyle: hintfullXft.antialias: trueXft.dpi: 84Rxvt*scrollBar: falseRxvt*boldFont: -*-fixed-*-*-*-*-*-*-*-*-*-*-koi8-rRxvt*geometry: 80x30Rxvt*visualBell: trueRxvt*keysym.0xFF50: \e[HRxvt*keysym.0xFF57: \e[FXTerm*font: -*-fixed-*-*-*-*-*-*-*-*-*-*-koi8-rXTerm*font2: -*-fixed-*-*-*-*-6-*-*-*-*-*-koi8-*XTerm*font3: -misc-fixed-medium-*-*-*-8-*-*-*-*-*-koi8-rXTerm*font4: -misc-fixed-medium-*-*-*-10-*-*-*-*-*-koi8-rXTerm*font5: -misc-fixed-medium-*-*-*-15-*-*-*-*-*-koi8-rXTerm*font6: -sony_koi8_ru-fixed-medium-*-*-*-24-*-*-*-*-*-koi8-rXTerm*color0: #000000XTerm*color1: #9e1828XTerm*color2: #aece92XTerm*color3: #968a38XTerm*color4: #414171XTerm*color5: #963c59XTerm*color6: #418179XTerm*color7: #bebebeXTerm*color8: #666666XTerm*color9: #cf6171XTerm*color10: #c5f779XTerm*color11: #fff796XTerm*color12: #4186beXTerm*color13: #cf9ebeXTerm*color14: #71bebeXTerm*color15: #ffffffXTerm*foreground: #bebebeXTerm*background: #000000XTerm*colorBDMode: trueXTerm*colorBD: #82cd00XTerm*colorULMode: trueXTerm*colorUL: #d4cd00XTerm*translations: #override \ ~Ctrl: insert-selection(CLIPBOARD, CUT_BUFFER1) \ ~Ctrl: ignore()XTerm*locale: falseXTerm*allowC1Printable: trueXTerm*Background: #000000XTerm*Foreground: #bebebeXTerm*VisualBell: trueXClock*width: 60XClock*height: 60XClock*hourColor: #ffffffXClock*minuteColor: #ffffffXClock*secondColor: #ffffffXClock*majorColor: #ffffffXClock*minorColor: #696969XClock*padding: 3XClock*background: #121212

Более современная настройка. Работает с UTF-8, сглаженнымишрифтами и поддерживает изменение цветов налету. Последнююфичу я использую постоянно в таком ключе: залогинился надругую систему — Alt-F5 (например) — подкрасили окошечко.

XTerm*faceName: «DejaVu Sans Mono:style=Book»!XTerm*faceName: «Andale Mono» XTerm*faceSize: 14XTerm*faceSize1: 8XTerm*faceSize2: 9XTerm*faceSize3: 10XTerm*faceSize4: 12XTerm*faceSize5: 14XTerm*faceSize6: 16 XTerm*color0: #000000XTerm*color1: #9e1828XTerm*color2: #aece92XTerm*color3: #968a38XTerm*color4: #414171XTerm*color5: #963c59XTerm*color6: #418179XTerm*color7: #bebebeXTerm*color8: #666666XTerm*color9: #cf6171XTerm*color10: #c5f779XTerm*color11: #fff796XTerm*color12: #4186beXTerm*color13: #cf9ebeXTerm*color14: #71bebeXTerm*color15: #ffffff!XTerm*colorAttrMode: true! color 7 and 0XTerm*foreground: #bebebeXTerm*background: #000000!XTerm*colorBDMode: true!XTerm*colorBD: #82cd00!XTerm*colorBL!XTerm*colorRV!XTerm*colorULMode: true!XTerm*colorUL: #d4cd00 ! на правой кнопке вставка из CLIPBOARD*VT100*translations: #override \ ~Ctrl: insert-selection(CLIPBOARD, CUT_BUFFER1) \ ~Ctrl: ignore() \ MetaF1: interpret(«\033]111\007») \ interpret(«\033]112\007») \ interpret(«\033]113\007») \ interpret(«\033]114\007») \ MetaF2: interpret(«\033]12;#ff0000\007») \ interpret(«\033]13;#000000\007») \ interpret(«\033]14;#ff0000\007») \ MetaF3: interpret(«\033]12;#00ff00\007») \ interpret(«\033]13;#000000\007») \ interpret(«\033]14;#00ff00\007») \ MetaF4: interpret(«\033]12;#ffff00\007») \ interpret(«\033]13;#000000\007») \ interpret(«\033]14;#ffff00\007») \ MetaF5: interpret(«\033]11;#300000\007») \ MetaF6: interpret(«\033]11;#003000\007») \ MetaF7: interpret(«\033]11;#303000\007») \ MetaF11: smaller-vt-font() \ MetaF12: larger-vt-font() XTerm*locale: false!XTerm*allowC1Printable: trueXTerm*Background: #000000XTerm*Foreground: #bebebeXTerm*VisualBell: true

TightVNC

vncviewer*grabKeyboard: truevncviewer*encodings: tightvncviewer*qualityLevel: 4vncviewer*requestedDepth: 8

Шрифты

!Xft.rgba: none!Xft.rgba: rgbXft.hinting: trueXft.autohint: false!Xft.hintstyle: hintslightXft.hintstyle: hintfullXft.antialias: trueXft.dpi: 84

xfontsel

XFontSel*viewPort.sampleText.background: #000000XFontSel*viewPort.sampleText.foreground: #cccccc

.fvwm2rc

Для FVWM 2.6. Используется m4.

# fvwm -c 'FvwmM4 ~/.fvwm/.fvwm2rc-m4-2.6' ############################################ M4 MACRO define(`MOD_KEY', `4')define(`MMOD_KEY', `4M')define(`CMOD_KEY', `4C')define(`Window', `WTSF124680')define(`WindowI', `WTSF124680I')define(`WinRotCond', `(AcceptsFocus, CurrentPage, !Iconic, !Shaded, !FvwmPager)') define(`jumpmap', `ifelse(`$#', `0', , `$#', `1', , `$#', `2', , `Key `$3' A MOD_KEY GotoPage `$1' `$2'Key `$3' A CMOD_KEY GotoPage `$1' `$2'Key `$3' A MMOD_KEY MoveAndGoToPage `$1' `$2'jumpmap(shift(shift(shift($@))))')') define(`RenewFunc', `DestroyFunc `$1'AddToFunc `$1'') define(`RenewMenu', `DestroyMenu `$1'AddToMenu `$1'') ############################################ Functions # open_icon_library-fullImagePath /home/a/.fvwm/i # UTIL RenewFunc(RIconify)# + I Layer 0 2 + I Iconify true + I Raise RenewFunc(RDeIconify) + I Iconify false# + I Layer 0 4# + I All (CurrentPage, Iconic) PlaceAgain Icon + I Raise # START RenewFunc(StartFunction) + I Module FvwmBacker # UTIL RenewFunc(normalization_of_the_cursor_position) + I WarpToWindow -5px -5px # OPERATION RenewFunc(MoveAndGoToPage) + I Raise + I MoveToPage $0 $1 + I GotoPage $0 $1 RenewFunc(MoveAndGoToPagePrev) + I Raise + I MoveToPage prev + I GotoPage prev RenewFunc(RaiseLowerOrMove) + C RaiseLower + M Raise + M Move RenewFunc(RaiseLowerOrResize) + C RaiseLower + M Resize + D Stick RenewFunc(RaiseAndResizeOrIconify) + I Raise + C RIconify + M Resize RenewFunc(RaiseAndMoveOrIconify) + I Raise + D RIconify + M Move RenewFunc(RaiseAndStick) + I Raise + I Stick RenewFunc(SelectWindow) + I Focus + I RDeIconify + I normalization_of_the_cursor_position RenewFunc(SelectNextWindow) + I Next WinRotCond SelectWindow RenewFunc(SelectPrevWindow) + I Prev WinRotCond SelectWindow RenewFunc(DeIconifyOrMove) + I Raise + C RDeIconify + D RDeIconify + M Move RenewFunc(MoveAndGo) + I Move $0 $1 + I normalization_of_the_cursor_position RenewFunc(MaximizeAndGo) + I Maximize $0 $1 + I normalization_of_the_cursor_position ############################################ Menu RenewMenu(RDesktop) + «my» Exec exec rdesktop # дописать своё RenewMenu(Apps) + «Firefox» Exec exec firefox + «Chromium» Exec exec chromium + «GFtp» Exec exec gftp + «Thunderbird» Exec exec thunderbird + «Tkabber» Exec exec tkabber + «GIMP» Exec exec gimp + «» Nop + «Xfontsel» Exec exec xfontsel #AddToMenu Browser# + DynamicPopupAction PipeRead «fvwm-menu-directory -r -na Browser -d / -s» #AddToFunc FuncFvwmMenuDirectory# + I PipeRead «fvwm-menu-directory —command-title '' -d '$0'» RenewMenu(Util) + «Utilities» Title + «Xterm» Exec exec xterm + «Root» Exec exec xterm -bg \#180000 -e sudo bash + «Apps» Popup Apps + «RDesktop» Popup RDesktop + «Xkill» Exec exec xkill + «`Window'» Popup Window-Ops + «» Nop# + «My Browser» Menu Browser# + MissingSubmenuFunction FuncFvwmMenuDirectory# + «My Browser2» Popup /home# + «» Nop + «Exit» Popup Quit-Verify RenewMenu(Quit-Verify) + «Really Quit Fvwm?» Title + «No, Don't Quit» Nop + «Restart» Restart —dont-preserve-state + «» Nop + «Yes, Really Quit» Quit RenewMenu(Window-Ops) + «Maximize» MaximizeAndGo 100 100 + «Maximize vertical» MaximizeAndGo 0 100 + «Maximize horizontal» MaximizeAndGo 100 0 + «» Nop + «Iconify» RIconify + «Stick» RaiseAndStick + «» Nop + «StaysOnTop» Layer 0 6 + «StaysPut» Layer 0 4 + «StaysOnBottom» Layer 0 2 + «» Nop + «WindowShade» WindowShade + «» Nop + «Close window» Close + «Destroy window» Destroy ############################################ Misc DeskTopSize 12x3EdgeResistance 10000Style * EdgeMoveResistance 20EdgeScroll 0 0 # do not scrollStyle * SnapAttraction 10 SameTypeIgnoreModifiers L25 # ignore caps-lock num-lock scroll-lock ############################################ Window Title # menuButtonStyle 1 Vector 5 \ 40×60@0 40×40@1 60×40@1 60×60@0 40×60@0# trashButtonStyle 2 Vector 7 \ 20×20@0 80×20@1 80×30@0 \ 65×80@0 35×80@0 \ 20×30@1 20×20@1# iconButtonStyle 4 Vector 4 \ 50×75@0 80×25@0 20×25@1 50×75@1# maxButtonStyle 6 Vector 5 \ 20×80@0 20×20@1 80×20@1 80×80@0 20×80@0# stickButtonStyle 8 Vector 10 \ 20×20@0 80×20@1 \ 80×40@0 65×40@0 65×70@0 50×90@0 \ 35×70@0 35×40@1 20×40@0 20×20@1# resizeButtonStyle 0 Vector 10 \ 45×65@0 45×80@0 20×80@0 20×50@1 35×50@1 \ 35×65@1 35×20@1 80×20@1 80×65@0 35×65@0 ButtonStyle 1 — ClearButtonStyle 2 — ClearButtonStyle 4 — ClearButtonStyle 6 — Clear MwmDecorMaxButtonStyle 8 — Clear MwmDecorStickButtonStyle 0 — Clear ############################################ Mouse Mouse 1 1 A Menu Window-Ops NopMouse 1 2 MOD_KEY DestroyMouse 1 2 A CloseMouse 1 4 A RIconifyMouse 1 6 A MaximizeAndGo 100 100Mouse 1 8 A RaiseAndStickMouse 1 0 A ResizeMouse 1 T A RaiseAndMoveOrIconifyMouse 2 T A LowerMouse 3 T A RaiseLowerOrResizeMouse 4 T A WindowShade True # upMouse 5 T A WindowShade False # down Mouse 1 R A Menu UtilMouse 3 R A Menu UtilMouse 2 R A Module FvwmPager -transient 0 0Mouse 1 I A DeIconifyOrMoveMouse 2 I A StickMouse 3 I A Iconify off Mouse 1 Window MOD_KEY RaiseLowerOrMoveMouse 2 Window MOD_KEY LowerMouse 3 Window MOD_KEY RaiseAndResizeOrIconify Mouse 3 Window MMOD_KEY StrokeFuncStroke 0 0 Window MMOD_KEY MoveStroke N357 0 Window MMOD_KEY Move 0 0Stroke N456 0 Window MMOD_KEY Move -0 wStroke N654 0 Window MMOD_KEY Move 0 wStroke N258 0 Window MMOD_KEY Move w 0Stroke N852 0 Window MMOD_KEY Move w -0Stroke N951 0 Window MMOD_KEY Move 0 -0Stroke N159 0 Window MMOD_KEY Move -0 0Stroke N753 0 Window MMOD_KEY Move -0 -0 ############################################ Hot Keys Key Up WindowI MOD_KEY RaiseKey Up R MOD_KEY SelectNextWindowKey Down WindowI MOD_KEY LowerKey Down R MOD_KEY SelectNextWindowKey Right A MOD_KEY GotoPage +1p +0pKey Left A MOD_KEY GotoPage -1p +0pKey Up A CMOD_KEY GotoPage +0p -1pKey Down A CMOD_KEY GotoPage +0p +1pKey Right WindowI MMOD_KEY MoveAndGoToPage +1p +0pKey Left WindowI MMOD_KEY MoveAndGoToPage -1p +0pKey Up WindowI MMOD_KEY MoveAndGoToPage +0p -1pKey Down WindowI MMOD_KEY MoveAndGoToPage +0p +1p Key grave A MOD_KEY GotoPage preey grave A MMOD_KEY MoveAndGoToPagePrev Key End Window MOD_KEY MaximizeAndGo 100 100Key Page_Up Window MOD_KEY MaximizeAndGo 0 100Key Page_Down Window MOD_KEY MaximizeAndGo 100 0Key Delete Window MOD_KEY RIconifyKey End R MOD_KEY SelectNextWindowKey Page_Up R MOD_KEY SelectNextWindowKey Page_Down R MOD_KEY SelectNextWindowKey Delete R MOD_KEY SelectNextWindow Key Home WindowI MOD_KEY RaiseAndStickKey Escape WindowI MOD_KEY CloseKey Escape WindowI MMOD_KEY Destroy Key Return A MOD_KEY Popup Util Key Space A MMOD_KEY Exec xlock -mode swarm Key Tab A MOD_KEY SelectNextWindowKey BackSpace A MOD_KEY SelectPrevWindowKey KP_Add A MOD_KEY SelectNextWindowKey KP_Subtract A MOD_KEY SelectPrevWindow Key KP_Home Window MOD_KEY MoveAndGo 0 0Key KP_Up Window MOD_KEY MoveAndGo 50-50w 0Key KP_Prior Window MOD_KEY MoveAndGo -0 0Key KP_Left Window MOD_KEY MoveAndGo 0 50-50wKey KP_Begin Window MOD_KEY MoveAndGo 50-50w 50-50wKey KP_Right Window MOD_KEY MoveAndGo -0 50-50wKey KP_End Window MOD_KEY MoveAndGo 0 -0Key KP_Down Window MOD_KEY MoveAndGo 50-50w -0Key KP_Next Window MOD_KEY MoveAndGo -0 -0 jumpmap( 0, 0, 1, 1, 0, 2, 2, 0, 3, 3, 0, 4, 4, 0, 5, 5, 0, 6, 6, 0, 7, 7, 0, 8, 8, 0, 9, 9, 0, 0,10, 0, minus,11, 0, equal, 0, 1, q, 1, 1, w, 2, 1, e, 3, 1, r, 4, 1, t, 5, 1, y, 6, 1, u, 7, 1, i, 8, 1, o, 9, 1, p,10, 1, bracketleft,11, 1, bracketright, 0, 2, a, 1, 2, s, 2, 2, d, 3, 2, f, 4, 2, g, 5, 2, h, 6, 2, j, 7, 2, k, 8, 2, l, 9, 2, semicolon,10, 2, apostrophe,11, 2, backslash) Key F1 A MOD_KEY Exec amixer set Front,0 5%-,5%- unmuteKey F2 A MOD_KEY Exec amixer set Front,0 5%+,5%+ unmute ############################################ define(`COMMON_FONT', `»-*-helvetica-medium-r-*-*-14-*-*-*-*-*-koi8-*»')define(`xstyle',`Style `$2' `$1'ifelse($#,2,`',`xstyle(`$1',shift(shift($@)))')') Colorset 0 fg #ff0000, bg #696969, hi #939393, sh #343434 Style * \ BorderWidth 0, \ HandleWidth 3, \ Font COMMON_FONT, \ MWMFunctions, \ MWMDecor, \ HintOverride, \ MWMBorder, \ MWMButtons, \ IconFont COMMON_FONT, \ IconBackgroundColorset 0, \ IconBox 400×400+200-0, \ IconFill Left Bottom, \ IconBackgroundRelief 2, \ IconBackgroundPadding 0, \ Icon cameramonitor.png, \ IconOverride#, StickyIcon # , IconBox 200×800-0+0, IconFill Right Topxstyle(`IconBox 400×400+600-0, IconFill Right Bottom', xterm)xstyle(`!Title', xterm, rxvt, xclock, pclock, display, FvwmPager, xmms)xstyle(`BorderWidth 0, HandleWidth 0', xclock, display, FvwmPager, xmms)xstyle(`Sticky', xclock, FvwmPager) define(`seticons',`Style $1 Icon $2ifelse($#,2,`',`seticons(shift(shift($@)))')') seticons(xterm, konsole.png,mplauer, mplayer.png,chromium, chromium-2.png,firefox, firefox_alt.png,Firefox, firefox_alt.png,gimp, gimp-3.png,gqview, graphics-2.png,tkabber, internet-chat-2.png,googleearth-bin, internet-web-browser-7.png,xmms, juk-2.png,Licq, licq-2.png,Thunderbird, internet-mail-2.png) # xprop xwininfo MenuStyle * Font COMMON_FONT ############################################ define(`WP_PATH', `/home/a/.fvwm/bg5') define(`loop_row', `ifelse($#,3,`loop_row($1,$2,$3,0)',`dnlColorset $2 TiledPixmap WP_PATH/bg-$4-$3.xpm*FvwmBacker: Command (Desk *, Page $3 $4) Colorset $2ifelse(eval($4

Читайте также  Dpkg установка с зависимостями

Источник: http://www.michurin.net/tools/setup-xorg.html

configuring xterm

Xterm Linux установка

First written sometime in 2006.

When I say xterm, I'm talking about Thomas E. Dickey's xterm, which came from XFree86. Although every free desktop ships its own terminal emulator, I always install xterm on my systems.

I keep a set of customizations in my ~/.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 proggy fonts. Also good are Terminus and Triskweline.

xterm*font: terminus-12

(Note: the above is just an example. On a Debian- 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. Don't just add the above line, not install the font, and then wonder why it isn't working)

Next, I all my terminals being login shells. Ones that honor.profile and generally initialize the shell environment the way I expect.I have no idea why the default is to not do this.

xterm*loginShell: true

Next, size: I'm very particular about having an 80×50 terminal. 80 columns is not just a good idea, it's the law:

xterm*vt100*geometry: 80×50

Note the vt100 above. If you write out this line without it, the geometry setting will affect things other than the size of the xterm. , for example, the Ctrl+Click menu will be 80 pixels wide and 50 pixels tall, rendering it entirely unusable. Thanks to Alex Peters for figuring this out and telling me about it.

Next, I having lots of scrollback:

Читайте также  MSI click bios 5 установка Windows 10

xterm*saveLines: 2000

Note that I don't turn on any scrollbars. You can scroll up and down by using Shift+PgUp and Shift+PgDn, respectively. Sun Microsystems always screw this up for me — they switch the meanings of PgUp and Shift+PgUp, so regular PgUp becomes scrolling and you have to «escape» it with a Shift to get the PgUp sent to the underlying application. They even make the gnome-terminal that comes with the Sun Java Desktop behave this.

Next, I being able to double-click to select a word. The definition of a «word» depends on the character class resource. For a complete explanation, look at the CHARACTER CLASSES section in the xterm manpage. Here's what I use:

xterm*charClass: 33:48,35:48,37:48,43:48,45-47:48,64:48,95:48,126:48

Some systems get confused about xterm's TERM type. It's xterm-color. If you're using an outdated OS, Solaris, you'll need to install the xterm-color terminfo file into the appropriate place. (/usr/share/lib/terminfo/x/xterm-color on Solaris) Get it right:

xterm*termName: xterm-color

If Alt+F sends \346 and you need [f, add the following line. I've seen this problem on modern Linux systems.

xterm*eightBitInput: false

Now the fun bit: I actually really the DOS-box colors. These are taken from a screen capture:

xterm*foreground: rgb:a8/a8/a8xterm*background: rgb:00/00/00 xterm*color0: rgb:00/00/00xterm*color1: rgb:a8/00/00xterm*color2: rgb:00/a8/00xterm*color3: rgb:a8/54/00xterm*color4: rgb:00/00/a8xterm*color5: rgb:a8/00/a8xterm*color6: rgb:00/a8/a8xterm*color7: rgb:a8/a8/a8xterm*color8: rgb:54/54/54xterm*color9: rgb:fc/54/54xterm*color10: rgb:54/fc/54xterm*color11: rgb:fc/fc/54xterm*color12: rgb:54/54/fcxterm*color13: rgb:fc/54/fcxterm*color14: rgb:54/fc/fcxterm*color15: rgb:fc/fc/fc

Note that foreground is lightgray (color7) and background is black (color0). Dark text on a light background is evil and wrong.

Next, bold text looks really terrible. I prefer the bold attribute to make the text bright, it did in DOS, instead of making the font fat and illegible. To do this, disable boldMode:

xterm*boldMode: false

Sometimes this isn't enough and you still get unreadable text. You can work around it by setting xterm*boldFont to the same value as xterm*font above. I've seen this problem on modern Linux systems.

boldMode makes color+bold = lightcolor, but bold foreground (color7) stays color7. As in, bold now has no effect on uncolored text. I want lightgray+bold = white, so I add:

xterm*colorBDMode: truexterm*colorBD: rgb:fc/fc/fc

And that's it.

The whole thing in one copy-paste-friendly chunk

xterm*font: terminus-12xterm*boldFont: terminus-12xterm*loginShell: truexterm*vt100*geometry: 80x50xterm*saveLines: 2000xterm*charClass: 33:48,35:48,37:48,43:48,45-47:48,64:48,95:48,126:48xterm*termName: xterm-colorxterm*eightBitInput: falsexterm*foreground: rgb:a8/a8/a8xterm*background: rgb:00/00/00xterm*color0: rgb:00/00/00xterm*color1: rgb:a8/00/00xterm*color2: rgb:00/a8/00xterm*color3: rgb:a8/54/00xterm*color4: rgb:00/00/a8xterm*color5: rgb:a8/00/a8xterm*color6: rgb:00/a8/a8xterm*color7: rgb:a8/a8/a8xterm*color8: rgb:54/54/54xterm*color9: rgb:fc/54/54xterm*color10: rgb:54/fc/54xterm*color11: rgb:fc/fc/54xterm*color12: rgb:54/54/fcxterm*color13: rgb:fc/54/fcxterm*color14: rgb:54/fc/fcxterm*color15: rgb:fc/fc/fcxterm*boldMode: falsexterm*colorBDMode: truexterm*colorBD: rgb:fc/fc/fc

Rant: DOS

Yes, yes, DOS is terrible, blah blah, whatever. I grew up on DOS and it had an awesome default color scheme and lots of cool drawing characters that very talented people could use to make some awesome ANSI art.

Obviously, I much prefer the Unix environment, but one of the things that always irked me about it (before I wasted all this time figuring out how xterm and terminfo and curses play together) is that it just looked bad.

What I'm trying to say is: I think that making an xterm look a DOS box should not carry the stigma of DOS being DOS. A default xterm looks bad. A default DOS box looks much better.

Rant: How not to configure xterm

At University, we had a very cool shared Unix environment, back in the good old days. Something I used to see very often, which disturbed me, was people configuring their xterms through their window manager configuration. As in, they would have a menu entry for starting a terminal, and it'd run xterm followed by several wrapped lines of commandline arguments to tweak all the different settings they wanted.

This is the wrong way to do it.

The default resources for an xterm belong in the same place as the default resources for all your other X applications: in a file called .Xresources

The benefits of doing it right:

  • You don't need to restart your window manager every time you change your xterm defaults. Just open a new xterm.
  • All xterms look the same, regardless of how they were started. Sometimes I want to type xterm into a running xterm.
  • Setting resources through .Xresources is much saner than doing it with a hideously long commandline.
  • If you change one stupidly long commandline, you don't have to manually update a bunch of other stupidly long commandlines for consistency. I don't think I've ever seen a WM menu with only one flavor of xterm in it.
Читайте также  Как отключить установку обновлений на Windows 10?

The Debian Xsession(5) manpage says that .Xdefaults is a hangover from X10 and X11R1, and that it should be spelled .Xresources. On their system, you need to use xrdb to [re]load the resources file:

xrdb -merge ~/.Xresources

Rant: Desktop Environments

Konsole and gnome-terminal suck.

Matt Dillon wrote:

gnome is a good test. The gnome-terminal program is a medium-sized cpu hog(it uses four times the cpu that the pine program running under it uses)

And how the hell do you get a gnome-terminal to have a default geometry of 80×50 when it starts!?

Rant: 80 columns or bust

For a while, I spent some time in a 100×50 terminal because I had decided that only using 80 columns was anachronistic and unnecessarily limiting.

Later, after I'd come to my fucking senses, I had to work on some code that I had written to a width of 100 columns and I really badly wanted to go back in time and kick my own ass!

echo set bg=dark >> ~/.vimrc

Lately (2012), I've been using i3wm — a tiling window manager which resizes my terminals quite violently. Sadly, xterm loses its contents when its size is reduced, so I've been trying urxvt, which re-wraps the text. The relevant .Xresources:

URxvt.loginShell: trueURxvt.geometry: 80x50URxvt.saveLines: 10000URxvt.cutchars: «`\»'&()*,:;?[\\]{|}$»URxvt.foreground: rgb:a8/a8/a8URxvt.background: rgb:00/00/00URxvt.color0: rgb:00/00/00URxvt.color1: rgb:a8/00/00URxvt.color2: rgb:00/a8/00URxvt.color3: rgb:a8/54/00URxvt.color4: rgb:00/00/a8URxvt.color5: rgb:a8/00/a8URxvt.color6: rgb:00/a8/a8URxvt.color7: rgb:a8/a8/a8URxvt.color8: rgb:54/54/54URxvt.color9: rgb:fc/54/54URxvt.color10: rgb:54/fc/54URxvt.color11: rgb:fc/fc/54URxvt.color12: rgb:54/54/fcURxvt.color13: rgb:fc/54/fcURxvt.color14: rgb:54/fc/fcURxvt.color15: rgb:fc/fc/fcURxvt.colorBD: rgb:fc/fc/fcURxvt.font: terminus-12URxvt.italicFont: terminus-12URxvt.scrollBar: falseURxvt.visualBell: true// this is SO AWESOME:URxvt.fading: 15// URxvt spells «eightBitInput» as «meta8» and defaults it to false

Источник: https://unix4lyfe.org/xterm/

Настройка Xterm

Xterm Linux установка

XTerm, являясь самой популярной программой в среде Х, обладает несколькими замечательными возможностями, позволяя:

  • одновременно запускать несколько окон оболочки;
  • регулировать размер каждого окна xterm;
  • изменять размер и цвет шрифтов, используемых xterm;
  • выполнять операции копирования/вставки текста между окнами xterm и других программ X;
  • использовать полосу прокрутки для просмотра текста, находящегося за пределами окна.

XTerm не является эмулятором терминала; это окно оболочки .

Постоянно действующие параметры XTerm указываются, как правило, в файле ресурсов, а редко используемые параметры в командной строке.

Параметры командной строки

ПараметрНазначение
-bg Цвет фона (по умолчанию — белый)
-cr Цвет текстового курсора (по умолчанию — белый)
-display имя_узла:0 Подключение к Х серверу на данном узле
-e программа [аргументы] Вместо оболочки в окне запускается программа
-fg цвет Цвет текста (по умолчанию — черный)
-fn имя шрифта Выбор указанного шрифта
-geometry геометрия Выбор размеров и местонахождения окна
-ls Запуск оболочки в режиме регистрации
-sb Включение полосы прокрутки

Размеры окна XTerm

Размеры окна xterm проще всего регулируются с помощью параметра командной строки -geometry:

~$ xterm -geometry WidthxHeight

Значение Width соответствует ширине окна в символах, а значение Height — высоте окна (количеству строк).

Многие приложения X, поддерживая параметр -geometry, интерпретируют его как размер в пикселах.

В параметре -geometry можно также задать начальную позицию окна в пикселах:

~$ xterm -geometry WidthxHeight+X+Y

В данном случае X и Y определяют координаты левого верхнего угла окна программы в пикселах. Началом координат считается левый верхний угол экрана.

Как размеры (ширина и высота), так и координаты (X и Y) могут пропускаться.

Полоса прокрутки для XTerm

По умолчанию в окно xterm не включается полоса прокрутки. Для ее включения используется параметр командной строки -sb:

Средняя кнопка мыши осуществляет прокрутку к нужной позиции. Правая кнопка выполняет прокрутку назад, а левая — вперед.

Параметры командной строки могут быть и постоянными. В качестве примера привожу фрагмент меню fluxbox:

~ mcedit .fluxbox/menu… [exec] (xterm) {xterm -fg black -bg white -rightbar -fn 9×15 -geometry 100×40}…

Файл ресурсов X

Файлы ресурсов X предоставляют собой мощный механизм для настройки практически любого приложения X.

Для внесения в файл ресурсов всех необходимых параметров он может быть просто скопирован в домашний каталог и затем отредактирован:

~ copy /usr/X11/app-defaults/XTerm .

или просто создан:

Фрагмент содержимого файла XTerm:

~ less XTerm…XTerm*foreground: grayXTerm*background: blackXTerm*cursorColor: greenXTerm*scrollBar: TrueXTerm*saveLines: 800XTerm*font: -misc-fixed-medium-r-normal-*-15-140-75-75-c-90-iso10646-*XTerm*geometry: 103×46+0+17…

Здесь мной были выбраны: серый цвет шрифта, черный цвет фона, зеленый — курсора, полоса прокрутки, содержимое буфера в 800 строк, шрифт fixed для кодировки utf8, геометрия окна 103×46 символов, координаты 0, 17 px.

Программа xlsfonts

Программой xlsfonts можно вывести список всех доступных шрифтов:

~ xlsfonts | less-adobe-courier-bold-o-normal—0-0-100-100-m-0-iso10646-1-adobe-courier-bold-o-normal—0-0-100-100-m-0-iso8859-1-adobe-courier-bold-o-normal—0-0-100-100-m-0-iso8859-10-adobe-courier-bold-o-normal—0-0-100-100-m-0-iso8859-13-adobe-courier-bold-o-normal—0-0-100-100-m-0-iso8859-14-adobe-courier-bold-o-normal—0-0-100-100-m-0-iso8859-15-adobe-courier-bold-o-normal—0-0-100-100-m-0-iso8859-2-adobe-courier-bold-o-normal—0-0-100-100-m-0-iso8859-3-adobe-courier-bold-o-normal—0-0-100-100-m-0-iso8859-4-adobe-courier-bold-o-normal—0-0-100-100-m-0-iso8859-9-adobe-courier-bold-o-normal—0-0-75-75-m-0-iso10646-1-adobe-courier-bold-o-normal—0-0-75-75-m-0-iso8859-1-adobe-courier-bold-o-normal—0-0-75-75-m-0-iso8859-10-adobe-courier-bold-o-normal—0-0-75-75-m-0-iso8859-13-adobe-courier-bold-o-normal—0-0-75-75-m-0-iso8859-14-adobe-courier-bold-o-normal—0-0-75-75-m-0-iso8859-15-adobe-courier-bold-o-normal—0-0-75-75-m-0-iso8859-2-adobe-courier-bold-o-normal—0-0-75-75-m-0-iso8859-3-adobe-courier-bold-o-normal—0-0-75-75-m-0-iso8859-4-adobe-courier-bold-o-normal—0-0-75-75-m-0-iso8859-9-adobe-courier-bold-o-normal—10-100-75-75-m-60-iso10646-1-adobe-courier-bold-o-normal—10-100-75-75-m-60-iso10646-1-adobe-courier-bold-o-normal—10-100-75-75-m-60-iso8859-1-adobe-courier-bold-o-normal—10-100-75-75-m-60-iso8859-1-adobe-courier-bold-o-normal—10-100-75-75-m-60-iso8859-10-adobe-courier-bold-o-normal—10-100-75-75-m-60-iso8859-10-adobe-courier-bold-o-normal—10-100-75-75-m-60-iso8859-13-adobe-courier-bold-o-normal—10-100-75-75-m-60-iso8859-13-adobe-courier-bold-o-normal—10-100-75-75-m-60-iso8859-14-adobe-courier-bold-o-normal—10-100-75-75-m-60-iso8859-14-adobe-courier-bold-o-normal—10-100-75-75-m-60-iso8859-15-adobe-courier-bold-o-normal—10-100-75-75-m-60-iso8859-15-adobe-courier-bold-o-normal—10-100-75-75-m-60-iso8859-2-adobe-courier-bold-o-normal—10-100-75-75-m-60-iso8859-2-adobe-courier-bold-o-normal—10-100-75-75-m-60-iso8859-3-adobe-courier-bold-o-normal—10-100-75-75-m-60-iso8859-3-adobe-courier-bold-o-normal—10-100-75-75-m-60-iso8859-4lines 1-37

Для окна XTerm следует выбирать шрифт с фиксированной шириной символов (моноширинный), например Courier или Lucida.

В очень длинных именах моноширинных шрифтов обычно присутствует суффикс m или с.

Программа xfontsel

Для выбора шрифтов весьма удобна программа xfontsel:

Выбор параметров в ней рекомендую начинать с выбора кодировки, которая для utf8, например, будет следующей:

Далее выбирается шрифт с необходимыми параметрами:

Затем нажимается кнопка select

Теперь имя выбранного шрифта можно вставить в другое окно.

Цветной XTerm

Пример цветного XTerm:

Все настройки находятся в файлах: .bash_profile и .bashrc домашнего каталога.

Меню XTerm

По умолчанию у xterm отсутствует строка меню. Для получения доступа к одному трёх  меню xterm необходимо, удерживая клавишу Control, нажать левую (lb), среднюю (mb) или правую (rb) клавишу мыши. Пример:

Ctrl-mb

Ctrl-mb

Поддержку строки меню можно задать во время компиляции программы; в этом случае указанные выше меню будут доступны из строки меню.

Источник: http://www.linuxcookbook.ru/articles/nastroyka-xterm