Advertisement
Guest User

Untitled

a guest
Nov 21st, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.64 KB | None | 0 0
  1. #=====================================
  2. #
  3. # OpenBSD Install
  4. #
  5. #=====================================
  6.  
  7. ### Installation ###
  8.  
  9. ## pick shell:
  10.  
  11. s
  12.  
  13. ## wipe drive and clear the dead space:
  14.  
  15. dd if=/dev/urandom of=/dev/rsd0c bs=1m
  16.  
  17. ## encrypt the drive
  18.  
  19. # create efi partition system:
  20.  
  21. fdisk -iy -g -b 960 sd0
  22.  
  23. # make one parition for the whole disk:
  24.  
  25. disklabel -E sd0
  26.  
  27. Label editor (enter '?' for help at any prompt)
  28.  
  29. > a a
  30.  
  31. offset: defaults
  32.  
  33. size: defaults
  34.  
  35. FS type: RAID
  36.  
  37. > w
  38.  
  39. > q
  40.  
  41. No label changes.
  42.  
  43. # encrypt drive:
  44.  
  45. bioctl -c C -l sd0a softraid0
  46.  
  47. # make device node and clear out first megabyte:
  48.  
  49. cd /dev && sh MAKEDEV sd2
  50. dd if=/dev/zero of=/dev/rsd2c bs=1m count=1
  51.  
  52. ## installer
  53.  
  54. # start installer
  55.  
  56. exit and choose installer:
  57.  
  58. exit
  59.  
  60. i
  61.  
  62. # pick keyboard:
  63.  
  64. US QWERTY
  65.  
  66. # hostname:
  67.  
  68. host
  69.  
  70. # wireless:
  71.  
  72. skip:
  73. done
  74.  
  75. # DNS domain name:
  76.  
  77. default
  78.  
  79. # password for root:
  80.  
  81. *type password*
  82.  
  83. # start sshd:
  84.  
  85. no
  86.  
  87. # start the x window system by xenodm:
  88.  
  89. yes
  90.  
  91. # user setup:
  92.  
  93. # setup a user: user
  94.  
  95. # full name: User
  96.  
  97. # password for user: *enter password*
  98.  
  99. # which disk is the root disk:
  100.  
  101. sd2
  102.  
  103. # use whole disk with MBR or GPT:
  104.  
  105. gtp
  106.  
  107. # use auto layout
  108.  
  109. a
  110.  
  111. # location of sets:
  112.  
  113. disk
  114.  
  115. # Is the disk partition already mounted?:
  116.  
  117. no
  118.  
  119. # Which disk contains the install media? (or 'done'):
  120.  
  121. sd1
  122.  
  123. # Available sd1 partitions are:
  124.  
  125. a
  126.  
  127. # Which sd1 partition has the install sets? (or 'done')
  128.  
  129. [a]
  130.  
  131. # Pathname to the sets? (or 'done'):
  132.  
  133. [6.4/amd64]
  134.  
  135. # what timezone:
  136.  
  137. UTC
  138.  
  139. # reboot
  140.  
  141. ### Post Installation ###
  142.  
  143. ## login as root:
  144.  
  145. username: root
  146.  
  147. password: *enter root password*
  148.  
  149. ## disable bell
  150.  
  151. # ttys
  152. wsconsctl keyboard.bell.volume=0
  153.  
  154. edit /etc/wsconsctl.conf:
  155. # disable bell
  156. keyboard.bell.volume=0
  157.  
  158. # xorg
  159.  
  160. echo 'xset b off' >> /etc/X11/xenodm/Xsetup_0
  161.  
  162. ## network
  163.  
  164. # setup with ethernet
  165.  
  166. # find ethernet interface:
  167.  
  168. ifconfig
  169.  
  170. # setup ethernet:
  171.  
  172. dhclient em0
  173.  
  174. # get and install wifi firmware:
  175.  
  176. fw_update
  177.  
  178. # setup wifi card and find wifi:
  179.  
  180. ifconfig iwn0 up
  181.  
  182. ifconfig iwn0 scan
  183.  
  184. # connect to wifi
  185.  
  186. ifconfig iwn0 nwid YOUR_SSID wpakey "YOUR_PASSPHRASE"
  187.  
  188. dhclient iwn0
  189.  
  190. # create /etc/hostname.iwn0 with the following:
  191.  
  192. vi /etc/hostname.iwn0:
  193.  
  194. # add networks in order of priority, for example:
  195.  
  196. # join "HOME_SSID" wpakey "HOME_PASSPHRASE"
  197.  
  198. # join "WORK_SSID" wpakey "WORK_PASSPHRASE"
  199.  
  200. # join "OPEN_COFFEE_SHOP"
  201.  
  202. # home:
  203.  
  204. join "SSID" wpakey "PASSPHRASE"
  205.  
  206. dhcp
  207.  
  208. inet6 autoconf
  209.  
  210. up powersave
  211.  
  212. # test changes:
  213.  
  214. ifconfig em0 down
  215.  
  216. ifconfig iwn0 down
  217.  
  218. pkill dhclient
  219.  
  220. sh /etc/netstart
  221.  
  222. # if that doesn't work reboot
  223.  
  224. # set usb mount directory and test usb mounting
  225. mkdir /mnt/usb
  226.  
  227. chown user:user /mnt/usb
  228.  
  229. mount -t msdos /dev/sd2i /mnt/usb
  230.  
  231. # disable xconsole window from autostarting at each login:
  232.  
  233. sed -i 's/xconsole/#xconsole/' /etc/X11/xenodm/Xsetup_0
  234.  
  235. # remap keys
  236.  
  237. ## map caps lock to esacpe key in tty:
  238.  
  239. # tty
  240. vi /etc/wsconsctl.conf:
  241.  
  242. keyboard.map+="keysym Caps_Lock = Escape"
  243.  
  244. # set UTF-8 for tty:
  245.  
  246. export LANG=en_US.UTF-8
  247.  
  248. export LC_ALL=en_US.UTF-8
  249.  
  250. # and add it to /etc/login.conf
  251.  
  252. :charset=UTF-8:\
  253. :LANG=en_US.UTF-8:\
  254. :LC_ALL=en_US.UTF-8:
  255.  
  256. # setup doas for user:
  257.  
  258. echo 'permit persist keepenv user' > /etc/doas.conf
  259.  
  260. # enable power managemnt options:
  261.  
  262. rcctl enable apmd
  263.  
  264. rcctl set apmd flags -A
  265.  
  266. rcctl start apmd
  267.  
  268. # add user to groups:
  269.  
  270. usermod -G staff user
  271.  
  272. usermod -G operator
  273.  
  274. usermod -G games
  275.  
  276. # change resource limits:
  277.  
  278. vi /etc/login.conf:
  279.  
  280. staff:\
  281. :datasize-cur=1024M:\
  282. :datasize-max=8192M:\
  283. :maxproc-cur=512:\
  284. :maxproc-max=1024:\
  285. :openfiles-cur=4096:\
  286. :openfiles-max=8192:\
  287. :stacksize-cur=32M:\
  288. :ignorenologin:\
  289. :requirehome@:\
  290. :tc=default:
  291.  
  292. # bump up kernal sysctls:
  293.  
  294. vi /etc/sysctl.conf:
  295.  
  296. # shared memory limits
  297. kern.shminfo.shmall=3145728
  298. kern.shminfo.shmmax=2147483647
  299. kern.shminfo.shmmni=1024
  300.  
  301. # semaphores
  302. kern.shminfo.shmseg=1024
  303. kern.seminfo.semmns=4096
  304. kern.seminfo.semmni=1024
  305.  
  306. kern.maxproc=32768
  307. kern.maxfiles=65535
  308. kern.bufcachepercent=90
  309. kern.maxvnodes=262144
  310. kern.somaxconn=2048
  311.  
  312. # lock screen automaticaly when you close the lid:
  313.  
  314. # make the directory for apm:
  315.  
  316. mkdir /etc/apm
  317.  
  318. # Then, create the file /etc/apm/suspend with the following contents:
  319.  
  320. #!/bin/sh
  321. pkill -USR1 xidle
  322.  
  323. # And make it executable:
  324.  
  325. chmod +x /etc/apm/suspend
  326.  
  327. # turn off ntpd google check:
  328.  
  329. sed -i '/google/d' /etc/ntpd.conf
  330.  
  331. # restart ntpd:
  332.  
  333. rcctl restart ntpd
  334.  
  335. # change hostname:
  336.  
  337. vi /etc/myname:
  338.  
  339. host
  340.  
  341. # exit and login as user
  342.  
  343. # uninstall fvwm
  344.  
  345. ## install ports tree
  346.  
  347. # fetch the ports tree:
  348.  
  349. cd /tmp
  350.  
  351. ftp https://cdn.openbsd.org/pub/OpenBSD/$(uname -r)/{ports.tar.gz,SHA256.sig}
  352.  
  353. signify -Cp /etc/signify/openbsd-$(uname -r | cut -c 1,3)-base.pub -x SHA256.sig ports.tar.gz
  354.  
  355. # untar the ports tree in /usr/ports:
  356.  
  357. cd /usr
  358.  
  359. tar xzf /tmp/ports.tar.gz
  360.  
  361. # configure ports:
  362.  
  363. # vi /etc/mk.conf:
  364.  
  365. WRKOBJDIR=/usr/obj/ports
  366.  
  367. DISTDIR=/usr/distfiles
  368.  
  369. PACKAGE_REPOSITORY=/usr/packages
  370.  
  371. ## install programs
  372.  
  373. # shell:
  374.  
  375. ## zsh:
  376.  
  377. doas pkg_add zsh
  378.  
  379. # editor:
  380.  
  381. ## neovim:
  382.  
  383. doas pkg_add neovim
  384.  
  385. # music and video:
  386.  
  387. ## mpd:
  388.  
  389. doas pkg_add mpd
  390.  
  391. ## mpc:
  392.  
  393. doas pkg_add mpc
  394.  
  395. ## ncmpcpp:
  396.  
  397. doas pkg_add ncmpcpp
  398.  
  399. ## ncmpc:
  400.  
  401. doas pkg_add ncmpc
  402.  
  403. ## mpv:
  404.  
  405. doas pkg_add mpv
  406.  
  407. # network:
  408.  
  409. ## tor:
  410.  
  411. doas pkg_add tor
  412.  
  413. # web browsing
  414.  
  415. ## tor-browser:
  416.  
  417. doas pkg_add tor-browser
  418.  
  419. ## firefox:
  420.  
  421. doas pkg_add firefox
  422.  
  423. ## qutebrowser:
  424.  
  425. doas pkg_add qutebrowser
  426.  
  427. ## w3m:
  428.  
  429. doas pkg_add w3m
  430.  
  431. choice: (2)
  432.  
  433. # file management:
  434.  
  435. ## thunar:
  436.  
  437. doas pkg_add thunar
  438.  
  439. ## ranger:
  440.  
  441. doas pkg_add ranger
  442.  
  443. # utilities:
  444.  
  445. ## feh:
  446.  
  447. doas pkg_add feh
  448.  
  449. ## dunst:
  450.  
  451. doas pkg_add dunst
  452.  
  453. ## tree:
  454.  
  455. doas pkg_add tree
  456.  
  457. ## scrot:
  458.  
  459. doas pkg_add scrot
  460.  
  461. ## neofetch:
  462.  
  463. doas pkg_add neofetch
  464.  
  465. ## htop:
  466.  
  467. doas pkg_add htop
  468.  
  469. ## wget:
  470.  
  471. doas pkg_add wget
  472.  
  473. ## git:
  474.  
  475. doas pkg_add git
  476.  
  477. ## gimp:
  478.  
  479. doas pkg_add gimp
  480.  
  481. ## transmission:
  482.  
  483. doas pkg_add transmission
  484.  
  485. ## unzip:
  486.  
  487. doas pkg_add unzip
  488.  
  489. choice (1)
  490.  
  491. ## zathura:
  492.  
  493. doas pkg_add zathura
  494.  
  495. ## qemu:
  496.  
  497. doas pkg_add qemu
  498.  
  499. ## imagemagick:
  500.  
  501. doas pkg_add ImageMagick
  502.  
  503. # social media:
  504.  
  505. ## pidgin:
  506.  
  507. doas pkg_add pidgin
  508.  
  509. choice (1)
  510.  
  511. ## pidgin-otr:
  512.  
  513. doas pkg_add pidgin-otr
  514.  
  515. ## pidgin-libnotify:
  516.  
  517. doas pkg_add pidgin-libnotify
  518.  
  519. ## irssi:
  520.  
  521. doas pkg_add irssi
  522.  
  523. choice (2)
  524.  
  525. ## irssi-otr:
  526.  
  527. doas pkg_add irssi-otr
  528.  
  529. ## neomutt:
  530.  
  531. doas pkg_add neomutt
  532.  
  533. choice (1)
  534.  
  535. # programming
  536.  
  537. ## ipython:
  538.  
  539. doas pkg_add ipython
  540.  
  541. ## py-virtualenv:
  542.  
  543. doas pkg_add py-virtualenv
  544.  
  545. ## py3-virtualenv:
  546.  
  547. doas pkg_add py3-virtualenv
  548.  
  549. ## py-pip:
  550.  
  551. doas pkg_add py-pip
  552.  
  553. ## py3-pip:
  554.  
  555. doas pkg_add py3-pip
  556.  
  557. # games
  558.  
  559. ## wesnoth:
  560.  
  561. doas pkg_add wesnoth
  562.  
  563. ## 0ad:
  564.  
  565. doas pkg_add 0ad
  566.  
  567. ## minetest:
  568.  
  569. doas pkg_add mintest
  570.  
  571. ## nethack:
  572.  
  573. doas pkg_add nethack
  574.  
  575. choice (2)
  576.  
  577. ## supertux:
  578.  
  579. doas pkg_add supertux
  580.  
  581. ## supertuxkart:
  582.  
  583. doas pkg_add supertuxkart
  584.  
  585. # terminal
  586.  
  587. ## urxvt-unicode:
  588.  
  589. doas pkg_add urxvt-unicode
  590.  
  591. # fonts
  592.  
  593. ## noto-fonts:
  594.  
  595. doas pkg_add noto-fonts
  596.  
  597. ## liberation-fonts:
  598.  
  599. doas pkg_add liberation-fonts
  600.  
  601. ## zh-fonts-arphicttf:
  602.  
  603. doas pkg_add zh-fonts-arphicttf
  604.  
  605. ## terminus-font:
  606.  
  607. doas pkg_add terminus-font
  608.  
  609. choice (1: terminus-font)
  610.  
  611. ## p5-Locale-Hebrew:
  612.  
  613. doas pkg_add p5-Locale-Hebrew
  614.  
  615. ## migmix:
  616.  
  617. doas pkg_add migmix
  618.  
  619. ## migu:
  620.  
  621. doas pkg_add migu
  622.  
  623. ## ja-sazanami-ttf:
  624.  
  625. doas pkg_add ja-sazanami-ttf
  626.  
  627. ## vlgothic:
  628.  
  629. doas pkg_add vlgothic
  630.  
  631. ## hanazono:
  632.  
  633. doas pkg_add hanazono
  634.  
  635. ## anonymous-pro:
  636.  
  637. doas pkg_add anonymous-pro
  638.  
  639. ## artwiz-aleczapka:
  640.  
  641. doas pkg_add artwiz-aleczapka
  642.  
  643. ## inconsolata-font:
  644.  
  645. doas pkg_add inconsolata-font
  646.  
  647. ## cantarell-fonts:
  648.  
  649. doas pkg_add cantarell-fonts
  650.  
  651. ## doulos:
  652.  
  653. doas pkg_add doulos
  654.  
  655. ## ubuntu-fonts:
  656.  
  657. doas pkg_add ubuntu-fonts
  658.  
  659. ## junicode:
  660.  
  661. doas pkg_add junicode
  662.  
  663. ## charis:
  664.  
  665. doas pkg_add charis
  666.  
  667. ## gentium:
  668.  
  669. doas pkg_add gentium
  670.  
  671. ## powerline-fonts:
  672.  
  673. doas pkg_add powerline-fonts
  674.  
  675. # make a build directory:
  676.  
  677. mkdir .builds
  678.  
  679. # window manageer
  680.  
  681. ## dwm
  682.  
  683. cd .builds
  684.  
  685. git clone git://git.suckless.org/dwm
  686.  
  687. cd dwm
  688.  
  689. # uncomment openbsd libs in config.mk:
  690.  
  691. # OpenBSD (uncomment)
  692. FREETYPEINC = ${X11INC}/freetype2
  693.  
  694. # build dwm:
  695.  
  696. doas make clean install
  697.  
  698. # application menu
  699.  
  700. ## demenu
  701.  
  702. cd .builds
  703.  
  704. git clone git://git.suckless.org/dmenu
  705.  
  706. cd dmenu
  707.  
  708. # uncomment openbsd libs in config.mk:
  709.  
  710. FREETYPEINC = ${X11INC}/freetype2
  711.  
  712. # build dmenu:
  713.  
  714. doas make clean install
  715.  
  716. # make subdirecories and change shell:
  717.  
  718. mkdir Documents Downloads Music Videos Pictures
  719.  
  720. mkdir Pictures/.screenshots
  721.  
  722. mkdir ~/.config
  723.  
  724. doas mkdir /usr/local/share/backgrounds
  725.  
  726. # change shell for user:
  727.  
  728. chsh -s /usr/local/bin/zsh
  729.  
  730. # move files to the right places:
  731.  
  732. doas mv Fonts /usr/local/share/fonts
  733.  
  734. doas mv wallpapers /usr/local/share/backgrounds
  735.  
  736. ### Configurations ###
  737.  
  738. ============================================================================================================================
  739.  
  740. ## .xsession:
  741.  
  742. vi ~/.xsessions
  743.  
  744. #####################
  745. #
  746. # .xsession
  747. #
  748. #####################
  749.  
  750.  
  751. # use UTF-8 everywhere
  752. export LANG=en_US.UTF-8
  753.  
  754. # specify location of .zshrc
  755. export ENV=$HOME/.zshrc
  756.  
  757. # load .Xresources
  758. xrdb -merge $HOME/.Xresources
  759.  
  760. # set background color
  761. xsetroot -solid back
  762.  
  763. # enable scrolling with trackpoint and middle button
  764. xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation" 1
  765. xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Button" 2
  766. xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Axes" 6 7 4 5
  767.  
  768. # remap caps lock to esacpe
  769. setxkbmap -option caps:escape
  770.  
  771. # start dwm
  772. exec dwm
  773.  
  774. ============================================================================================================================
  775.  
  776. ## .Xresources:
  777.  
  778. vi ~/.Xresources
  779.  
  780. !!!!!!!!!!!!!!!!!!!!!!!!!!
  781. !
  782. ! .Xresources
  783. !
  784. !!!!!!!!!!!!!!!!!!!!!!!!!!
  785.  
  786. ! to load .Xresources run:
  787.  
  788. ! xrdb ~/.Xresources
  789.  
  790. ! ===== fonts
  791.  
  792. !to find which font is used as the fall back font for a specific character run:
  793.  
  794. ! FC_DEBUG=4 pango-view -q -t '{character}' 2>&1 |\grep -o 'family: "[^"]\+' | cut -c 10- | tail -n 1
  795.  
  796. !to find the name of a font:
  797.  
  798. ! fc-list -v | grep *name*
  799.  
  800. Xft.autohint : 0
  801. Xft.lcdfilter : lcddefault
  802. Xft.hintstyle : hintslight
  803. Xft.hinting : 1
  804. Xft.antialias : 1
  805. Xft.rgba : rgb
  806. *font : Terminus (TTF):size=9
  807.  
  808. ! ===== urxvt:
  809.  
  810. ! fonts
  811. URxvt.font: xft:Terminus (TTF):size=9, xft:Noto Sans Devanagari:9, xft:Noto Emoji, xft:DejaVu Serif, xft:Noto Sans Kannada
  812.  
  813. ! scrollbar
  814. URxvt.scrollBar: false
  815.  
  816. ! transparency
  817. URxvt.depth: 32
  818. URxvt.background: [95]#000000
  819.  
  820. ! fading
  821. URxvt*fading: 30
  822.  
  823. ! cursor
  824. URxvt*cursorUnderline: true
  825. URxvt*cursorBlink: true
  826. URxvt*cursorColor: #FF0099
  827.  
  828. !! theme
  829. !background color
  830. URxvt*background: #000000
  831.  
  832. ! font color
  833. URxvt*foreground: #67C8FF
  834.  
  835. ! other colors
  836. URxvt*color0: #000000
  837. URxvt*color1: #FF0000
  838. URxvt*color2: #67C8FF
  839. URxvt*color3: #FF1493
  840. URxvt*color4: #099FFF
  841. URxvt*color5: #CC00FF
  842. URxvt*color6: #099FFF
  843. URxvt*color7: #820571
  844. URxvt*color8: #45013C
  845. URxvt*color9: #099FFF
  846. URxvt*color10: #FF0099
  847. URxvt*color11: #E6FB04
  848. URxvt*color12: #9400D3
  849. URxvt*color13: #DB329D
  850. URxvt*color14: #9400D3
  851. URxvt*color15: #FF0099
  852. URxvt*underlineColor: #FF34B3
  853. URxvt*highlightColor: #191970
  854. URxvt*highlightTextColor: #EE00EE
  855.  
  856. !! extensions
  857.  
  858. !fullscreen
  859. URxvt.perl-ext-common: fullscreen
  860. URxvt.keysym.F11: perl:fullscreen:switch
  861.  
  862. ! ===== xterm
  863.  
  864. !! theme
  865.  
  866. XTerm*background : #000000
  867. XTerm*foreground : #67C8FF
  868. XTerm*cursorColor : #FF0099
  869. XTerm*colorUL : #366060
  870. XTerm*underlineColor : #FF34B3
  871. XTerm*color0 : #000000
  872. XTerm*color1 : #FF0000
  873. XTerm*color2 : #67C8FF
  874. XTerm*color3 : #FF1493
  875. XTerm*color4 : #099FFF
  876. XTerm*color5 : #CC00FF
  877. XTerm*color6 : #099FFF
  878. XTerm*color7 : #820571
  879. XTerm*color8 : #45013C
  880. XTerm*color9 : #099FFF
  881. XTerm*color10 : #FF0099
  882. XTerm*color11 : #E6FB04
  883. XTerm*color12 : #9400D3
  884. XTerm*color13 : #DB329D
  885. XTerm*color14 : #9400D3
  886. XTerm*color15 : #FF0099
  887.  
  888. ! remove the additional black border
  889. XTerm*borderWidth : 0
  890. XTerm*internalBorder : 2
  891.  
  892. ! set TERM env variable to use 256 colors
  893. XTerm*termName : xterm-256color
  894.  
  895. ! make alt key work normally
  896. XTerm*vt100.metaSendsEscape : true
  897.  
  898. ! save ~10,000 lines of scrollback
  899. XTerm*v100.saveLines : 10240
  900.  
  901. ! hide scrollbar
  902. XTerm*vt100.scrollBar : false
  903.  
  904. ! some black magic to change what characters XTerm considers "word delimiters"
  905. XTerm*charClass : 33:48,36-47:48,58-59:48,61:48,63-64:48,95:48,126:48
  906.  
  907. ============================================================================================================================
  908.  
  909. ## dwm (config.def.h)
  910.  
  911. /* See LICENSE file for copyright and license details. */
  912.  
  913. /* appearance */
  914. static const unsigned int borderpx = 1; /* border pixel of windows */
  915. static const unsigned int snap = 32; /* snap pixel */
  916. static const int showbar = 1; /* 0 means no bar */
  917. static const int topbar = 1; /* 0 means bottom bar */
  918. static const char *fonts[] = { "Sparkles:size=9" };
  919. static const char dmenufont[] = "Terminus (TTF):size=10";
  920. static const char col_black1[] = "#000000";
  921. static const char col_gray2[] = "#444444";
  922. static const char col_gray3[] = "#bbbbbb";
  923. static const char col_gray4[] = "#eeeeee";
  924. static const char col_cyan[] = "#005577";
  925. static const char *colors[][3] = {
  926. /* fg bg border */
  927. [SchemeNorm] = { col_gray3, col_black1, col_gray2 },
  928. [SchemeSel] = { col_gray4, col_cyan, col_cyan },
  929. };
  930.  
  931. /* tagging */
  932. static const char *tags[] = { "零", "一", "二", "三", "四", "五", " 六", "七", "八" };
  933.  
  934. static const Rule rules[] = {
  935. /* xprop(1):
  936. * WM_CLASS(STRING) = instance, class
  937. * WM_NAME(STRING) = title
  938. */
  939. /* class instance title tags mask isfloating monitor */
  940. { "Gimp", NULL, NULL, 0, 1, -1 },
  941. { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
  942. };
  943.  
  944. /* layout(s) */
  945. static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
  946. static const int nmaster = 1; /* number of clients in master area */
  947. static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
  948.  
  949. static const Layout layouts[] = {
  950. /* symbol arrange function */
  951. { "[]=", tile }, /* first entry is default */
  952. { "><>", NULL }, /* no layout function means floating behavior */
  953. { "[M]", monocle },
  954. };
  955.  
  956. /* key definitions */
  957. #define MODKEY Mod1Mask
  958. #define TAGKEYS(KEY,TAG) \
  959. { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
  960. { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
  961. { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
  962. { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
  963.  
  964. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  965. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  966.  
  967. /* commands */
  968. static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
  969. static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_black1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
  970. static const char *termcmd[] = { "st", NULL };
  971.  
  972. static Key keys[] = {
  973. /* modifier key function argument */
  974. { MODKEY, XK_p, spawn, {.v = dmenucmd } },
  975. { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
  976. { MODKEY, XK_b, togglebar, {0} },
  977. { MODKEY, XK_j, focusstack, {.i = +1 } },
  978. { MODKEY, XK_k, focusstack, {.i = -1 } },
  979. { MODKEY, XK_i, incnmaster, {.i = +1 } },
  980. { MODKEY, XK_d, incnmaster, {.i = -1 } },
  981. { MODKEY, XK_h, setmfact, {.f = -0.05} },
  982. { MODKEY, XK_l, setmfact, {.f = +0.05} },
  983. { MODKEY, XK_Return, zoom, {0} },
  984. { MODKEY, XK_Tab, view, {0} },
  985. { MODKEY|ShiftMask, XK_c, killclient, {0} },
  986. { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
  987. { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
  988. { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
  989. { MODKEY, XK_space, setlayout, {0} },
  990. { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
  991. { MODKEY, XK_0, view, {.ui = ~0 } },
  992. { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
  993. { MODKEY, XK_comma, focusmon, {.i = -1 } },
  994. { MODKEY, XK_period, focusmon, {.i = +1 } },
  995. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
  996. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
  997. TAGKEYS( XK_1, 0)
  998. TAGKEYS( XK_2, 1)
  999. TAGKEYS( XK_3, 2)
  1000. TAGKEYS( XK_4, 3)
  1001. TAGKEYS( XK_5, 4)
  1002. TAGKEYS( XK_6, 5)
  1003. TAGKEYS( XK_7, 6)
  1004. TAGKEYS( XK_8, 7)
  1005. TAGKEYS( XK_9, 8)
  1006. { MODKEY|ShiftMask, XK_q, quit, {0} },
  1007. };
  1008.  
  1009. /* button definitions */
  1010. /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  1011. static Button buttons[] = {
  1012. /* click event mask button function argument */
  1013. { ClkLtSymbol, 0, Button1, setlayout, {0} },
  1014. { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
  1015. { ClkWinTitle, 0, Button2, zoom, {0} },
  1016. { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
  1017. { ClkClientWin, MODKEY, Button1, movemouse, {0} },
  1018. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  1019. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  1020. { ClkTagBar, 0, Button1, view, {0} },
  1021. { ClkTagBar, 0, Button3, toggleview, {0} },
  1022. { ClkTagBar, MODKEY, Button1, tag, {0} },
  1023. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  1024. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement