DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 4 Weeks Ago
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
 
Join Date: Oct 2013
Location: EST USA
Posts: 267
Default Your OpenBSD shell setup

How about a thread where we show off our shell configuration dot files? It might be a nice resource; I certainly find myself reinventing the wheel each time I come back to a shell (or an OS) that I haven't used in a while.

So how do you folks have your shells and terminals set up? Strut your stuff.
Reply With Quote
  #2   (View Single Post)  
Old 4 Weeks Ago
ibara's Avatar
ibara ibara is offline
WR Slowest SNOBOL4 laptop
 
Join Date: Jan 2014
Posts: 515
Default

I'm simple:
Code:
xterm -bg black fg white -fa Inconsolata-10 +sb
I keep an extremely simple ksh .profile. So simple, I have no qualms including it in my portable version of OpenBSD ksh:
https://github.com/ibara/oksh/blob/master/profile

With the PS1 line uncommented and the bind -m line removed.

And tmux(1) always running. Literally with the defaults. Like I said, I'm simple.
Reply With Quote
  #3   (View Single Post)  
Old 4 Weeks Ago
Head_on_a_Stick's Avatar
Head_on_a_Stick Head_on_a_Stick is offline
Real Name: Matthew
Mostly Harmless
 
Join Date: Dec 2015
Location: London
Posts: 73
Default

~/.kshrc:
Code:
. /etc/ksh.kshrc
alias su='/usr/bin/su'
alias doas='/usr/bin/doas'
alias passwd='/usr/bin/passwd'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
set -o emacs
PS1='\h: \w \[\033[01;31m\]${?#0}\[\033[00m\]\$ ' 
alias tcp='doas tcpdump -o -a -q -i iwn0'
alias tcpe='doas tcpdump -o -a -q -i em0'
alias pfmon='doas tcpdump -nei pflog0'
~/.Xdefaults:
Code:
XTerm*vt100.cursorBlink:        true
XTerm*vt100.faceName:           monospace:pixelsize=10
XTerm*vt100.allowBoldFonts:     false
XTerm*vt100.scrollBar:          false
XTerm*vt100.cursorUnderLine:    true

! *customization: -color

! BunsenLabs colours

*.foreground: #bfbfbf
*.background: #2e3436

! Black
*.color0: #000000
*.color8: #666666

! Red
*.color1: #9e1828
*.color9: #cf6171

! Green
*.color2: #aece92
*.color10: #c5f779

! Yellow
*.color3: #968a38
*.color11: #fff796

! Blue
*.color4: #414171
*.color12: #4186be

! Magenta
*.color5: #963c59
*.color13: #cf9ebe

!Cyan
*.color6: #418179
*.color14: #71bebe

! White
*.color7: #bebebe
*.color15: #ffffff

*.cursorColor:  #00ff00
I've also added these lines to ~/.profile:
Code:
case "$KSH_VERSION" in
        *MIRBSD*) ;;
        *) export ENV="$HOME/.kshrc" ;;
esac

export PAGER=most
export EDITOR='9 ed'
export VISUAL=vim
export BROWSER=chrome

[ "$(tty)" = "/dev/ttyC0" ] && exec xinit -- -nolisten tcp -tst

print
9 fortune
print
I use the supplied mkshrc example when using that shell, along with my trivial aliases.
__________________
Linux is for people who hate Windows. BSD is for people who love UNIX.

Last edited by Head_on_a_Stick; 4 Weeks Ago at 05:56 AM. Reason: changed $BROWSER
Reply With Quote
  #4   (View Single Post)  
Old 4 Weeks Ago
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
 
Join Date: Oct 2013
Location: EST USA
Posts: 267
Default

Quote:
Originally Posted by Head_on_a_Stick View Post
[snip] I've also added these lines to ~/.profile: [snip]
From the ksh man page: If VISUAL is set, it overrides EDITOR.
I don't know if that will be helpful, just FYI.

I am still tinkering with my setup but this is the current state:

~/.profile
Code:
PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games:.
export PATH HOME TERM
export VISUAL=emacs
export HISTFILE=$HOME/.ksh_history
export HISTSIZE=1000
export ENV=$HOME/.kshrc
~/.kshrc
Code:
. /etc/ksh.kshrc
alias ls="ls -F"
alias la="ls -a"
alias ll="ls -lrt"
~/.tmux.conf
Code:
set -g history-limit 2000
set-option -g status-bg white
set-option -g status-fg black
new-session -n $HOST
set -g status-right-length 44
set -g status-right '#H #(date +"%Y-%m-%d %a %H:%M")'
~/.xsession
Code:
export ENV=$HOME/.kshrc
xset +fp /usr/local/share/fonts/freefont
xset +fp /usr/local/share/fonts/Liberation
xset +fp /usr/local/share/fonts/linuxlibertine
xset +fp /usr/local/share/fonts/terminus
xset +fp /usr/local/share/fonts/ubuntu
xset +fp /usr/local/share/fonts/ghostscript
xset -b &
xset b off &
xsetroot -solid grey20 &
dwm
~/.Xdefaults
Code:
XTerm*loginShell:true
XTerm*vt100.faceName:           terminus:pixelsize=14
XTerm*vt100.scrollBar:          false
*.foreground: #bbbbbb
*.background: #222222
/etc/X11/xenodm/Xsetup_0
Code:
if [ "$DISPLAY" = ":0" -o "$DISPLAY" = ":0.0" ]
then
#       xconsole -geometry 480x130-0-0 -daemon -notify -verbose -fn fixed -exitOnFail
        xsetroot -solid grey20
fi
A goofy problem I currently have is that the shell prompt in xterms is different from the prompt in ssh sessions. I guess if I want a uniform prompt across the various use cases then relying on [the default] /etc/ksh.kshrc isn't the way to go...

Last edited by hanzer; 4 Weeks Ago at 06:09 PM.
Reply With Quote
  #5   (View Single Post)  
Old 4 Weeks Ago
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
 
Join Date: Oct 2013
Location: EST USA
Posts: 267
Default

Quote:
Originally Posted by hanzer View Post
[snip]
A goofy problem I currently have is that the shell prompt in xterms is different from the prompt in ssh sessions. I guess if I want a uniform prompt across the various use cases then relying on [the default] /etc/ksh.kshrc isn't the way to go...
This tweak solves the problem:
~/.kshrc
Code:
. /etc/ksh.kshrc
PS1='$USER@$HOST:$PWD:! '"$PS1S"
alias ls="ls -F"
alias la="ls -a"
alias ll="ls -alrt"
Reply With Quote
  #6   (View Single Post)  
Old 4 Weeks Ago
Head_on_a_Stick's Avatar
Head_on_a_Stick Head_on_a_Stick is offline
Real Name: Matthew
Mostly Harmless
 
Join Date: Dec 2015
Location: London
Posts: 73
Default

Quote:
Originally Posted by hanzer View Post
From the ksh man page: If VISUAL is set, it overrides EDITOR.
Thanks but it seems to "stick" for my desktop:
Code:
Puffy: ~ $ echo $EDITOR
9 ed
Puffy: ~ $ echo $VISUAL 
vim
Puffy: ~ $ doas vipw
4607
Also, I forgot my ~/.xinitrc:
Code:
synclient vertedgescroll=1 verttwofingerscroll=0 horizedgescroll=1 horizscrolldelta=10
xset s 300 -dpms
until false; do xsetroot -name "Battery: $(apm -l)%  •  $(date +"%Y-%m-%d  •  %H:%M")"; sleep 60; done &
xsetroot -solid "#2e3436"
exec dwm
No display manager for me
__________________
Linux is for people who hate Windows. BSD is for people who love UNIX.
Reply With Quote
  #7   (View Single Post)  
Old 4 Weeks Ago
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
 
Join Date: Oct 2013
Location: EST USA
Posts: 267
Default

Quote:
Originally Posted by Head_on_a_Stick View Post
Thanks but it seems to "stick" for my desktop:
Uh oh, these EDITOR/VISUAL variables might be one of those funky legacy backwater entanglement kind of things.

Hmm, I want emacs-mode for ksh command completion and command-line editing (use the arrow keys to move the cursor on the command-line and scroll through command history), but I want to specify vi to an application program that uses an environment variable to determine which editor to launch. How would that be done? Ref: stackexchange

Quote:
Originally Posted by Head_on_a_Stick View Post
No display manager for me
Cool. I would also prefer that configuration but the USB mouse disconnects almost immediately if X isn't running. To get it to reconnect, I have unplug it, wait at least ten seconds then plug it back in. I take it you don't have this problem?
Reply With Quote
  #8   (View Single Post)  
Old 4 Weeks Ago
Head_on_a_Stick's Avatar
Head_on_a_Stick Head_on_a_Stick is offline
Real Name: Matthew
Mostly Harmless
 
Join Date: Dec 2015
Location: London
Posts: 73
Default

Quote:
Originally Posted by hanzer View Post
I want emacs-mode for ksh command completion and command-line editing (use the arrow keys to move the cursor on the command-line and scroll through command history), but I want to specify vi to an application program that uses an environment variable to determine which editor to launch. How would that be done?
Export EDITOR=vi in ~/.profile and add this line to ~/.kshrc:
Code:
set -o emacs
Quote:
the USB mouse disconnects almost immediately if X isn't running. To get it to reconnect, I have unplug it, wait at least ten seconds then plug it back in. I take it you don't have this problem?
No, my hardware (ThinkPad X201) performs impeccably under OpenBSD and this mouse works fine and does not disconnect in the TTY:
Code:
uhidev0 at uhub3 port 2 configuration 1 interface 0 "PixArt Microsoft USB Optical Mouse" rev 1.10/1.00 addr 3
uhidev0: iclass 3/1
ums0 at uhidev0: 3 buttons, Z dir
wsmouse2 at ums0 mux 0
And to keep this on topic, here is my font configuration, this determines what is used for the "monospace" alias in ~/.Xdefaults:
Code:
Puffy: ~ $ cat /home/empty/.config/fontconfig/fonts.conf  
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <match target="font">
  <edit mode="assign" name="rgba">
   <const>rgb</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="hinting">
   <bool>true</bool>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="hintstyle">
   <const>hintslight</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="antialias">
   <bool>true</bool>
  </edit>
 </match>
  <match target="font">
    <edit mode="assign" name="lcdfilter">
      <const>lcddefault</const>
    </edit>
  </match>
  <alias>
    <family>monospace</family>
    <prefer><family>Dina</family></prefer>
  </alias>
  <alias>
    <family>serif</family>
    <prefer><family>Luxi Serif</family></prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer><family>Luxi Sans</family></prefer>
  </alias>
</fontconfig>
Puffy: ~ $
Which gives:
Code:
Puffy: ~ $ for f in monospace sans-serif serif; do fc-match $f; done
DinaMedium10.pcf.gz: "Dina" "Regular"
luxisr.ttf: "Luxi Sans" "Regular"
luxirr.ttf: "Luxi Serif" "Regular"
Puffy: ~ $
That's fonts/dina-fonts, I prefer bitmapped fonts in the terminal — it just seems more honest somehow.
__________________
Linux is for people who hate Windows. BSD is for people who love UNIX.

Last edited by Head_on_a_Stick; 4 Weeks Ago at 06:16 AM. Reason: corrected link to port, I can't remember the tags, sorry
Reply With Quote
  #9   (View Single Post)  
Old 4 Weeks Ago
frcc frcc is offline
Don't Worry Be Happy!
 
Join Date: Jul 2011
Location: hot,dry,dusty,rainy,windy,straight winds, tornado,puts the fear of God in you-Texas
Posts: 122
Default

Ibara
I run the same with -fg green -bg black and a font size of 12

Last edited by frcc; 4 Weeks Ago at 12:34 PM. Reason: point response
Reply With Quote
Old 4 Weeks Ago
bsd-keith bsd-keith is offline
Real Name: Keith
Open Source Software user
 
Join Date: Jun 2014
Location: Surrey/Hants Border, England
Posts: 138
Default

Never really thought about altering things - I tend to use it as it comes.
__________________
Linux since 1999, & now an OpenBSD user.
Reply With Quote
Old 4 Weeks Ago
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
 
Join Date: Oct 2013
Location: EST USA
Posts: 267
Default

Quote:
Originally Posted by Head_on_a_Stick View Post
Export EDITOR=vi in ~/.profile and add this line to ~/.kshrc: set -o emacs
Done. Thanks!
Quote:
Originally Posted by Head_on_a_Stick View Post
No, my hardware (ThinkPad X201) performs impeccably under OpenBSD and this mouse works fine and does not disconnect in the TTY:
Well Hello Mr. Fancy Pants! <smirk>
Quote:
Originally Posted by Head_on_a_Stick View Post
That's fonts/dina-fonts, I prefer bitmapped fonts in the terminal — it just seems more honest somehow.
Wow, there are some dedicated old-school enthusiasts here. A friend once recovered a mini serial terminal from a dumpster and had it connected to a FreeBSD machine. I thought that was so slick that I looked for something similar on ebay but found nothing and eventually lost interest...

Last edited by hanzer; 4 Weeks Ago at 09:27 PM. Reason: make grammer and speling more good ;)
Reply With Quote
Old 4 Weeks Ago
ibara's Avatar
ibara ibara is offline
WR Slowest SNOBOL4 laptop
 
Join Date: Jan 2014
Posts: 515
Default

Quote:
Originally Posted by hanzer View Post
Wow, there are some dedicated old-school enthusiasts here. A friend once recovered a mini serial terminal from a dumpster and had it connected to a FreeBSD machine. I thought that was so slick that I looked for something similar on ebay but found nothing and eventually lost interest...
My Wyse-60 still gets plenty of use
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenBSD Router & Wireless AP setup chigurh OpenBSD General 14 7th April 2015 06:56 PM
OpenBSD Multiple VPN Setup Dr-D OpenBSD Security 10 7th April 2014 10:50 AM
OpenBSD VPN Setup Dr-D OpenBSD Security 2 4th April 2014 01:23 PM
OpenBSD how to start (basic setup) wesley Guides 4 18th July 2012 06:29 PM
how setup arpwatch for OpenBSD mfaridi OpenBSD Packages and Ports 1 11th December 2008 05:22 PM


All times are GMT. The time now is 12:18 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick