From 377eefc2ce60d5a8fe0caec9b97673ea76bbe9f0 Mon Sep 17 00:00:00 2001 From: Ambrevar Date: Thu, 1 Nov 2012 14:47:35 +0100 Subject: [PATCH 1/2] Netinit: force zsh usage. Added comments explaning why. PKG: FreeBSD + FreeBSD's TeXlive package list. Save: forced zsh usage + FreeBSD compatibility. Shell: FreeBSD aliases and functions. --- .netinit | 12 +- .pkg-freebsd-edf23ads | 362 ++++++++++++++++++++++++++++++++++ .pkg-texlive-FreeBSD-edf23ads | 57 ++++++ .save | 58 +++--- .shell.d/alias_freebsd | 21 +- .shell.d/funs_freebsd | 24 +++ .shell.d/funs_rc | 11 +- 7 files changed, 497 insertions(+), 48 deletions(-) create mode 100644 .pkg-freebsd-edf23ads create mode 100644 .pkg-texlive-FreeBSD-edf23ads create mode 100644 .shell.d/funs_freebsd diff --git a/.netinit b/.netinit index 9130b087..f79b3c57 100755 --- a/.netinit +++ b/.netinit @@ -1,14 +1,20 @@ -#!/bin/zsh +#!/usr/bin/env zsh ################################################################################ ## Custom network initialization script. ## 2012-10-29 ################################################################################ ## Deps: wpa_supplicant, ccrypt -## + +## We need to use wpa_supplicant's unencrypted config file. We store it in a +## variable to keep it secure, but the 'wpa_supplicant' command requires a +## file. We cannot use a pipe for that, because in that case the config would be +## accessible unencrypted. So we need to use an internal path with a syntax like +## <(...) which is not specified by POSIX. Ksh, bash and zsh can handle it. + ## Use 'wpa_passphrase essid $PW >> /etc/wpa_supplicant.conf', where PW is a ## variable containing the password. You can set PW securely by using a shell ## built-in like 'read -s PW'. -## + ## There is an Emacs plugin for editing crypted files directly. See 'man ## ccrypt'. diff --git a/.pkg-freebsd-edf23ads b/.pkg-freebsd-edf23ads new file mode 100644 index 00000000..1d896193 --- /dev/null +++ b/.pkg-freebsd-edf23ads @@ -0,0 +1,362 @@ +ImageMagick-6.7.9.4 +ORBit2-2.14.19 +aalib-1.4.r5_6 +antiword-0.37_1 +apr-1.4.6.1.4.1_1 +aspell-0.60.6.1_1 +atk-2.0.1 +autoconf-2.13.000227_6 +autoconf-2.69 +autoconf-wrapper-20101119 +automake-1.12.4 +automake-1.4.6_6 +automake-wrapper-20101119 +automount-1.3.1 +awesome-3.4.13 +awesome-vicious-2.1.0 +bison-2.5.1,1 +bitstream-vera-1.10_5 +ca_root_nss-3.13.6 +cairo-1.10.2_4,2 +calc-2.12.4.3_1 +cantarell-fonts-0.0.10 +ccrypt-1.9_1 +cdparanoia-3.9.8_9 +cmus-2.4.2_2 +compositeproto-0.4.2 +consolekit-0.4.3 +cups-client-1.5.2_2 +cups-image-1.5.2_1 +curl-7.24.0_1 +cvsps-2.1_1 +cyrus-sasl-2.1.25_2 +damageproto-1.2.1 +db42-4.2.52_5 +dbus-1.4.14_4 +dbus-glib-0.94 +dconf-0.5.1_4 +dejavu-2.33 +desktop-file-utils-0.18 +dmidecode-2.11 +dmxproto-2.3.1 +docbook-1.4 +docbook-4.1_4 +docbook-4.2 +docbook-4.3 +docbook-4.4_2 +docbook-4.5_2 +docbook-5.0_1 +docbook-sk-4.1.2_4 +docbook-xml-4.2_1 +docbook-xml-4.3 +docbook-xml-4.4_1 +docbook-xml-4.5 +docbook-xsl-1.76.1 +dri-7.6.1_2,2 +dri2proto-2.6 +eggdbus-0.6_1 +emacs-nox11-24.2_8,2 +enca-1.13 +enchant-1.6.0 +encodings-1.0.4,1 +expat-2.0.1_2 +faac-1.28_2 +faad2-2.7_3,1 +feh-2.6.1 +fftw3-3.3.2 +fftw3-float-3.3.2 +fixesproto-5.0 +flac-1.2.1_3 +flex-2.5.37 +font-bh-ttf-1.0.3 +font-misc-ethiopic-1.0.3 +font-misc-meltho-1.0.3 +font-util-1.2.0 +fontconfig-2.9.0,1 +fontsproto-2.1.1 +freetype2-2.4.9_1 +frei0r-1.3_1 +fribidi-0.19.2_1 +fusefs-exfat-0.9.7 +fusefs-ext4fuse-20120803 +fusefs-kmod-0.3.9.p1.20080208_11 +fusefs-libs-2.9.1 +fusefs-ntfs-2012.1.15 +gamin-0.1.10_4 +gconf2-2.32.0_3 +gd-2.0.35_8,1 +gdbm-1.9.1 +gdk-pixbuf-2.23.5_3 +gettext-0.18.1.1 +ghostscript9-9.05_5 +giblib-1.2.4_11 +giflib-4.2.0_2 +gio-fam-backend-2.28.8_1 +girara-0.1.4 +git-1.7.11.5 +glib-1.2.10_13 +glib-2.28.8_4 +glib-networking-2.28.7_4 +glproto-1.4.15 +gmake-3.82_1 +gmp-5.0.5 +gnome_subr-1.0 +gnomehier-2.3_12 +gnuls-8.12 +gnupg-2.0.19_2 +gnutls-2.12.18_1 +gobject-introspection-0.10.8_2 +gpac-libgpac-0.4.5_6,1 +gpgme-1.3.2 +gsettings-desktop-schemas-3.0.1 +gsfonts-8.11_5 +gstreamer-0.10.36 +gstreamer-plugins-0.10.36_2,3 +gtk-2.24.6_2 +gtk-engines2-2.20.2_1 +gtk-update-icon-cache-2.24.6_1 +hal-0.5.14_19 +help2man-1.40.12 +hicolor-icon-theme-0.12 +icu-4.8.1.1_1 +imlib2-1.4.5_2,2 +inputproto-2.0.2 +intltool-0.41.1 +iso8879-1986_3 +jasper-1.900.1_10 +jbig2dec-0.11_1 +jbigkit-1.6 +jpeg-8_3 +kbproto-1.0.5 +lame-3.99.5 +lcms-1.19_1,1 +lcms2-2.3 +libGL-7.6.1_2 +libGLU-7.6.1_1 +libICE-1.0.7,1 +libIDL-0.8.14_1 +libSM-1.2.0,1 +libX11-1.4.4,1 +libXau-1.0.6 +libXaw-1.0.9,2 +libXcomposite-0.4.3,1 +libXcursor-1.1.12 +libXdamage-1.1.3 +libXdmcp-1.1.0 +libXext-1.3.0_1,1 +libXfixes-5.0 +libXfont-1.4.4_1,1 +libXft-2.1.14 +libXi-1.4.5,1 +libXinerama-1.1.1,1 +libXmu-1.1.0,1 +libXp-1.0.1,1 +libXpm-3.5.9 +libXrandr-1.3.2 +libXrender-0.9.6 +libXt-1.1.1,1 +libXtst-1.2.0 +libXv-1.0.6,1 +libXvMC-1.0.6 +libXxf86dga-1.1.2 +libXxf86misc-1.0.3 +libXxf86vm-1.1.1 +libaacplus-2.0.2_1 +libaacs-0.3.0 +libass-0.10.0 +libassuan-2.0.2 +libbluray-0.2.2,1 +libcddb-1.3.2_1 +libcroco-0.6.2_1 +libdrm-2.4.17_1 +libdvdcss-1.2.10_1 +libdvdread-4.2.0_2 +libev-4.11,1 +libevent2-2.0.20 +libexecinfo-1.1_3 +libffi-3.0.9 +libfontenc-1.1.0 +libfpx-1.2.0.12_2 +libgcrypt-1.5.0_1 +libgee-0.6.2.1 +libgpg-error-1.10 +libgsf-1.14.21_1 +libiconv-1.14 +libid3tag-0.15.1b +libidn-1.25 +libksba-1.2.0 +liblqr-1-0.4.1_2 +libltdl-2.4.2 +libmad-0.15.1b_2 +libmng-1.0.10_2 +libogg-1.3.0,4 +libotf-0.9.12 +libpaper-1.1.24_1 +libpciaccess-0.12.1 +libproxy-0.4.6 +libpthread-stubs-0.3_3 +librsvg2-2.34.1_1 +libsigc++-2.2.10 +libsigsegv-2.10 +libslang2-2.2.4_3 +libsoup-2.34.3 +libtheora-1.1.1_3 +libtool-2.4.2 +libtorrent-0.13.2 +libublio-20070103 +libva-1.1.0_2 +libvdpau-0.5_1 +libvolume_id-0.81.1 +libvorbis-1.3.3_1,3 +libvpx-1.1.0 +libwmf-0.2.8.4_7 +libxcb-1.7 +libxdg-basedir-1.1.1 +libxkbfile-1.0.7 +libxkbui-1.0.2_1 +libxml2-2.7.8_3 +libxslt-1.1.26_3 +lirc-0.9.0_3,1 +liveMedia-2012.04.04,2 +lsof-4.87.a,7 +lua-5.1.5_4 +lua51-luafilesystem-1.4.2 +luajit-2.0.0.b10 +luakit-2011.07.22_1 +luit-1.1.0_1 +lxterminal-0.1.11_1 +lynx-2.8.7.2,1 +m17n-db-1.6.3 +m17n-lib-1.6.3_1 +m4-1.4.16_1,1 +mediainfo-0.7.52 +mime-support-3.52.1 +mkfontdir-1.0.6 +mkfontscale-1.0.9 +moc-2.4.4_9 +mp4v2-1.9.1 +mpfr-3.1.1 +mpg123-1.14.4 +mplayer-1.1.r20120721_1 +nano-2.2.6 +nas-1.9.3 +nasm-2.10.03,1 +ncdu-1.9 +ncurses-5.9_1 +neon29-0.29.6_4 +nettle-2.5 +nspr-4.9.3 +numlockx-1.2 +openjpeg-1.5.0_1 +orc-0.4.16 +oss-4.2.b2007 +p11-kit-0.14 +p5-Encode-HanExtra-0.23 +p5-Encode-JIS2K-0.02 +p5-Error-0.17018 +p5-Locale-gettext-1.05_3 +p5-Net-SMTP-SSL-1.01_1 +p5-Unicode-Map8-0.13 +p5-Unicode-String-2.09 +p5-XML-Parser-2.41 +pango-1.28.4_1 +pciids-20120906 +pcre-8.31_1 +perl-5.14.2_2 +pixman-0.24.2 +pkg_search-1.3 +pkgconf-0.8.9 +png-1.5.12 +policykit-0.9_6 +polkit-0.99 +poppler-0.18.4_2 +poppler-data-0.4.5 +poppler-glib-0.18.4_2 +popt-1.16 +portupgrade-2.4.9.9,2 +printproto-1.0.5 +pstree-2.33 +pth-2.0.7 +py27-docutils-0.9.1 +py27-ranger-1.5.5 +py27-sqlite3-2.7.3_2 +python27-2.7.3_3 +randrproto-1.3.2 +recode-3.6_8 +recordproto-1.14.1 +renderproto-0.11.1 +rpm-3.0.6_15 +rtorrent-0.9.2 +ruby-1.8.7.370,1 +ruby18-bdb-0.6.6 +ruby18-deplate-0.8.5 +rxvt-unicode-9.15_2 +scrot-0.8_6 +sdl-1.2.15_2,2 +setxkbmap-1.2.0 +shared-mime-info-1.0_1 +slock-1.0 +speex-1.2.r1_4,1 +sqlite3-3.7.14 +startup-notification-0.12 +subversion-1.7.6 +sudo-1.8.6.p3_1 +svgalib-1.4.3_6 +taskwarrior-2.1.2 +texi2html-5.0_1,1 +tiff-4.0.2_1 +tree-1.5.3 +unique-1.1.6_3 +unzip-6.0_1 +urlview-0.9_7 +v4l_compat-1.0.20120501_1 +videoproto-2.3.1 +vlock-2.2.3 +vte-0.26.2_3 +wavpack-4.60.1 +webkit-gtk2-1.4.3_1 +webp-0.1.3_1 +wget-1.13.4_1 +wv-1.2.9_1 +x264-0.125.2201 +xauth-1.0.6 +xcb-util-0.3.8,1 +xcb-util-image-0.3.8 +xcb-util-keysyms-0.3.8 +xcb-util-renderutil-0.3.8 +xcb-util-wm-0.3.8 +xclip-0.12_1 +xdg-utils-1.0.2_7 +xdpyinfo-1.3.0 +xev-1.1.0 +xextproto-7.2.0 +xf86-input-keyboard-1.6.1 +xf86-input-mouse-1.7.1 +xf86-input-synaptics-1.5.0 +xf86-video-ati-6.14.3_1 +xf86-video-vesa-2.3.0_2 +xf86dgaproto-2.1 +xf86miscproto-0.9.3 +xf86vidmodeproto-2.3.1 +xineramaproto-1.2.1 +xinit-1.3.2,1 +xkbcomp-1.2.3 +xkeyboard-config-2.5.1 +xmlcatmgr-2.2 +xmlcharent-0.3_2 +xorg-fonts-truetype-7.5.1 +xorg-minimal-7.5.2 +xorg-server-1.7.7_6,1 +xproto-7.0.22 +xrandr-1.3.5 +xrdb-1.0.9 +xsel-0.04.1_5 +xterm-281_1 +xvid-1.3.2,1 +xvinfo-1.1.1 +yasm-1.2.0 +zathura-0.2.1 +zathura-pdf-poppler-0.2.1 +zh-aterm-0.4.2_2 +zip-3.0 +zsh-5.0.0 diff --git a/.pkg-texlive-FreeBSD-edf23ads b/.pkg-texlive-FreeBSD-edf23ads new file mode 100644 index 00000000..666cb958 --- /dev/null +++ b/.pkg-texlive-FreeBSD-edf23ads @@ -0,0 +1,57 @@ + + amsfonts + bibtex + bibtex.amd64-freebsd + cm + collection-basic + collection-documentation-base + dvipdfm + dvipdfm.amd64-freebsd + dvipdfmx + dvipdfmx-def + dvipdfmx.amd64-freebsd + dvips + dvips.amd64-freebsd + enctex + etex + etex-pkg + glyphlist + gsftopk + gsftopk.amd64-freebsd + hyph-utf8 + hyphen-base + ifluatex + ifxetex + kpathsea + kpathsea.amd64-freebsd + lua-alt-getopt + luatex + luatex.amd64-freebsd + makeindex + makeindex.amd64-freebsd + metafont + metafont.amd64-freebsd + mflogo + mfware + mfware.amd64-freebsd + misc + pdftex + pdftex.amd64-freebsd + plain + scheme-minimal + tetex + tetex.amd64-freebsd + tex + tex.amd64-freebsd + texconfig + texconfig.amd64-freebsd + texlive-common + texlive-docindex + texlive-en + texlive-msg-translations + texlive-scripts + texlive-scripts.amd64-freebsd + texlive.infra + texlive.infra.amd64-freebsd + xdvi + xdvi.amd64-freebsd diff --git a/.save b/.save index 40762af9..82723a26 100755 --- a/.save +++ b/.save @@ -1,8 +1,13 @@ -#!/bin/bash +#!/usr/bin/env zsh ################################################################################ ## Home Config Backup Script -## 2012-09-01 +## 2012-11-01 ################################################################################ + +## This script should be compatible with ksh, bash and zsh. Issue with sh +## however: we use arrays. Therefore we do not comply with POSIX and use some +## extended syntax for arrays and file input -- the <(...) syntax. + ## Note for Zsh: because of the Ksh-style arrays (index starting at 0), you ## cannot use array index to append elements to arrays -- otherwise the ## KSH_ARRAYS option for zsh must be used. @@ -49,15 +54,12 @@ while getopts ":hm:o:" opt; do print_help "$0" exit 1 ;; - m) COMPRESSION="$OPTARG" ;; - o) ARCHIVENAME="${OLDPATH}/$OPTARG" ;; - ?) print_help "$0" exit 1 @@ -77,12 +79,10 @@ case $COMPRESSION in ARCEXT="tar.gz" ARCOPT="cvzf" ;; - "xz") ARCEXT="tar.xz" ARCOPT="cvJf" ;; - *) ARCEXT="tar.gz" ARCOPT="cvzf" @@ -106,9 +106,10 @@ fi ## Packages list ##============================================================================== +HOST=$(hostname) + ## Arch Linux if [ -e "/usr/bin/pacman" ]; then - HOST=$(hostname) ARCH_PKG_OFFICIAL="$HOME/.pkg-arch-official" ARCH_PKG_EXPLICIT="$HOME/.pkg-arch-explicit" @@ -124,14 +125,19 @@ if [ -e "/usr/bin/pacman" ]; then eval "${PKG_FOREIGN}" >"${ARCH_PKG_AUR}-${HOST}" fi +## FreeBSD +if [ "$(uname)" = "FreeBSD" ]; then + pkg_info | cut -f1 -d' ' >"$HOME/.pkg-freebsd-${HOST}" +fi + ## TeXlive if type tlmgr >/dev/null 2>&1; then HOST=$(hostname) - TEXLIVE_BASIC="$(tlmgr info collection-basic --list | sed -n '/^\s\+/{s/\s\+//g;p}' | sort)" + TEXLIVE_BASIC="$(tlmgr info collection-basic --list | sed -n '/^\s\+/{s/\s\+//g;p;}' | sort)" TEXLIVE_ALL="$(tlmgr info --only-installed | grep -v 'x86_64' | cut -d' ' -f2 | cut -f1 -d':' | sort)" - comm -3 <(echo "$TEXLIVE_BASIC") <(echo "$TEXLIVE_ALL") | sed 's/\s\+//g' >"$HOME/.pkg-texlive-${HOST}" + comm -3 <(echo "$TEXLIVE_BASIC") <(echo "$TEXLIVE_ALL") | sed 's/\s\+//g' >"$HOME/.pkg-texlive-$(uname)-${HOST}" fi ##============================================================================== @@ -150,7 +156,7 @@ FILELIST=(${FILELIST[*]} ".config/awesome/rc.lua") FILELIST=(${FILELIST[*]} ".config/awesome/themes/custom/theme.lua") ## cmus -FILELIST=(${FILELIST[*]} ".cmus/autosave") +FILELIST=(${FILELIST[*]} ".cmus/rc") ## Emacs FILELIST=(${FILELIST[*]} ".emacs") @@ -175,23 +181,21 @@ FILELIST=(${FILELIST[*]} ".homeinit") ## Luakit FILELIST=(${FILELIST[*]} ".config/luakit/rc.lua") FILELIST=(${FILELIST[*]} ".config/luakit/globals.lua") -FILELIST=(${FILELIST[*]} ".luakit_bookmarks_converter.lua") ## Mutt FILELIST=(${FILELIST[*]} ".muttrc") -for i in $(ls -ad --indicator-style=none .mutt.d/* | grep -vi 'cache') -do - FILELIST=(${FILELIST[*]} "$i") -done +FILELIST=(${FILELIST[*]} ".mutt.d/colors.ambrevar") +FILELIST=(${FILELIST[*]} ".mutt.d/colorset.sh") +FILELIST=(${FILELIST[*]} ".mutt.d/mailcap") ## Netinit FILELIST=(${FILELIST[*]} ".netinit") ## Ranger -for i in $(ls -ad --indicator-style=none .config/ranger/* | grep -vi 'pycache\|bookmarks\|history\|tagged') -do - FILELIST=(${FILELIST[*]} "$i") -done +FILELIST=(${FILELIST[*]} ".config/ranger/apps.py") +FILELIST=(${FILELIST[*]} ".config/ranger/options.py") +FILELIST=(${FILELIST[*]} ".config/ranger/rc.conf") +FILELIST=(${FILELIST[*]} ".config/ranger/scope.sh") ## README FILELIST=(${FILELIST[*]} "README") @@ -201,6 +205,7 @@ FILELIST=(${FILELIST[*]} ".rtorrent.rc") ## Shells FILELIST=(${FILELIST[*]} ".bash_profile") +FILELIST=(${FILELIST[*]} ".bashrc") FILELIST=(${FILELIST[*]} ".zshrc") for i in $(ls -a .shell.d/*|grep -vi 'bhistory') do @@ -214,10 +219,7 @@ FILELIST=(${FILELIST[*]} ".taskrc") # FILELIST=(${FILELIST[*]} ".terminfo/x/xterm") ## TeXlive -# for i in $(find texmf -type f|grep -vi 'moderncv/examples\|moderncv/manual\|.bzr') -# do -# FILELIST=(${FILELIST[*]} "$i") -# done +FILELIST=(${FILELIST[*]} ".texmf") ## Vim FILELIST=(${FILELIST[*]} ".vimrc") @@ -225,17 +227,21 @@ FILELIST=(${FILELIST[*]} ".vimrc") ## Xinit FILELIST=(${FILELIST[*]} ".xinitrc") +## XKB +FILELIST=(${FILELIST[*]} ".xkb") + ## Xresource FILELIST=(${FILELIST[*]} ".Xresources") + ##============================================================================== ## Archiving ##============================================================================== if [ "$DEBUG" = "yes" ]; then - tar ${ARCOPT} "${ARCHIVENAME}.${ARCEXT}" -C "$HOME" ${FILELIST[*]} -C "$SCRIPTPATH" "$(basename "$0")" --exclude-vcs + tar ${ARCOPT} "${ARCHIVENAME}.${ARCEXT}" -C "$HOME" ${FILELIST[*]} -C "$SCRIPTPATH" "$(basename "$0")" else - tar ${ARCOPT} "${ARCHIVENAME}.${ARCEXT}" -C "$HOME" ${FILELIST[*]} -C "$SCRIPTPATH" "$(basename "$0")" --exclude-vcs >/dev/null + tar ${ARCOPT} "${ARCHIVENAME}.${ARCEXT}" -C "$HOME" ${FILELIST[*]} -C "$SCRIPTPATH" "$(basename "$0")" >/dev/null fi ##============================================================================== diff --git a/.shell.d/alias_freebsd b/.shell.d/alias_freebsd index 6dc5a2de..a6642fad 100644 --- a/.shell.d/alias_freebsd +++ b/.shell.d/alias_freebsd @@ -1,30 +1,21 @@ ## -*- mode:sh -*- # alias pa='sudo pkg_add -r' -alias pr='sudo pkg_delete' +alias pd='sudo pkg_delete' alias pi='pkg_info -RrcdsD -l "::"' alias pil='pkg_info -L' +## Origin of file +alias piw='pkg_info -W' + ## Search alias pis='pkg_info -Qox' -alias pvs='pkg_version -Is' +# alias pvs='pkg_version -Is' alias psr='pkg_search -r' ## Out-of-date packages. alias pv='pkg_version -Il "<"' ## Port tree -alias mic='sudo make install clean' +alias mid='sudo make install distclean' alias mc='sudo make config' - -ms() -{ - find /usr/ports -iname "*$1*" -} - -mcd() -{ - local DEST=$(find /usr/ports -iname "*$1*" | head -n1) - echo $DEST - cd "$DEST" -} diff --git a/.shell.d/funs_freebsd b/.shell.d/funs_freebsd new file mode 100644 index 00000000..e33caa2b --- /dev/null +++ b/.shell.d/funs_freebsd @@ -0,0 +1,24 @@ +## -*- mode:sh -*- # + +## TODO: useless ? +# mqs() +# { +# local str="$(echo "$@" | sed -E 's/[ \t]+/\\|/g')" +# (cd /usr/ports && make quicksearch name="$str") +# } + +port-list() +{ + pkg_info | cut -f1 -d' ' +} + +port-size() +{ + pkg_info -Qsb "$@" | sed 's/\([^:]*\):\(.*\)/\2 KiB \1/g' +} + +mcd() +{ + local DEST=$(pkg_search -r "$@" | head -n1 | awk '{print $2}') + cd "$DEST" +} diff --git a/.shell.d/funs_rc b/.shell.d/funs_rc index 0160334c..c9238fa7 100644 --- a/.shell.d/funs_rc +++ b/.shell.d/funs_rc @@ -863,14 +863,17 @@ xmultioff () xrandr --output "$1" --off } - ##============================================================================== ## Pacman Functions ##============================================================================== -if [ -f "/usr/bin/pacman" ]; then - source "${SHELL_DIR}/funs_pacman" -fi +[ -f "/usr/bin/pacman" ] && . "${SHELL_DIR}/funs_pacman" + +##============================================================================== +## FreeBSD Functions +##============================================================================== + +[ "$(uname)" = FreeBSD ] && . "${SHELL_DIR}/funs_freebsd" ##============================================================================== ## TeXlive functions From 36a589f8b8e59d057c18976ec2899aa9603ff8cf Mon Sep 17 00:00:00 2001 From: Ambrevar Date: Thu, 1 Nov 2012 18:08:44 +0100 Subject: [PATCH 2/2] Awesome: fixed sound support for FreeBSD. Save: fixed TeXlive package list. Shell: fixed some bashisms. --- .config/awesome/rc.lua | 49 ++++++++++++++++++--------- .pkg-texlive | 36 -------------------- .pkg-texlive-FreeBSD-edf23ads | 63 ++++------------------------------- .save | 31 ++++++++++------- .shell.d/alias_freebsd | 4 ++- .shell.d/alias_rc | 2 +- .shell.d/funs_rc | 4 +-- 7 files changed, 65 insertions(+), 124 deletions(-) delete mode 100644 .pkg-texlive diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index 4657ceee..15b308e5 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -343,22 +343,9 @@ globalkeys = awful.util.table.join( -- Screenshot awful.key({}, "Print", function () awful.util.spawn("scrot 'screen-%Y-%m-%d-%H%M%S.png' -e 'mkdir -p ~/temp && mv $f ~/temp/'") end), - -- Sound Volume - awful.key({ modkey, }, "KP_Subtract", function () awful.util.spawn("amixer set Master 5%- >/dev/null") end), - awful.key({ modkey, }, "KP_Add", function () awful.util.spawn("amixer set Master 5%+ >/dev/null") end), - awful.key({ modkey, }, "KP_Enter", function () awful.util.spawn("amixer set Master toggle >/dev/null") end), - awful.key({ modkey, "Mod1" }, "KP_Subtract", function () awful.util.spawn("amixer set PCM 5%- >/dev/null") end), - awful.key({ modkey, "Mod1" }, "KP_Add", function () awful.util.spawn("amixer set PCM 5%+ >/dev/null") end), - - awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer set Master 5%+ >/dev/null") end), - awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("amixer set Master 5%- >/dev/null") end), - awful.key({ }, "XF86AudioMute", function () awful.util.spawn("amixer set Master toggle >/dev/null") end), - awful.key({ "Mod1" }, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer set PCM 5%+ >/dev/null") end), - awful.key({ "Mod1" }, "XF86AudioLowerVolume", function () awful.util.spawn("amixer set PCM 5%- >/dev/null") end), - -- Touchpad awful.key({ }, "XF86TouchpadToggle", function () os.execute("synclient TouchpadOff=`synclient -l | grep -c 'TouchpadOff.*=.*0'`") end), - awful.key({ }, "XF86Tools", function () os.execute("synclient TouchpadOff=`synclient -l | grep -c 'TouchpadOff.*=.*0'`") end), + awful.key({ }, "XF86Tools", function () os.execute("synclient TouchpadOff=`synclient -l | grep -c 'TouchpadOff.*=.*0'`") end), -- Mouse control -- Bind ''Meta4+Ctrl+m'' to move the mouse to the coordinates set above. @@ -440,7 +427,39 @@ globalkeys = awful.util.table.join( awful.util.eval, nil, awful.util.getdir("cache") .. "/history_eval") end) - ) +) + + -- Sound Volume +if ostype == "Linux" then + globalkeys = awful.util.table.join( + awful.key({ modkey, }, "KP_Subtract", function () awful.util.spawn("amixer set Master 5%- >/dev/null") end), + awful.key({ modkey, }, "KP_Add", function () awful.util.spawn("amixer set Master 5%+ >/dev/null") end), + awful.key({ modkey, }, "KP_Enter", function () awful.util.spawn("amixer set Master toggle >/dev/null") end), + awful.key({ modkey, "Mod1" }, "KP_Subtract", function () awful.util.spawn("amixer set PCM 5%- >/dev/null") end), + awful.key({ modkey, "Mod1" }, "KP_Add", function () awful.util.spawn("amixer set PCM 5%+ >/dev/null") end), + + awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer set Master 5%+ >/dev/null") end), + awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("amixer set Master 5%- >/dev/null") end), + awful.key({ }, "XF86AudioMute", function () awful.util.spawn("amixer set Master toggle >/dev/null") end), + awful.key({ "Mod1" }, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer set PCM 5%+ >/dev/null") end), + awful.key({ "Mod1" }, "XF86AudioLowerVolume", function () awful.util.spawn("amixer set PCM 5%- >/dev/null") end) + ) +elseif ostype == "FreeBSD" then + globalkeys = awful.util.table.join( + awful.key({ modkey, }, "KP_Subtract", function () awful.util.spawn("mixer vol -5 >/dev/null") end), + awful.key({ modkey, }, "KP_Add", function () awful.util.spawn("mixer vol +5 >/dev/null") end), + awful.key({ modkey, }, "KP_Enter", function () awful.util.spawn("mixer vol ^ >/dev/null") end), + awful.key({ modkey, "Mod1" }, "KP_Subtract", function () awful.util.spawn("mixer pcm -5 >/dev/null") end), + awful.key({ modkey, "Mod1" }, "KP_Add", function () awful.util.spawn("mixer pcm +5 >/dev/null") end), + + awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("mixer vol -5 >/dev/null") end), + awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("mixer vol +5 >/dev/null") end), + awful.key({ }, "XF86AudioMute", function () awful.util.spawn("mixer vol ^ >/dev/null") end), + awful.key({ "Mod1" }, "XF86AudioRaiseVolume", function () awful.util.spawn("mixer pcm -5 >/dev/null") end), + awful.key({ "Mod1" }, "XF86AudioLowerVolume", function () awful.util.spawn("mixer pcm +5 >/dev/null") end) + ) +end + -- Client keys clientkeys = awful.util.table.join( diff --git a/.pkg-texlive b/.pkg-texlive deleted file mode 100644 index 15cbafd1..00000000 --- a/.pkg-texlive +++ /dev/null @@ -1,36 +0,0 @@ -amscls -amsfonts -amsmath -beamer -bigfoot -collection-latex -colortbl -easylist -ec -enctex -eso-pic -etoolbox -eukdate -eurosym -fancyhdr -fix2col -geometry -glyphlist -graphics -hyperref -lipsum -listings -lm -marvosym -mdwtools -microtype -moderncv -needspace -oberdiek -pgf -url -was -wrapfig -xargs -xcolor -zapfding \ No newline at end of file diff --git a/.pkg-texlive-FreeBSD-edf23ads b/.pkg-texlive-FreeBSD-edf23ads index 666cb958..9c7a6510 100644 --- a/.pkg-texlive-FreeBSD-edf23ads +++ b/.pkg-texlive-FreeBSD-edf23ads @@ -1,57 +1,6 @@ - - amsfonts - bibtex - bibtex.amd64-freebsd - cm - collection-basic - collection-documentation-base - dvipdfm - dvipdfm.amd64-freebsd - dvipdfmx - dvipdfmx-def - dvipdfmx.amd64-freebsd - dvips - dvips.amd64-freebsd - enctex - etex - etex-pkg - glyphlist - gsftopk - gsftopk.amd64-freebsd - hyph-utf8 - hyphen-base - ifluatex - ifxetex - kpathsea - kpathsea.amd64-freebsd - lua-alt-getopt - luatex - luatex.amd64-freebsd - makeindex - makeindex.amd64-freebsd - metafont - metafont.amd64-freebsd - mflogo - mfware - mfware.amd64-freebsd - misc - pdftex - pdftex.amd64-freebsd - plain - scheme-minimal - tetex - tetex.amd64-freebsd - tex - tex.amd64-freebsd - texconfig - texconfig.amd64-freebsd - texlive-common - texlive-docindex - texlive-en - texlive-msg-translations - texlive-scripts - texlive-scripts.amd64-freebsd - texlive.infra - texlive.infra.amd64-freebsd - xdvi - xdvi.amd64-freebsd +collection-basic +marvosym +scheme-minimal +texlive-common +texlive-docindex +texlive-en diff --git a/.save b/.save index 82723a26..f1b53ff8 100755 --- a/.save +++ b/.save @@ -29,7 +29,7 @@ SCRIPTPATH="$(readlink -f $(dirname "$0"))" COMPRESSION="gz" ARCHIVENAME="$HOME/home-config-$(date "+%y-%m-%d-%H%M%S")" ARCEXT="tar.gz" -ARCOPT="cvzf" +ARCOPT="czf" print_help() { @@ -77,15 +77,15 @@ shift $(($OPTIND - 1)) case $COMPRESSION in "gz") ARCEXT="tar.gz" - ARCOPT="cvzf" + ARCOPT="czf" ;; "xz") ARCEXT="tar.xz" - ARCOPT="cvJf" + ARCOPT="cJf" ;; *) ARCEXT="tar.gz" - ARCOPT="cvzf" + ARCOPT="czf" ;; esac @@ -134,10 +134,15 @@ fi if type tlmgr >/dev/null 2>&1; then HOST=$(hostname) - TEXLIVE_BASIC="$(tlmgr info collection-basic --list | sed -n '/^\s\+/{s/\s\+//g;p;}' | sort)" - TEXLIVE_ALL="$(tlmgr info --only-installed | grep -v 'x86_64' | cut -d' ' -f2 | cut -f1 -d':' | sort)" + # TEXLIVE_BASIC="$(tlmgr info collection-basic --list | sed -n '/^\s\+/{s/\s\+//g;p;}' | sort)" + TEXLIVE_BASIC="$(tlmgr info collection-basic --list | sed -n '/^ /{s/ //g;p;}' | sort)" + TEXLIVE_ALL="$(tlmgr info --only-installed | grep -v 'x86_64\|amd64' | cut -d' ' -f2 | cut -f1 -d':' | sort)" - comm -3 <(echo "$TEXLIVE_BASIC") <(echo "$TEXLIVE_ALL") | sed 's/\s\+//g' >"$HOME/.pkg-texlive-$(uname)-${HOST}" + echo $TEXLIVE_BASIC + echo + echo $TEXLIVE_ALL + + comm -3 <(echo "$TEXLIVE_BASIC") <(echo "$TEXLIVE_ALL") | sed 's/ //g' >"$HOME/.pkg-texlive-$(uname)-${HOST}" fi ##============================================================================== @@ -238,11 +243,13 @@ FILELIST=(${FILELIST[*]} ".Xresources") ## Archiving ##============================================================================== -if [ "$DEBUG" = "yes" ]; then - tar ${ARCOPT} "${ARCHIVENAME}.${ARCEXT}" -C "$HOME" ${FILELIST[*]} -C "$SCRIPTPATH" "$(basename "$0")" -else - tar ${ARCOPT} "${ARCHIVENAME}.${ARCEXT}" -C "$HOME" ${FILELIST[*]} -C "$SCRIPTPATH" "$(basename "$0")" >/dev/null -fi +tar ${ARCOPT} "${ARCHIVENAME}.${ARCEXT}" -C "$HOME" ${FILELIST[*]} -C "$SCRIPTPATH" "$(basename "$0")" + +# if [ "$DEBUG" = "yes" ]; then +# tar ${ARCOPT} "${ARCHIVENAME}.${ARCEXT}" -C "$HOME" ${FILELIST[*]} -C "$SCRIPTPATH" "$(basename "$0")" +# else +# tar ${ARCOPT} "${ARCHIVENAME}.${ARCEXT}" -C "$HOME" ${FILELIST[*]} -C "$SCRIPTPATH" "$(basename "$0")" >/dev/null +# fi ##============================================================================== ## Cleaning diff --git a/.shell.d/alias_freebsd b/.shell.d/alias_freebsd index a6642fad..4185f6d0 100644 --- a/.shell.d/alias_freebsd +++ b/.shell.d/alias_freebsd @@ -1,7 +1,8 @@ ## -*- mode:sh -*- # alias pa='sudo pkg_add -r' -alias pd='sudo pkg_delete' +# alias pd='sudo pkg_delete' +alias pd='sudo pkg_deinstall -cd' alias pi='pkg_info -RrcdsD -l "::"' alias pil='pkg_info -L' @@ -17,5 +18,6 @@ alias psr='pkg_search -r' alias pv='pkg_version -Il "<"' ## Port tree +alias mi='sudo make install' alias mid='sudo make install distclean' alias mc='sudo make config' diff --git a/.shell.d/alias_rc b/.shell.d/alias_rc index bf68a76b..b8f0753a 100644 --- a/.shell.d/alias_rc +++ b/.shell.d/alias_rc @@ -134,7 +134,7 @@ alias xmorphzi='xrandr --output $(xrandr | grep "\" | cut -f1 -d" ") ## TeXlive if [ -d "/usr/local/texlive" ]; then - alias tlu="sudo bash -c 'umask 022 && tlmgr update --self'" + alias tlu="sudo sh -c 'umask 022 && tlmgr update --self'" alias tls="tlmgr search --global" alias tll="tlmgr show --list" fi diff --git a/.shell.d/funs_rc b/.shell.d/funs_rc index c9238fa7..62739c52 100644 --- a/.shell.d/funs_rc +++ b/.shell.d/funs_rc @@ -891,14 +891,14 @@ if [ -d "/usr/local/texlive" ]; then tli () { for i ; do - sudo bash -c 'umask 022 && tlmgr install "$0"' "$i" + sudo sh -c 'umask 022 && tlmgr install "$0"' "$i" done } tlr () { for i ; do - sudo bash -c 'umask 022 && tlmgr remove "$0"' "$i" + sudo sh -c 'umask 022 && tlmgr remove "$0"' "$i" done }