Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #=====================================
- #
- # OpenBSD Install
- #
- #=====================================
- ### Installation ###
- ## pick shell:
- s
- ## wipe drive and clear the dead space:
- dd if=/dev/urandom of=/dev/rsd0c bs=1m
- ## encrypt the drive
- # create efi partition system:
- fdisk -iy -g -b 960 sd0
- # make one parition for the whole disk:
- disklabel -E sd0
- Label editor (enter '?' for help at any prompt)
- > a a
- offset: defaults
- size: defaults
- FS type: RAID
- > w
- > q
- No label changes.
- # encrypt drive:
- bioctl -c C -l sd0a softraid0
- # make device node and clear out first megabyte:
- cd /dev && sh MAKEDEV sd2
- dd if=/dev/zero of=/dev/rsd2c bs=1m count=1
- ## installer
- # start installer
- exit and choose installer:
- exit
- i
- # pick keyboard:
- US QWERTY
- # hostname:
- host
- # wireless:
- skip:
- done
- # DNS domain name:
- default
- # password for root:
- *type password*
- # start sshd:
- no
- # start the x window system by xenodm:
- yes
- # user setup:
- # setup a user: user
- # full name: User
- # password for user: *enter password*
- # which disk is the root disk:
- sd2
- # use whole disk with MBR or GPT:
- gtp
- # use auto layout
- a
- # location of sets:
- disk
- # Is the disk partition already mounted?:
- no
- # Which disk contains the install media? (or 'done'):
- sd1
- # Available sd1 partitions are:
- a
- # Which sd1 partition has the install sets? (or 'done')
- [a]
- # Pathname to the sets? (or 'done'):
- [6.4/amd64]
- # what timezone:
- UTC
- # reboot
- ### Post Installation ###
- ## login as root:
- username: root
- password: *enter root password*
- ## disable bell
- # ttys
- wsconsctl keyboard.bell.volume=0
- edit /etc/wsconsctl.conf:
- # disable bell
- keyboard.bell.volume=0
- # xorg
- echo 'xset b off' >> /etc/X11/xenodm/Xsetup_0
- ## network
- # setup with ethernet
- # find ethernet interface:
- ifconfig
- # setup ethernet:
- dhclient em0
- # get and install wifi firmware:
- fw_update
- # setup wifi card and find wifi:
- ifconfig iwn0 up
- ifconfig iwn0 scan
- # connect to wifi
- ifconfig iwn0 nwid YOUR_SSID wpakey "YOUR_PASSPHRASE"
- dhclient iwn0
- # create /etc/hostname.iwn0 with the following:
- vi /etc/hostname.iwn0:
- # add networks in order of priority, for example:
- # join "HOME_SSID" wpakey "HOME_PASSPHRASE"
- # join "WORK_SSID" wpakey "WORK_PASSPHRASE"
- # join "OPEN_COFFEE_SHOP"
- # home:
- join "SSID" wpakey "PASSPHRASE"
- dhcp
- inet6 autoconf
- up powersave
- # test changes:
- ifconfig em0 down
- ifconfig iwn0 down
- pkill dhclient
- sh /etc/netstart
- # if that doesn't work reboot
- # set usb mount directory and test usb mounting
- mkdir /mnt/usb
- chown user:user /mnt/usb
- mount -t msdos /dev/sd2i /mnt/usb
- # disable xconsole window from autostarting at each login:
- sed -i 's/xconsole/#xconsole/' /etc/X11/xenodm/Xsetup_0
- # remap keys
- ## map caps lock to esacpe key in tty:
- # tty
- vi /etc/wsconsctl.conf:
- keyboard.map+="keysym Caps_Lock = Escape"
- # set UTF-8 for tty:
- export LANG=en_US.UTF-8
- export LC_ALL=en_US.UTF-8
- # and add it to /etc/login.conf
- :charset=UTF-8:\
- :LANG=en_US.UTF-8:\
- :LC_ALL=en_US.UTF-8:
- # setup doas for user:
- echo 'permit persist keepenv user' > /etc/doas.conf
- # enable power managemnt options:
- rcctl enable apmd
- rcctl set apmd flags -A
- rcctl start apmd
- # add user to groups:
- usermod -G staff user
- usermod -G operator
- usermod -G games
- # change resource limits:
- vi /etc/login.conf:
- staff:\
- :datasize-cur=1024M:\
- :datasize-max=8192M:\
- :maxproc-cur=512:\
- :maxproc-max=1024:\
- :openfiles-cur=4096:\
- :openfiles-max=8192:\
- :stacksize-cur=32M:\
- :ignorenologin:\
- :requirehome@:\
- :tc=default:
- # bump up kernal sysctls:
- vi /etc/sysctl.conf:
- # shared memory limits
- kern.shminfo.shmall=3145728
- kern.shminfo.shmmax=2147483647
- kern.shminfo.shmmni=1024
- # semaphores
- kern.shminfo.shmseg=1024
- kern.seminfo.semmns=4096
- kern.seminfo.semmni=1024
- kern.maxproc=32768
- kern.maxfiles=65535
- kern.bufcachepercent=90
- kern.maxvnodes=262144
- kern.somaxconn=2048
- # lock screen automaticaly when you close the lid:
- # make the directory for apm:
- mkdir /etc/apm
- # Then, create the file /etc/apm/suspend with the following contents:
- #!/bin/sh
- pkill -USR1 xidle
- # And make it executable:
- chmod +x /etc/apm/suspend
- # turn off ntpd google check:
- sed -i '/google/d' /etc/ntpd.conf
- # restart ntpd:
- rcctl restart ntpd
- # change hostname:
- vi /etc/myname:
- host
- # exit and login as user
- # uninstall fvwm
- ## install ports tree
- # fetch the ports tree:
- cd /tmp
- ftp https://cdn.openbsd.org/pub/OpenBSD/$(uname -r)/{ports.tar.gz,SHA256.sig}
- signify -Cp /etc/signify/openbsd-$(uname -r | cut -c 1,3)-base.pub -x SHA256.sig ports.tar.gz
- # untar the ports tree in /usr/ports:
- cd /usr
- tar xzf /tmp/ports.tar.gz
- # configure ports:
- # vi /etc/mk.conf:
- WRKOBJDIR=/usr/obj/ports
- DISTDIR=/usr/distfiles
- PACKAGE_REPOSITORY=/usr/packages
- ## install programs
- # shell:
- ## zsh:
- doas pkg_add zsh
- # editor:
- ## neovim:
- doas pkg_add neovim
- # music and video:
- ## mpd:
- doas pkg_add mpd
- ## mpc:
- doas pkg_add mpc
- ## ncmpcpp:
- doas pkg_add ncmpcpp
- ## ncmpc:
- doas pkg_add ncmpc
- ## mpv:
- doas pkg_add mpv
- # network:
- ## tor:
- doas pkg_add tor
- # web browsing
- ## tor-browser:
- doas pkg_add tor-browser
- ## firefox:
- doas pkg_add firefox
- ## qutebrowser:
- doas pkg_add qutebrowser
- ## w3m:
- doas pkg_add w3m
- choice: (2)
- # file management:
- ## thunar:
- doas pkg_add thunar
- ## ranger:
- doas pkg_add ranger
- # utilities:
- ## feh:
- doas pkg_add feh
- ## dunst:
- doas pkg_add dunst
- ## tree:
- doas pkg_add tree
- ## scrot:
- doas pkg_add scrot
- ## neofetch:
- doas pkg_add neofetch
- ## htop:
- doas pkg_add htop
- ## wget:
- doas pkg_add wget
- ## git:
- doas pkg_add git
- ## gimp:
- doas pkg_add gimp
- ## transmission:
- doas pkg_add transmission
- ## unzip:
- doas pkg_add unzip
- choice (1)
- ## zathura:
- doas pkg_add zathura
- ## qemu:
- doas pkg_add qemu
- ## imagemagick:
- doas pkg_add ImageMagick
- # social media:
- ## pidgin:
- doas pkg_add pidgin
- choice (1)
- ## pidgin-otr:
- doas pkg_add pidgin-otr
- ## pidgin-libnotify:
- doas pkg_add pidgin-libnotify
- ## irssi:
- doas pkg_add irssi
- choice (2)
- ## irssi-otr:
- doas pkg_add irssi-otr
- ## neomutt:
- doas pkg_add neomutt
- choice (1)
- # programming
- ## ipython:
- doas pkg_add ipython
- ## py-virtualenv:
- doas pkg_add py-virtualenv
- ## py3-virtualenv:
- doas pkg_add py3-virtualenv
- ## py-pip:
- doas pkg_add py-pip
- ## py3-pip:
- doas pkg_add py3-pip
- # games
- ## wesnoth:
- doas pkg_add wesnoth
- ## 0ad:
- doas pkg_add 0ad
- ## minetest:
- doas pkg_add mintest
- ## nethack:
- doas pkg_add nethack
- choice (2)
- ## supertux:
- doas pkg_add supertux
- ## supertuxkart:
- doas pkg_add supertuxkart
- # terminal
- ## urxvt-unicode:
- doas pkg_add urxvt-unicode
- # fonts
- ## noto-fonts:
- doas pkg_add noto-fonts
- ## liberation-fonts:
- doas pkg_add liberation-fonts
- ## zh-fonts-arphicttf:
- doas pkg_add zh-fonts-arphicttf
- ## terminus-font:
- doas pkg_add terminus-font
- choice (1: terminus-font)
- ## p5-Locale-Hebrew:
- doas pkg_add p5-Locale-Hebrew
- ## migmix:
- doas pkg_add migmix
- ## migu:
- doas pkg_add migu
- ## ja-sazanami-ttf:
- doas pkg_add ja-sazanami-ttf
- ## vlgothic:
- doas pkg_add vlgothic
- ## hanazono:
- doas pkg_add hanazono
- ## anonymous-pro:
- doas pkg_add anonymous-pro
- ## artwiz-aleczapka:
- doas pkg_add artwiz-aleczapka
- ## inconsolata-font:
- doas pkg_add inconsolata-font
- ## cantarell-fonts:
- doas pkg_add cantarell-fonts
- ## doulos:
- doas pkg_add doulos
- ## ubuntu-fonts:
- doas pkg_add ubuntu-fonts
- ## junicode:
- doas pkg_add junicode
- ## charis:
- doas pkg_add charis
- ## gentium:
- doas pkg_add gentium
- ## powerline-fonts:
- doas pkg_add powerline-fonts
- # make a build directory:
- mkdir .builds
- # window manageer
- ## dwm
- cd .builds
- git clone git://git.suckless.org/dwm
- cd dwm
- # uncomment openbsd libs in config.mk:
- # OpenBSD (uncomment)
- FREETYPEINC = ${X11INC}/freetype2
- # build dwm:
- doas make clean install
- # application menu
- ## demenu
- cd .builds
- git clone git://git.suckless.org/dmenu
- cd dmenu
- # uncomment openbsd libs in config.mk:
- FREETYPEINC = ${X11INC}/freetype2
- # build dmenu:
- doas make clean install
- # make subdirecories and change shell:
- mkdir Documents Downloads Music Videos Pictures
- mkdir Pictures/.screenshots
- mkdir ~/.config
- doas mkdir /usr/local/share/backgrounds
- # change shell for user:
- chsh -s /usr/local/bin/zsh
- # move files to the right places:
- doas mv Fonts /usr/local/share/fonts
- doas mv wallpapers /usr/local/share/backgrounds
- ### Configurations ###
- ============================================================================================================================
- ## .xsession:
- vi ~/.xsessions
- #####################
- #
- # .xsession
- #
- #####################
- # use UTF-8 everywhere
- export LANG=en_US.UTF-8
- # specify location of .zshrc
- export ENV=$HOME/.zshrc
- # load .Xresources
- xrdb -merge $HOME/.Xresources
- # set background color
- xsetroot -solid back
- # enable scrolling with trackpoint and middle button
- xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation" 1
- xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Button" 2
- xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Axes" 6 7 4 5
- # remap caps lock to esacpe
- setxkbmap -option caps:escape
- # start dwm
- exec dwm
- ============================================================================================================================
- ## .Xresources:
- vi ~/.Xresources
- !!!!!!!!!!!!!!!!!!!!!!!!!!
- !
- ! .Xresources
- !
- !!!!!!!!!!!!!!!!!!!!!!!!!!
- ! to load .Xresources run:
- ! xrdb ~/.Xresources
- ! ===== fonts
- !to find which font is used as the fall back font for a specific character run:
- ! FC_DEBUG=4 pango-view -q -t '{character}' 2>&1 |\grep -o 'family: "[^"]\+' | cut -c 10- | tail -n 1
- !to find the name of a font:
- ! fc-list -v | grep *name*
- Xft.autohint : 0
- Xft.lcdfilter : lcddefault
- Xft.hintstyle : hintslight
- Xft.hinting : 1
- Xft.antialias : 1
- Xft.rgba : rgb
- *font : Terminus (TTF):size=9
- ! ===== urxvt:
- ! fonts
- URxvt.font: xft:Terminus (TTF):size=9, xft:Noto Sans Devanagari:9, xft:Noto Emoji, xft:DejaVu Serif, xft:Noto Sans Kannada
- ! scrollbar
- URxvt.scrollBar: false
- ! transparency
- URxvt.depth: 32
- URxvt.background: [95]#000000
- ! fading
- URxvt*fading: 30
- ! cursor
- URxvt*cursorUnderline: true
- URxvt*cursorBlink: true
- URxvt*cursorColor: #FF0099
- !! theme
- !background color
- URxvt*background: #000000
- ! font color
- URxvt*foreground: #67C8FF
- ! other colors
- URxvt*color0: #000000
- URxvt*color1: #FF0000
- URxvt*color2: #67C8FF
- URxvt*color3: #FF1493
- URxvt*color4: #099FFF
- URxvt*color5: #CC00FF
- URxvt*color6: #099FFF
- URxvt*color7: #820571
- URxvt*color8: #45013C
- URxvt*color9: #099FFF
- URxvt*color10: #FF0099
- URxvt*color11: #E6FB04
- URxvt*color12: #9400D3
- URxvt*color13: #DB329D
- URxvt*color14: #9400D3
- URxvt*color15: #FF0099
- URxvt*underlineColor: #FF34B3
- URxvt*highlightColor: #191970
- URxvt*highlightTextColor: #EE00EE
- !! extensions
- !fullscreen
- URxvt.perl-ext-common: fullscreen
- URxvt.keysym.F11: perl:fullscreen:switch
- ! ===== xterm
- !! theme
- XTerm*background : #000000
- XTerm*foreground : #67C8FF
- XTerm*cursorColor : #FF0099
- XTerm*colorUL : #366060
- XTerm*underlineColor : #FF34B3
- XTerm*color0 : #000000
- XTerm*color1 : #FF0000
- XTerm*color2 : #67C8FF
- XTerm*color3 : #FF1493
- XTerm*color4 : #099FFF
- XTerm*color5 : #CC00FF
- XTerm*color6 : #099FFF
- XTerm*color7 : #820571
- XTerm*color8 : #45013C
- XTerm*color9 : #099FFF
- XTerm*color10 : #FF0099
- XTerm*color11 : #E6FB04
- XTerm*color12 : #9400D3
- XTerm*color13 : #DB329D
- XTerm*color14 : #9400D3
- XTerm*color15 : #FF0099
- ! remove the additional black border
- XTerm*borderWidth : 0
- XTerm*internalBorder : 2
- ! set TERM env variable to use 256 colors
- XTerm*termName : xterm-256color
- ! make alt key work normally
- XTerm*vt100.metaSendsEscape : true
- ! save ~10,000 lines of scrollback
- XTerm*v100.saveLines : 10240
- ! hide scrollbar
- XTerm*vt100.scrollBar : false
- ! some black magic to change what characters XTerm considers "word delimiters"
- XTerm*charClass : 33:48,36-47:48,58-59:48,61:48,63-64:48,95:48,126:48
- ============================================================================================================================
- ## dwm (config.def.h)
- /* See LICENSE file for copyright and license details. */
- /* appearance */
- static const unsigned int borderpx = 1; /* border pixel of windows */
- static const unsigned int snap = 32; /* snap pixel */
- static const int showbar = 1; /* 0 means no bar */
- static const int topbar = 1; /* 0 means bottom bar */
- static const char *fonts[] = { "Sparkles:size=9" };
- static const char dmenufont[] = "Terminus (TTF):size=10";
- static const char col_black1[] = "#000000";
- static const char col_gray2[] = "#444444";
- static const char col_gray3[] = "#bbbbbb";
- static const char col_gray4[] = "#eeeeee";
- static const char col_cyan[] = "#005577";
- static const char *colors[][3] = {
- /* fg bg border */
- [SchemeNorm] = { col_gray3, col_black1, col_gray2 },
- [SchemeSel] = { col_gray4, col_cyan, col_cyan },
- };
- /* tagging */
- static const char *tags[] = { "零", "一", "二", "三", "四", "五", " 六", "七", "八" };
- static const Rule rules[] = {
- /* xprop(1):
- * WM_CLASS(STRING) = instance, class
- * WM_NAME(STRING) = title
- */
- /* class instance title tags mask isfloating monitor */
- { "Gimp", NULL, NULL, 0, 1, -1 },
- { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
- };
- /* layout(s) */
- static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
- static const int nmaster = 1; /* number of clients in master area */
- static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
- static const Layout layouts[] = {
- /* symbol arrange function */
- { "[]=", tile }, /* first entry is default */
- { "><>", NULL }, /* no layout function means floating behavior */
- { "[M]", monocle },
- };
- /* key definitions */
- #define MODKEY Mod1Mask
- #define TAGKEYS(KEY,TAG) \
- { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
- { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
- { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
- { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
- /* helper for spawning shell commands in the pre dwm-5.0 fashion */
- #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
- /* commands */
- static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
- static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_black1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
- static const char *termcmd[] = { "st", NULL };
- static Key keys[] = {
- /* modifier key function argument */
- { MODKEY, XK_p, spawn, {.v = dmenucmd } },
- { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
- { MODKEY, XK_b, togglebar, {0} },
- { MODKEY, XK_j, focusstack, {.i = +1 } },
- { MODKEY, XK_k, focusstack, {.i = -1 } },
- { MODKEY, XK_i, incnmaster, {.i = +1 } },
- { MODKEY, XK_d, incnmaster, {.i = -1 } },
- { MODKEY, XK_h, setmfact, {.f = -0.05} },
- { MODKEY, XK_l, setmfact, {.f = +0.05} },
- { MODKEY, XK_Return, zoom, {0} },
- { MODKEY, XK_Tab, view, {0} },
- { MODKEY|ShiftMask, XK_c, killclient, {0} },
- { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
- { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
- { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
- { MODKEY, XK_space, setlayout, {0} },
- { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
- { MODKEY, XK_0, view, {.ui = ~0 } },
- { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
- { MODKEY, XK_comma, focusmon, {.i = -1 } },
- { MODKEY, XK_period, focusmon, {.i = +1 } },
- { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
- { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
- TAGKEYS( XK_1, 0)
- TAGKEYS( XK_2, 1)
- TAGKEYS( XK_3, 2)
- TAGKEYS( XK_4, 3)
- TAGKEYS( XK_5, 4)
- TAGKEYS( XK_6, 5)
- TAGKEYS( XK_7, 6)
- TAGKEYS( XK_8, 7)
- TAGKEYS( XK_9, 8)
- { MODKEY|ShiftMask, XK_q, quit, {0} },
- };
- /* button definitions */
- /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
- static Button buttons[] = {
- /* click event mask button function argument */
- { ClkLtSymbol, 0, Button1, setlayout, {0} },
- { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
- { ClkWinTitle, 0, Button2, zoom, {0} },
- { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
- { ClkClientWin, MODKEY, Button1, movemouse, {0} },
- { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
- { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
- { ClkTagBar, 0, Button1, view, {0} },
- { ClkTagBar, 0, Button3, toggleview, {0} },
- { ClkTagBar, MODKEY, Button1, tag, {0} },
- { ClkTagBar, MODKEY, Button3, toggletag, {0} },
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement