Edit .zprofile and dotman.

* dotman
- change interpreter from zsh to sh
- rebuild structure of script
- add logs saved in files
- disable logs in CLI

* .zprofile
- set EDITOR environment variable
This commit is contained in:
Wiktor Zykubek 2020-03-09 19:30:53 +01:00
parent b5608c57d4
commit 3336783a20
3 changed files with 173 additions and 47 deletions

View File

@ -564,3 +564,31 @@ ls botfiles/.config
ga .
gc
gpom
xdpyinfo | grep 'dimensions:'
xrandr | grep '*'
xrandr
xrandr | grep '*' | grep -o '?[0-9]\x?[0-9]'
xrandr | grep '*' | grep -o '?*[0-9]\x?*[0-9]'
xrandr | grep '*' | grep -o '*[0-9]\x*[0-9]'
xrandr | grep '*' | grep -o '*?[0-9]\x*?[0-9]'
xrandr | grep '*' | grep -o '*?[0-9]\x????[0-9]'
xrandr | grep '*' | grep -o '?[0-9]\x????[0-9]'
xrandr | grep '*' | grep -o '????[0-9]\x????[0-9]'
xrandr | grep '*' | grep -o '?**[0-9]\x?**[0-9]'
xrandr | grep '*' | grep -o '?**[0-9]{3}\x?**[0-9]'
xrandr | grep '*' | grep -o '?**[0-9]{4}\x?**[0-9]'
xrandr | grep '*' | grep -o '[0-9]{4}\x?**[0-9]'
xrandr | grep '*' | grep -o '[0-9]*{4}\x?**[0-9]'
cat ~/.scripts/get-local-wificard-ip.sh
xrandr | grep '*' | grep -o '([0-9]){4}\x'
xrandr | grep '*' | grep -o '([0-9]){4}'
xrandr | grep '*' | grep -o '?*([0-9]){4}'
xrandr | grep '*' | grep -o '?*([0-9]*){4}'
xrandr | grep '*' | grep -o '?*([0-9]*){3}'
xrandr | grep '*' | grep -o '?*([0-9]*){1}'
xrandr | grep '*' | grep -o '?*([0-9]*)'
xrandr | grep '*' | grep -o '?*[0-9]*'
xrandr | grep '*' | grep -o '?*[0-9]*x'
xrandr | grep '*' | grep -o '?*[0-9]*x?*[0-9]'
xrandr | grep '*' | grep -o '?*[0-9]*x?*[0-9]*'
pass

View File

@ -0,0 +1,3 @@
#!/usr/bin/zsh
export EDITOR=nvim

181
dotman
View File

@ -1,4 +1,4 @@
#!/usr/bin/zsh
#!/usr/bin/bash
greeter() {
cat <<EOF
@ -10,66 +10,161 @@ greeter() {
EOF
}
greeter
# Logs
LOG_DIR="$HOME/.log/dotfiles/$(date +"%d-%m-%Y-%H:%M:%S")/"
mkdir -p $LOG_DIR
# install git
sudo pacman -S --noconfirm git
install_yay() {
sudo pacman -S --noconfirm --needed git
mkdir -p ~/.cache/dotfiles/
cd ~/.cache/dotfiles/
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si --noconfirm
}
# install yay
mkdir -p ~/.cache/dotfiles/
cd ~/.cache/dotfiles/
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si --noconfirm
install_packages() {
yay -S --noconfirm --needed neovim qutebrowser telegram-desktop minecraft-launcher dunst bspwm sxhkd htop mpd ncmpcpp picom ranger rofi transmission-cli vlc zsh youtube-dl grc curl wget dmenu xclip figlet w3m xorg-server xorg-xinit ttf-font-awesome ttf-dejavu vifm feh xorg-xsetroot lxappearance python-pip alsa-utils tmux networkmanager maim fzf exfat-utils fuse2 udiskie udisks2 imagemagick i3lock-color man checkupdates+aur pacman-contrib polybar ccls clang eslint flake8 shellcheck clang-format-linter-git prettier python-black github-cli &> $LOG_DIR/packages_installation.log
mkdir ~/.log
pip3 install --user -U pynvim msgpack
}
# install all dependencies and packages
yay -S --noconfirm --needed neovim qutebrowser telegram-desktop minecraft-launcher dunst bspwm sxhkd htop mpd ncmpcpp picom ranger rofi transmission-cli vlc zsh youtube-dl grc curl wget dmenu xclip figlet w3m xorg-server xorg-xinit ttf-font-awesome ttf-dejavu vifm feh xorg-xsetroot lxappearance python-pip alsa-utils tmux networkmanager maim fzf exfat-utils fuse2 udiskie udisks2 imagemagick i3lock-color man checkupdates+aur pacman-contrib polybar ccls clang eslint flake8 shellcheck clang-format-linter-git prettier python-black github-cli &> ~/.log/yay.log
install_st() {
cd ~/.cache/dotfiles/
git clone https://gitlab.com/samedamci/st
cd st
sudo make clean install
}
pip3 install --user -U pynvim msgpack
config_pacman() {
su root -c "cat >/etc/pacman.conf <<EOF
# build and install st
cd ~/.cache/dotfiles/
git clone https://gitlab.com/samedamci/st
cd st
sudo make clean install
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
# copy configs
cd ~/Dotfiles/botfiles/.config
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir = /
#DBPath = /var/lib/pacman/
#CacheDir = /var/cache/pacman/pkg/
#LogFile = /var/log/pacman.log
#GPGDir = /etc/pacman.d/gnupg/
#HookDir = /etc/pacman.d/hooks/
HoldPkg = pacman glibc
#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
Architecture = auto
cp -r * ~/.config/
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg =
#IgnoreGroup =
if [ "$HOST" = "pc" ]; then
#NoUpgrade =
#NoExtract =
# Misc options
#UseSyslog
Color
ILoveCandy
TotalDownload
CheckSpace
VerbosePkgLists
# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required
#[testing]
#Include = /etc/pacman.d/mirrorlist
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
#[community-testing]
#Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist
#[multilib-testing]
#Include = /etc/pacman.d/mirrorlist
#[multilib]
#Include = /etc/pacman.d/mirrorlist
EOF"
}
copy_configs() {
cd ~/Dotfiles/botfiles/.config
cp -r * ~/.config/
if [ "$HOST" = "pc" ]; then
echo "Use pc config"
mv ~/.config/polybar/config.pc ~/.config/polybar/config
elif [ "$HOST" = "laptop" ]; then
elif [ "$HOST" = "laptop" ]; then
echo "Use laptop config..."
mv ~/.config/polybar/config.laptop ~/.config/polybar/config
fi
fi
cd ~/Dotfiles/botfiles
mkdir -p ~/.local/share/TelegramDesktop/tdata/
cp shortcuts-custom.json ~/.local/share/TelegramDesktop/tdata
cd ~/Dotfiles/botfiles
mkdir -p ~/.local/share/TelegramDesktop/tdata/
cp shortcuts-custom.json ~/.local/share/TelegramDesktop/tdata
cp .zshrc .aliases .zprofile .Xresources .xinitrc ~/
cp -r .scripts ~/
chmod +x ~/.scripts/*
cp .zshrc .aliases .zprofile .Xresources .xinitrc ~/
cp -r .scripts ~/
chmod +x ~/.scripts/*
chsh -s /usr/bin/zsh
cd ~/.config/zsh
rm -rf plugins
mkdir plugins
cd plugins
cd ~/.config/zsh
rm -rf plugins
mkdir plugins
cd plugins
git clone https://github.com/zsh-users/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions
# udisk config
sudo mkdir /media
su root -c "echo 'ENV{ID_FS_USAGE}==\"filesystem|other|crypto\", ENV{UDISKS_FILESYSTEM_SHARED}=\"1\"' > /etc/udev/rules.d/99-udisks2.rules && echo 'D /media 0755 root root 0 -' > /etc/tmpfiles.d/media.conf"
sudo mkdir /media
}
# manual configuration
sudo -v
clear
echo "Please edit /etc/pacman.conf and uncomment 'Colors' and write 'ILoveCandy'."
greeter
printf "\nDo you want to install yay? (Y/n): "; read CHOICE
if [ "$CHOICE" = "Y" ]; then echo "Installing yay..." && install_yay &>$LOG_DIR/install_yay.log; fi
clear
greeter
printf "\nDo you want to install packages? (Y/n): "; read CHOICE
if [ "$CHOICE" = "Y" ]; then echo "Installing packages..." && install_packages &>$LOG_DIR/install_packages.log; fi
clear
greeter
printf "\nDo you want to compile nad install st? (Y/n): "; read CHOICE
if [ "$CHOICE" = "Y" ]; then echo "Compiling and nstalling st..." && install_st &>$LOG_DIR/install_st.log; fi
clear
greeter
printf "\nDo you want to copy configs? (Y/n): "; read CHOICE
if [ "$CHOICE" = "Y" ]; then
printf "Moving configs...\n"
copy_configs &>$LOG_DIR/copy_configs.log
printf "\n"
chsh -s /usr/bin/zsh
printf "\nConfiguring udiskie.\n"
su root -c "echo 'ENV{ID_FS_USAGE}==\"filesystem|other|crypto\", ENV{UDISKS_FILESYSTEM_SHARED}=\"1\"' > /etc/udev/rules.d/99-udisks2.rules && echo 'D /media 0755 root root 0 -' > /etc/tmpfiles.d/media.conf"
printf "\nConfiguring pacman.\n"
config_pacman
fi
clear
greeter