From 67ef09142cabe7c01f16a081347a8ad60885c566 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Fri, 18 Sep 2020 04:16:15 +0000 Subject: [PATCH] [bugfix] ... --- {office => apps}/config/zathura/zathurarc | 0 apps/docker.sh | 23 +++++++++++++++ {office => apps}/install.sh | 4 +-- apps/keepassxc.sh | 18 ++++++++++++ {office => apps}/nextcloud.sh | 4 +-- autologin/install.sh | 4 +-- autologin/systemd/getty1-override.conf | 3 +- deeplearning/install.sh | 35 +++++++++++++++++++++++ dunst/config/config | 1 + dunst/install.sh | 3 -- env.sh | 4 +-- gui/config/gtk-3.0/settings.ini | 15 ++++++++++ gui/config/qt5ct/qt5ct.conf | 27 +++++++++++++++++ gui/freetype2.sh | 0 gui/install.sh | 9 +++--- gui/theme.sh | 6 +++- mirrors/install.sh | 25 ++++++++++++++++ nodejs/install.sh | 2 +- nvim/install.sh | 2 +- picom/config/config | 1 + picom/install.sh | 13 +++++---- player/install.sh | 0 python/install.sh | 16 +++++++---- suckless/config/config | 1 + thunar/install.sh | 0 ubuntu/config | 14 --------- ubuntu/install-base.sh | 6 ---- ubuntu/install-cuda.sh | 14 --------- 28 files changed, 183 insertions(+), 67 deletions(-) rename {office => apps}/config/zathura/zathurarc (100%) create mode 100755 apps/docker.sh rename {office => apps}/install.sh (85%) mode change 100644 => 100755 create mode 100755 apps/keepassxc.sh rename {office => apps}/nextcloud.sh (73%) mode change 100644 => 100755 mode change 100644 => 100755 autologin/install.sh create mode 100755 deeplearning/install.sh create mode 120000 dunst/config/config mode change 100644 => 100755 dunst/install.sh create mode 100644 gui/config/gtk-3.0/settings.ini create mode 100644 gui/config/qt5ct/qt5ct.conf mode change 100644 => 100755 gui/freetype2.sh mode change 100644 => 100755 gui/install.sh mode change 100644 => 100755 gui/theme.sh create mode 100755 mirrors/install.sh create mode 120000 picom/config/config mode change 100644 => 100755 picom/install.sh mode change 100644 => 100755 player/install.sh create mode 120000 suckless/config/config mode change 100644 => 100755 thunar/install.sh delete mode 100755 ubuntu/config delete mode 100755 ubuntu/install-base.sh delete mode 100755 ubuntu/install-cuda.sh diff --git a/office/config/zathura/zathurarc b/apps/config/zathura/zathurarc similarity index 100% rename from office/config/zathura/zathurarc rename to apps/config/zathura/zathurarc diff --git a/apps/docker.sh b/apps/docker.sh new file mode 100755 index 0000000..7c9a7a0 --- /dev/null +++ b/apps/docker.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +DIR=$(readlink -f $(dirname $0)) +. $DIR/../env.sh + + +# install docker +case "$PM" in + apt) + sudo apt install -y docker.io docker-compose + ! which pip3 && $ROOT/python/install.sh + sudo pip3 install docker-compose + ;; + pacman) + sudo pacman -S docker docker-compose + ;; +esac + +sudo systemctl enable docker +sudo systemctl start docker + +# configuration +sudo usermod -aG docker $USER diff --git a/office/install.sh b/apps/install.sh old mode 100644 new mode 100755 similarity index 85% rename from office/install.sh rename to apps/install.sh index cd663a4..34611d7 --- a/office/install.sh +++ b/apps/install.sh @@ -11,7 +11,6 @@ case "$PM" in chromium-browser \ zathura zathura-pdf-poppler sxiv \ flameshot \ - keepassxc \ libreoffice \ gimp ;; @@ -20,11 +19,10 @@ case "$PM" in chromium \ zathura zathura-pdf-mupdf sxiv\ flameshot \ - keepassxc \ libreoffice-fresh \ gimp ;; esac # symlink configuration -lnsf $DIR/config/zathura ~/.config/zathura \ No newline at end of file +lnsf $DIR/config/zathura ~/.config/zathura diff --git a/apps/keepassxc.sh b/apps/keepassxc.sh new file mode 100755 index 0000000..984a00c --- /dev/null +++ b/apps/keepassxc.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +DIR=$(readlink -f $(dirname $0)) +. $DIR/../env.sh + + +# install nextcloud +case "$PM" in + apt) + sudo add-apt-repository -y ppa:phoerious/keepassxc + sudo apt-get update + sudo apt install -y keepassxc + ;; + pacman) + sudo pacman -S keepassxc + ;; +esac + diff --git a/office/nextcloud.sh b/apps/nextcloud.sh old mode 100644 new mode 100755 similarity index 73% rename from office/nextcloud.sh rename to apps/nextcloud.sh index 7ccd77b..24f9661 --- a/office/nextcloud.sh +++ b/apps/nextcloud.sh @@ -7,9 +7,7 @@ DIR=$(readlink -f $(dirname $0)) # install nextcloud case "$PM" in apt) - echo TODO - exit -1 - sudo add-apt-repository ppa:nextcloud-devs/client + sudo add-apt-repository -y ppa:nextcloud-devs/client sudo apt-get update sudo apt install -y nextcloud-client ;; diff --git a/autologin/install.sh b/autologin/install.sh old mode 100644 new mode 100755 index 931bc52..01d73b4 --- a/autologin/install.sh +++ b/autologin/install.sh @@ -3,11 +3,11 @@ DIR=$(readlink -f $(dirname $0)) . $DIR/../env.sh -read -l -P 'Please enter autologin username (empty to skip): ' username +read -p 'Please enter autologin username (empty to skip): ' username if [ -z "$username" ]; then echo skip autologin setup else sudo mkdir -p /etc/systemd/system/getty@tty1.service.d sed -r "s/USERNAME/$username/g" $DIR/systemd/getty1-override.conf | \ sudo tee /etc/systemd/system/getty@tty1.service.d/override.conf -fi \ No newline at end of file +fi diff --git a/autologin/systemd/getty1-override.conf b/autologin/systemd/getty1-override.conf index 558822e..e28931c 100644 --- a/autologin/systemd/getty1-override.conf +++ b/autologin/systemd/getty1-override.conf @@ -1,3 +1,4 @@ [Service] ExecStart= -ExecStart=-/usr/bin/agetty --autologin USERNAME --noclear %I $TERM +#ExecStart=-/usr/bin/agetty --autologin USERNAME --noclear %I $TERM +ExecStart=-/sbin/agetty --autologin USERNAME --noclear %I $TERM diff --git a/deeplearning/install.sh b/deeplearning/install.sh new file mode 100755 index 0000000..919d1ec --- /dev/null +++ b/deeplearning/install.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +DIR=$(readlink -f $(dirname $0)) +. $DIR/../env.sh + + +$ROOT/python/install.sh + +# install deep learning tools +case "$PM" in + apt) + # cuda dependencies + sudo apt install linux-headers-$(uname -r) + + source /etc/lsb-release + if [ "$DISTRIB_RELEASE" = "18.04" ] && [ "$(uname -m)" = 'x86_64' ]; then + wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin + sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 + sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub + sudo add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /" + sudo apt-get update + sudo apt-get -y install cuda + elif [ "$DISTRIB_RELEASE" = "20.04" ]; then + sudo apt install nvidia-cuda-toolkit + else + echo 'Unsupported release' + exit -1 + fi + ;; + pacman) + echo TODO + exit -1 + ;; +esac + diff --git a/dunst/config/config b/dunst/config/config new file mode 120000 index 0000000..593f4c5 --- /dev/null +++ b/dunst/config/config @@ -0,0 +1 @@ +/home/klesh/dotfiles/dunst/config \ No newline at end of file diff --git a/dunst/install.sh b/dunst/install.sh old mode 100644 new mode 100755 index 99933a4..88fa04e --- a/dunst/install.sh +++ b/dunst/install.sh @@ -3,9 +3,6 @@ DIR=$(readlink -f $(dirname $0)) . $DIR/../env.sh -# check dependencies -! which yarnpkg && $ROOT/nodejs/install.sh - # install nvim case "$PM" in apt) diff --git a/env.sh b/env.sh index 2f905d0..64e54d2 100755 --- a/env.sh +++ b/env.sh @@ -41,7 +41,7 @@ fish-is-default-shell () { } has-bluetooth () { - dmesg | grep -i blue + dmesg | grep -i bluetooth } @@ -65,4 +65,4 @@ case "$PM" in axel \ man sudo ;; -esac \ No newline at end of file +esac diff --git a/gui/config/gtk-3.0/settings.ini b/gui/config/gtk-3.0/settings.ini new file mode 100644 index 0000000..29ca760 --- /dev/null +++ b/gui/config/gtk-3.0/settings.ini @@ -0,0 +1,15 @@ +[Settings] +gtk-theme-name=Arc-Dark +gtk-icon-theme-name=hicolor +gtk-font-name=Sans 10 +gtk-cursor-theme-name=Adwaita +gtk-cursor-theme-size=0 +gtk-toolbar-style=GTK_TOOLBAR_BOTH +gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR +gtk-button-images=1 +gtk-menu-images=1 +gtk-enable-event-sounds=1 +gtk-enable-input-feedback-sounds=1 +gtk-xft-antialias=1 +gtk-xft-hinting=1 +gtk-xft-hintstyle=hintfull diff --git a/gui/config/qt5ct/qt5ct.conf b/gui/config/qt5ct/qt5ct.conf new file mode 100644 index 0000000..139b271 --- /dev/null +++ b/gui/config/qt5ct/qt5ct.conf @@ -0,0 +1,27 @@ +[Appearance] +color_scheme_path=/usr/share/qt5ct/colors/airy.conf +custom_palette=false +standard_dialogs=default +style=gtk2 + +[Fonts] +fixed=@Variant(\0\0\0@\0\0\0\x14\0U\0R\0W\0 \0G\0o\0t\0h\0i\0\x63@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10) +general=@Variant(\0\0\0@\0\0\0\x14\0U\0R\0W\0 \0G\0o\0t\0h\0i\0\x63@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10) + +[Interface] +activate_item_on_single_click=1 +buttonbox_layout=0 +cursor_flash_time=1000 +dialog_buttons_have_icons=1 +double_click_interval=400 +gui_effects=@Invalid() +keyboard_scheme=2 +menus_have_icons=true +show_shortcuts_in_context_menus=true +stylesheets=@Invalid() +toolbutton_style=4 +underline_shortcut=1 +wheel_scroll_lines=3 + +[SettingsWindow] +geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\x6\0\0\0\"\0\0\au\0\0\x4-\0\0\0\b\0\0\0$\0\0\as\0\0\x4+\0\0\0\x1\0\0\0\0\a\x80\0\0\0\b\0\0\0$\0\0\as\0\0\x4+) diff --git a/gui/freetype2.sh b/gui/freetype2.sh old mode 100644 new mode 100755 diff --git a/gui/install.sh b/gui/install.sh old mode 100644 new mode 100755 index cd1be73..29cf6b5 --- a/gui/install.sh +++ b/gui/install.sh @@ -12,6 +12,7 @@ case "$PM" in fonts-droid-fallback \ fonts-cascadia-code \ ttf-dejavu \ + fonts-urw-base35 \ gucharmap # network manager sudo apt install \ @@ -20,8 +21,8 @@ case "$PM" in if has-bluetooth; then sudo apt install \ bluez bluez-tools blueman pulseaudio-module-bluetooth - systemctl enable bluetooth - systemctl start bluetooth + sudo systemctl enable bluetooth + sudo systemctl start bluetooth fi ;; pacman) @@ -47,8 +48,8 @@ case "$PM" in if has-bluetooth; then sudo pacman -S \ bluez bluez-utils blueman pulseaudio-bluetooth xorg-xbacklight - systemctl enable bluetooth - systemctl start bluetooth + sudo systemctl enable bluetooth + sudo systemctl start bluetooth fi ;; esac diff --git a/gui/theme.sh b/gui/theme.sh old mode 100644 new mode 100755 index 1de9ffe..3d3c279 --- a/gui/theme.sh +++ b/gui/theme.sh @@ -13,4 +13,8 @@ case "$PM" in sudo pacman -S \ lxappearance arc-gtk-theme arc-icon-theme qt5ct qt5-styleplugins ;; -esac \ No newline at end of file +esac + +# configuration +lnsf $DIR/config/gtk-3.0/settings.ini ~/.config/gtk-3.0/settings.ini +lnsf $DIR/config/qt5ct/qt5ct.conf ~/.config/qt5ct/qt5ct.conf diff --git a/mirrors/install.sh b/mirrors/install.sh new file mode 100755 index 0000000..427e8fc --- /dev/null +++ b/mirrors/install.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +DIR=$(readlink -f $(dirname $0)) +. $DIR/../env.sh + + +! in-china && echo 'Skip mirrors configuration' && exit + +# setup package mirror for CHINA +case "$PM" in + apt) + # backup original sources.list + [ ! -f /etc/apt/sources.list.bak ] && \ + sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak + # replace with aliyun mirror + awk '$0 ~ /^deb/ {$2="https://mirrors.aliyun.com/ubuntu/"; print}' /etc/apt/sources.list.bak | sudo tee /etc/apt/sources.list + sudo apt update + ;; + pacman) + echo TODO + exit -1 + ;; +esac + + diff --git a/nodejs/install.sh b/nodejs/install.sh index 404054d..2f2bf03 100755 --- a/nodejs/install.sh +++ b/nodejs/install.sh @@ -7,7 +7,7 @@ DIR=$(readlink -f $(dirname $0)) # install nodejs and yarn case "$PM" in apt) - sudo apt install nodejs yarnpkg + sudo apt install -y nodejs yarnpkg ;; pacman) sudo pacman -S nodejs yarn diff --git a/nvim/install.sh b/nvim/install.sh index 3ea09a0..a2918f4 100755 --- a/nvim/install.sh +++ b/nvim/install.sh @@ -19,5 +19,5 @@ case "$PM" in esac # symlink configuration -lnsf $DIR/config ~/.config/nvim +lnsf $DIR/config/init.vim ~/.config/nvim/init.vim lnsf $DIR/config/init.vim ~/.vimrc diff --git a/picom/config/config b/picom/config/config new file mode 120000 index 0000000..2347e4b --- /dev/null +++ b/picom/config/config @@ -0,0 +1 @@ +/home/klesh/dotfiles/picom/config \ No newline at end of file diff --git a/picom/install.sh b/picom/install.sh old mode 100644 new mode 100755 index 6cd8402..108a573 --- a/picom/install.sh +++ b/picom/install.sh @@ -3,7 +3,7 @@ DIR=$(readlink -f $(dirname $0)) . $DIR/../env.sh -$PICOM_VER=v8.1 +PICOM_VER=v8.1 # install ranger @@ -11,9 +11,9 @@ case "$PM" in apt) # install build tools ! which pip3 && $ROOT/python/install.sh - sudo pip install ninja-build meson + sudo pip3 install meson # install dependencies - sudo apt install libxext-dev libxcb1-dev libxcb-damage0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-render-util0-dev libxcb-render0-dev libxcb-randr0-dev libxcb-composite0-dev libxcb-image0-dev libxcb-present-dev libxcb-xinerama0-dev libxcb-glx0-dev libpixman-1-dev libdbus-1-dev libconfig-dev libgl1-mesa-dev libpcre2-dev libevdev-dev uthash-dev libev-dev libx11-xcb-dev + sudo apt install -y ninja-build libxext-dev libxcb1-dev libxcb-damage0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-render-util0-dev libxcb-render0-dev libxcb-randr0-dev libxcb-composite0-dev libxcb-image0-dev libxcb-present-dev libxcb-xinerama0-dev libxcb-glx0-dev libpixman-1-dev libdbus-1-dev libconfig-dev libgl1-mesa-dev libpcre3-dev libevdev-dev uthash-dev libev-dev libx11-xcb-dev # download picom source [ ! -f /tmp/picom.tar.gz ] && \ curl -L https://github.com/yshui/picom/archive/v8.1.tar.gz --output /tmp/picom.tar.gz @@ -21,9 +21,10 @@ case "$PM" in mkdir -p /tmp/picom tar zxvf /tmp/picom.tar.gz --strip 1 -C /tmp/picom pushd /tmp/picom - git submodule update --init --recursive + #git submodule update --init --recursive meson --buildtype=release . build - ninja -C build install + sudo ninja -C build install + popd ;; pacman) sudo pacman -S picom @@ -31,4 +32,4 @@ case "$PM" in esac # symlink configuration -lnsf $DIR/config ~/.config/picom \ No newline at end of file +lnsf $DIR/config ~/.config/picom diff --git a/player/install.sh b/player/install.sh old mode 100644 new mode 100755 diff --git a/python/install.sh b/python/install.sh index f9085e2..40d4efe 100755 --- a/python/install.sh +++ b/python/install.sh @@ -3,6 +3,15 @@ DIR=$(readlink -f $(dirname $0)) . $DIR/../env.sh +# config pip mirror for CHINA +if in-china; then + lnsf $DIR/pip.conf ~/.pip/pip.conf + if sudo [ ! -f /root/.pip/pip.conf ]; then + sudo mkdir -p /root/.pip + sudo cp $DIR/pip.conf /root/.pip/pip.conf + fi +fi + # install python3 case "$PM" in apt) @@ -16,11 +25,6 @@ case "$PM" in esac # enable auto_activation plugin for virtualfish -fish-is-default-shell && fish -c "vf addplugins auto_activation" +fish-is-default-shell && fish -c "yes | vf install && vf addplugins auto_activation" -# config pip mirror for CHINA -if in-china; then - mkdir -p ~/.pip - ln -sf $DIR/pip.conf ~/.pip/pip.conf -fi diff --git a/suckless/config/config b/suckless/config/config new file mode 120000 index 0000000..66a656d --- /dev/null +++ b/suckless/config/config @@ -0,0 +1 @@ +/home/klesh/dotfiles/suckless/config \ No newline at end of file diff --git a/thunar/install.sh b/thunar/install.sh old mode 100644 new mode 100755 diff --git a/ubuntu/config b/ubuntu/config deleted file mode 100755 index bd8086d..0000000 --- a/ubuntu/config +++ /dev/null @@ -1,14 +0,0 @@ -# To use common configuration in %APPDATA%\mintty, simply remove this file -ThemeFile=rosipov -Font=Microsoft YaHei Mono -FontHeight=14 -Term=xterm-256color -CursorType=block -Columns=120 -Rows=40 -Language=zh_CN -Locale=C -Transparency=medium -CtrlShiftShortcuts=yes -Scrollbar=none -PgUpDnScroll=yes diff --git a/ubuntu/install-base.sh b/ubuntu/install-base.sh deleted file mode 100755 index 1d22c43..0000000 --- a/ubuntu/install-base.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -e -sudo apt update -sudo apt upgrade --fix-missing -y -q -sudo apt install build-essential automake pkg-config software-properties-common curl -y -q diff --git a/ubuntu/install-cuda.sh b/ubuntu/install-cuda.sh deleted file mode 100755 index 7e98c1d..0000000 --- a/ubuntu/install-cuda.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -set -e -sudo apt install linux-headers-$(uname -r) - -source /etc/lsb-release -if [ "$DISTRIB_RELEASE" = "18.04" ] && [ "$(uname -m)" = 'x86_64' ]; then - wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin - sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 - sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub - sudo add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /" - sudo apt-get update - sudo apt-get -y install cuda -fi