From 46fc22f55625036d1f6982deb7b3fbade8fdf049 Mon Sep 17 00:00:00 2001 From: paul-loedige Date: Sun, 18 Feb 2024 22:36:26 +0100 Subject: [PATCH] added picom and oh-my-zsh settings --- config.org | 189 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 166 insertions(+), 23 deletions(-) diff --git a/config.org b/config.org index 71631a3..393d8c8 100644 --- a/config.org +++ b/config.org @@ -606,6 +606,39 @@ main_bar_height=24 if chassis_type == ChassisType.LAPTOP else 28 secondary_bar_height=24 secondary_bar_fontsize=18 #+end_src +*** Compositor +[[https://github.com/yshui/picom][picom]] is used to enable window composition, transparency, etc. +**** Installation +#+begin_src shell :tangle pkg-list.txt +picom +#+end_src +**** Configuration +#+begin_src conf :tangle ~/.config/picom/picom.conf :mkdirp yes +# DO NOT EDIT THIS FILE DIRECTLY +# This is a file generated from a literate programing source file +# You should make any changes there and regenerate it from Emacs org-mode +# using org-babel-tangle (C-c C-v t) + +#+end_src +***** Shadows +disable shadow +#+begin_src conf :tangle ~/.config/picom/picom.conf :mkdirp yes +shadow = false; +#+end_src +***** Rounded Corners +exclude Dock and Desktop from corner rounding +#+begin_src conf :tangle ~/.config/picom/picom.conf :mkdirp yes +rounded-corners-exclude = [ + "window_type = 'dock'", + "window_type = 'desktop'" +] +#+end_src + +**** Add to Autostart +#+begin_src shell :tangle ~/.autostart.sh +picom & +#+end_src + *** Chassis Type Detection Needed to load correct settings for given hardware (laptop/desktop) **** chassis_type.py Literate File Header @@ -658,7 +691,7 @@ import os @hook.subscribe.startup_once def autostart(): home = os.path.expanduser('~/.config/autostart.sh') - subprocess.call([home]) + subprocess.call(['sh', home]) #+end_src *** Custom Microphone Widgets Based on the [[https://docs.qtile.org/en/stable/manual/ref/widgets.html#volume][Volume]] widget. @@ -1173,7 +1206,10 @@ dropdown_groups_info.append((name, name = 'Terminal' dropdown_groups_info.append((name, DropDown(name, - term + term, + height = 0.5, + width = 0.8, + x = .1 ), ['mod1','control'],'space')) #+end_src @@ -1230,13 +1266,13 @@ dropdown_groups_info.append((name, #+end_src ***** WhatsApp #+begin_src conf :tangle pkg-list.txt -whatsapp-nativefier +whatsapp-for-linux #+end_src #+begin_src python :tangle ~/.config/qtile/config.py :mkdirp yes name = 'WhatsApp' dropdown_groups_info.append((name, DropDown(name, - 'whatsapp-nativefier', + 'whatsapp-for-linux', height = 0.5, width = 0.8, x = .1, @@ -1785,6 +1821,8 @@ install Ubuntu Mono ttf-ubuntu-font-family ttf-ubuntu-mono-nerd ttf-ubuntu-nerd +adobe-source-han-sans-jp-fonts +adobe-source-han-serif-jp-fonts #+end_src and activate it #+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/doom/config.el @@ -2203,16 +2241,27 @@ fi #+begin_src conf :tangle pkg-list.txt curl #+end_src -install if needed +Install if needed +Notes: +Because the tangled ~.zshrc~ already would usually be overwritten it needs to be backed up and restored. +Also, the ~$ZSH~ variable needs to be unset to avoid errors during installation #+begin_src shell :tangle update.sh -if [ ! -d "/home/paul/.oh-my-zsh" ]; then - echo "Installing Oh-My-Zsh..." - sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" +if [ ! -d "$HOME/.oh-my-zsh" ]; then + echo "Backing up .zshrc..." + mv ~/.zshrc ~/.zshrc-tmp + echo "Installing Oh-My-Zsh..." + unset ZSH + sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" + if [ -e "$HOME/.zshrc.pre-oh-my-zsh" ]; then + rm ~/.zshrc.pre-oh-my-zsh + fi + echo "Restoring .zshrc..." + mv ~/.zshrc-tmp ~/.zshrc fi #+end_src **** Basic Configuration #+begin_src shell :tangle ~/.zshrc -export ZSH="~/.oh-my-zsh" +export ZSH="$HOME/.oh-my-zsh" # Uncomment the following line to use case-sensitive completion. CASE_SENSITIVE="false" @@ -2233,6 +2282,47 @@ ENABLE_CORRECTION="true" COMPLETION_WAITING_DOTS="true" #+end_src **** TODO [[https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins][Plugins]] +***** Dependencies +some of the following plugins require dependencies +#+begin_src shell :tangle pkg-list.txt +#for bgnotify +libnotify +fd +fzf +github-cli +#+end_src +***** Symlink External Plugins +****** [[https://github.com/conda-incubator/conda-zsh-completion][conda-zsh-completion]] +#+begin_src shell :tangle update.sh +if [ ! -L "$HOME/.oh-my-zsh/custom/plugins/conda-zsh-completion" ]; then + echo "Installing conda-zsh-completion..." + if [ ! -d "$HOME/.oh-my-zsh/custom/plugins" ]; then + mkdir -p ~/.oh-my-zsh/custom/plugins + fi + ln -s ~/.dotfiles/zsh/.oh-my-zsh/custom/plugins/conda-zsh-completion ~/.oh-my-zsh/custom/plugins/conda-zsh-completion +fi +#+end_src +****** [[https://github.com/zsh-users/zsh-autosuggestions][zsh-autosuggestions]] +#+begin_src shell :tangle update.sh +if [ ! -L "$HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions" ]; then + echo "Installing conda-zsh-completion..." + if [ ! -d "$HOME/.oh-my-zsh/custom/plugins" ]; then + mkdir -p ~/.oh-my-zsh/custom/plugins + fi + ln -s ~/.dotfiles/zsh/.oh-my-zsh/custom/plugins/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions +fi +#+end_src +****** [[https://github.com/zsh-users/zsh-syntax-highlighting][zsh-syntax-highlighting]] +#+begin_src shell :tangle update.sh +if [ ! -L "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting" ]; then + echo "Installing conda-zsh-completion..." + if [ ! -d "$HOME/.oh-my-zsh/custom/plugins" ]; then + mkdir -p ~/.oh-my-zsh/custom/plugins + fi + ln -s ~/.dotfiles/zsh/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting +fi +#+end_src +***** Install Plugins #+begin_src shell :tangle ~/.zshrc # Which plugins would you like to load? # Standard plugins can be found in $ZSH/plugins/ @@ -2240,34 +2330,69 @@ COMPLETION_WAITING_DOTS="true" # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. plugins=( - git - svn - themes + adb + aliases + archlinux + bgnotify + colored-man-pages command-not-found - vi-mode + docker + docker-compose + emacs extract + fd + gh + git + git-auto-fetch + git-lfs + isodate + nmap + pip + pipenv + python + ripgrep + rsync + svn + systemd + themes + vi-mode + vscode # # non oh-my-zsh plugins # zsh-autosuggestions # zsh-syntax-highlighting # conda-zsh-completion ) #+end_src -*** [[https://github.com/romkatv/powerlevel10k][Powerlevel10k]] -install if needed -#+begin_src conf :tangle pkg-list.txt -git -#+end_src +**** [[https://github.com/romkatv/powerlevel10k][Powerlevel10k]] +create symlink if needed #+begin_src shell :tangle update.sh -if [ ! -d "/home/paul/.oh-my-zsh/custom/themes/powerlevel10k" ]; then - echo "Installing Powerlevel10k..." - git clone --depth=1 https://github.com/romkatv/powerlevel10k.git /home/paul/.oh-my-zsh/custom/themes/powerlevel10k +if [ ! -L "$HOME/.oh-my-zsh/custom/themes/powerlevel10k" ]; then + echo "Installing Powerlevel10k..." + if [ ! -d "$HOME/.oh-my-zsh/custom/themes" ]; then + mkdir -p ~/.oh-my-zsh/custom/themes + fi + ln -s ~/.dotfiles/zsh/.oh-my-zsh/custom/themes/powerlevel10k ~/.oh-my-zsh/custom/themes/powerlevel10k fi #+end_src -set as zsh theme -#+begin_src shell :tangle .zshrc +init +#+begin_src shell :tangle ~/.zshrc ZSH_THEME="powerlevel10k/powerlevel10k" +[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh +#+end_src +***** Config +create symlink if needed. +The config file was created via the ~p10k configure~ command +#+begin_src shell :tangle update.sh +if [ ! -L "$HOME/.p10k.zsh" ]; then + echo "Configuring Powerlevel10k..." + ln -s ~/.dotfiles/zsh/.p10k.zsh ~/.p10k.zsh +fi #+end_src +**** Source oh-my-zsh +#+begin_src shell :tangle ~/.zshrc +source $ZSH/oh-my-zsh.sh +#+end_src *** Configuration **** Source Aliases #+begin_src shell :tangle ~/.zshrc @@ -2334,6 +2459,8 @@ style = "Regular" #+end_src The size is set via the autostart script depending on the system type (Laptop/Desktop) #+begin_src shell :mkdirp yes :tangle ~/.config/autostart.sh +# Use hostnamectl to get system information +chassis_type=$(hostnamectl status | grep "Chassis:" | awk '{print $2}') # Check if the chassis type is "laptop" if [ "$chassis_type" == "laptop" ]; then # set font size for alacritty @@ -2343,6 +2470,22 @@ else sed -i 's/size = xx/size = 14/' ~/.config/alacritty/alacritty.toml fi #+end_src +since ~update.sh~ will reset the font size value. This also needs to be set in there +#+begin_src shell :tangle update.sh +# Use hostnamectl to get system information +chassis_type=$(hostnamectl status | grep "Chassis:" | awk '{print $2}') +# Check if the chassis type is "laptop" +if [ "$chassis_type" == "laptop" ]; then + # set font size for alacritty + sed -i 's/size = xx/size = 11/' ~/.config/alacritty/alacritty.toml +else + # set font size for alacritty + sed -i 's/size = xx/size = 14/' ~/.config/alacritty/alacritty.toml +fi +#+end_src + +#+RESULTS: + * Theming This Config applies the [[https://github.com/gruvbox-community/gruvbox][Gruvbox Theme]] to as many programs as possible ** Doom Emacs