User Tools

Site Tools


terminal

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
terminal [2017/01/14 02:26] adminterminal [2020/10/14 18:05] (current) admin
Line 2: Line 2:
  
 This has taken me 34 years to finally get right! This has taken me 34 years to finally get right!
 +
 +EDIT: add a couple of years and now it's kitty on wayland. Notwithstanding this, my journey:
  
 My path to termit (OK, a crap name): My path to termit (OK, a crap name):
  
   * xterm in the eighties - it was what we had and life was good   * xterm in the eighties - it was what we had and life was good
- 
   * rxvt in the nineties - it was lighter when it really counted   * rxvt in the nineties - it was lighter when it really counted
- 
   * urxvt/mrxvt in the noughties - it was cooler and I forget why else - it's prettier (no more bitmap fonts)   * urxvt/mrxvt in the noughties - it was cooler and I forget why else - it's prettier (no more bitmap fonts)
- 
   * konsole in the (what to call them?) teens - has tabs, menus, search, unlimited scrollback   * konsole in the (what to call them?) teens - has tabs, menus, search, unlimited scrollback
  
Line 16: Line 15:
  
   * it bloats, often taking up 10% of CPU while dormant   * it bloats, often taking up 10% of CPU while dormant
- 
   * it gives up focus when Alt is pressed - and my thumb can't resist the Alt key   * it gives up focus when Alt is pressed - and my thumb can't resist the Alt key
- 
   * it refuses to pass C-S-Left/Right to bash and I love to tie that to shell-forward-word to skip over long filenames   * it refuses to pass C-S-Left/Right to bash and I love to tie that to shell-forward-word to skip over long filenames
  
Line 24: Line 21:
  
 termit just sails past all of the problems with konsole (although the configuration took me a week to get just right). And sensibly, it can map C-Tab and C-S-Tab to next/prev tab - something gnome-terminal, xfce-term, lxterminal etc just cannot do. termit just sails past all of the problems with konsole (although the configuration took me a week to get just right). And sensibly, it can map C-Tab and C-S-Tab to next/prev tab - something gnome-terminal, xfce-term, lxterminal etc just cannot do.
- 
-Here's my config (put it into ~/.config/lilyterm/default.conf):  
- 
-Enjoy! 
  
 For the record I tried heaps including: For the record I tried heaps including:
Line 34: Line 27:
 Also see this ancient 2004 article which really needs an update: Also see this ancient 2004 article which really needs an update:
 The Grumpy Editor's guide to terminal emulators - https://lwn.net/Articles/88161/ The Grumpy Editor's guide to terminal emulators - https://lwn.net/Articles/88161/
 +
 +Here's my config (put it into ~/.config/termit/rc.lua): 
 +
 +  function notify (url, msg)
 +      os.execute("notify-send '"..url.."' "..msg)
 +  end
 +  
 +  function handle_url_simple_copy (url)
 +      -- simply copies the url
 +      -- requires package xclip
 +  
 +      local url = string.gsub(url,"\n.+$", "")
 +      os.execute ("echo -n '"..url.."' | xclip -i -selection clipboard &")
 +      -- notify (url, "copied") - hangs when run with VMWare!
 +  end
 +  
 +  function handle_url_simple_open (url)
 +      -- simply opens the url
 +      -- requires package xdg-utils
 +  
 +      local url = string.gsub(url,"\n.+$", "")
 +      os.execute ("xdg-open '"..url.."' &")
 +      notify (url, "opened")
 +  end
 +  
 +  function handle_url_zenity (url)
 +      -- pops up a dialog to allow choice of copying or opening the url
 +      -- requires package zenity and the termit-zenity-dialog script
 +  
 +      local url = string.gsub(url,"\n.+$", "")
 +      os.execute("termit-zenity-dialog '"..url.."' &") -- make it async otherwise this termit waits
 +  end
 +  
 +  function handle_url_lgi (url)
 +      -- pops up a dialog to allow choice of copying or opening the url
 +      -- also allows editing of the url before copying/opening
 +      -- requires package lua-lgi and the termit-lgi-dialog script
 +  
 +      local url = string.gsub(url,"\n.+$", "")
 +      os.execute("termit-lgi-dialog '"..url.."' &") -- make it async otherwise this termit waits
 +  end
 +  
 +  defaults = {}
 +  defaults.windowTitle = 'Termit'
 +  defaults.tabName = 'Terminal'
 +  defaults.encoding = 'UTF-8'
 +  defaults.wordChars = '+-AA-Za-z0-9,./?%&#:_~'
 +  defaults.scrollbackLines = 4096
 +  defaults.font = 'Monospace 10'
 +  defaults.geometry = '80x24'
 +  defaults.hideSingleTab = false
 +  defaults.showScrollbar = true
 +  defaults.fillTabbar = false
 +  defaults.hideMenubar = true
 +  defaults.allowChangingTitle = true
 +  defaults.visibleBell = false
 +  defaults.audibleBell = false
 +  defaults.urgencyOnBell = false
 +  defaults.matches = {['https*://[^ \'\"]+'] = handle_url_simple_copy } -- choose one of the above
 +  defaults.foregroundColor = 'white'
 +  defaults.backgroundColor = 'black'
 +  
 +  setOptions(defaults)
 +  
 +  function get_primary()
 +      -- os.execute ("xvkbd -text '\\m2' || xdotool click 2")
 +      os.execute ("xdotool click 2")
 +  end
 +  
 +  function changeTabFontSize(delta)
 +      tab = tabs[currentTabIndex()]
 +      setTabFont(string.sub(tab.font, 1, string.find(tab.font, '[0-9.]+$') - 1)..(tab.fontSize + delta))
 +  end
 +  
 +  bindKey('Ctrl-t', nil) -- needed for bash - swap chars
 +  bindKey('CtrlShift-t', openTab)
 +  bindKey('CtrlShift-Tab', prevTab)
 +  bindKey('Ctrl-Tab', nextTab)
 +  bindKey('CtrlShift-f', toggleMenubar)
 +  bindKey('CtrlShift-g', toggleTabbar)
 +  bindKey('CtrlShift-v', paste)
 +  bindKey('CtrlShift-c', copy)
 +  bindKey('Shift-Delete', copy)
 +  bindKey('Ctrl-Insert', copy)
 +  bindKey('Shift-Insert', function() get_primary() end)
 +  bindKey('Ctrl-F1', function () activateTab(1) end)
 +  bindKey('Ctrl-F2', function () activateTab(2) end)
 +  bindKey('Ctrl-F3', function () activateTab(3) end)
 +  bindKey('Ctrl-F4', function () activateTab(4) end)
 +  bindKey('Ctrl-F5', function () activateTab(5) end)
 +  bindKey('Ctrl-F6', function () activateTab(6) end)
 +  bindKey('Ctrl-F7', function () activateTab(7) end)
 +  bindKey('Ctrl-F8', function () activateTab(8) end)
 +  bindKey('Ctrl-F9', function () activateTab(9) end)
 +  
 +  bindKey('CtrlShift-equal', function () changeTabFontSize(1) end)
 +  bindKey('Ctrl-equal', function () changeTabFontSize(1) end)
 +  bindKey('Ctrl-minus', function () changeTabFontSize(-1) end)
 +  bindKey('Ctrl-0', function () setTabFont(defaults.font) end)
 +  
 +  setKbPolicy('keycode')
 +  
  
terminal.1484386000.txt.gz · Last modified: 2017/01/14 02:26 by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki