added picom and oh-my-zsh settings

This commit is contained in:
paul-loedige
2024-02-18 22:36:26 +01:00
parent 0d61e04770
commit 46fc22f556
+166 -23
View File
@@ -606,6 +606,39 @@ main_bar_height=24 if chassis_type == ChassisType.LAPTOP else 28
secondary_bar_height=24 secondary_bar_height=24
secondary_bar_fontsize=18 secondary_bar_fontsize=18
#+end_src #+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 *** Chassis Type Detection
Needed to load correct settings for given hardware (laptop/desktop) Needed to load correct settings for given hardware (laptop/desktop)
**** chassis_type.py Literate File Header **** chassis_type.py Literate File Header
@@ -658,7 +691,7 @@ import os
@hook.subscribe.startup_once @hook.subscribe.startup_once
def autostart(): def autostart():
home = os.path.expanduser('~/.config/autostart.sh') home = os.path.expanduser('~/.config/autostart.sh')
subprocess.call([home]) subprocess.call(['sh', home])
#+end_src #+end_src
*** Custom Microphone Widgets *** Custom Microphone Widgets
Based on the [[https://docs.qtile.org/en/stable/manual/ref/widgets.html#volume][Volume]] widget. 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' name = 'Terminal'
dropdown_groups_info.append((name, dropdown_groups_info.append((name,
DropDown(name, DropDown(name,
term term,
height = 0.5,
width = 0.8,
x = .1
), ),
['mod1','control'],'space')) ['mod1','control'],'space'))
#+end_src #+end_src
@@ -1230,13 +1266,13 @@ dropdown_groups_info.append((name,
#+end_src #+end_src
***** WhatsApp ***** WhatsApp
#+begin_src conf :tangle pkg-list.txt #+begin_src conf :tangle pkg-list.txt
whatsapp-nativefier whatsapp-for-linux
#+end_src #+end_src
#+begin_src python :tangle ~/.config/qtile/config.py :mkdirp yes #+begin_src python :tangle ~/.config/qtile/config.py :mkdirp yes
name = 'WhatsApp' name = 'WhatsApp'
dropdown_groups_info.append((name, dropdown_groups_info.append((name,
DropDown(name, DropDown(name,
'whatsapp-nativefier', 'whatsapp-for-linux',
height = 0.5, height = 0.5,
width = 0.8, width = 0.8,
x = .1, x = .1,
@@ -1785,6 +1821,8 @@ install Ubuntu Mono
ttf-ubuntu-font-family ttf-ubuntu-font-family
ttf-ubuntu-mono-nerd ttf-ubuntu-mono-nerd
ttf-ubuntu-nerd ttf-ubuntu-nerd
adobe-source-han-sans-jp-fonts
adobe-source-han-serif-jp-fonts
#+end_src #+end_src
and activate it and activate it
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/doom/config.el #+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/doom/config.el
@@ -2203,16 +2241,27 @@ fi
#+begin_src conf :tangle pkg-list.txt #+begin_src conf :tangle pkg-list.txt
curl curl
#+end_src #+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 #+begin_src shell :tangle update.sh
if [ ! -d "/home/paul/.oh-my-zsh" ]; then if [ ! -d "$HOME/.oh-my-zsh" ]; then
echo "Installing Oh-My-Zsh..." echo "Backing up .zshrc..."
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" 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 fi
#+end_src #+end_src
**** Basic Configuration **** Basic Configuration
#+begin_src shell :tangle ~/.zshrc #+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. # Uncomment the following line to use case-sensitive completion.
CASE_SENSITIVE="false" CASE_SENSITIVE="false"
@@ -2233,6 +2282,47 @@ ENABLE_CORRECTION="true"
COMPLETION_WAITING_DOTS="true" COMPLETION_WAITING_DOTS="true"
#+end_src #+end_src
**** TODO [[https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins][Plugins]] **** 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 #+begin_src shell :tangle ~/.zshrc
# Which plugins would you like to load? # Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/ # Standard plugins can be found in $ZSH/plugins/
@@ -2240,34 +2330,69 @@ COMPLETION_WAITING_DOTS="true"
# Example format: plugins=(rails git textmate ruby lighthouse) # Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup. # Add wisely, as too many plugins slow down shell startup.
plugins=( plugins=(
git adb
svn aliases
themes archlinux
bgnotify
colored-man-pages
command-not-found command-not-found
vi-mode docker
docker-compose
emacs
extract 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 # # non oh-my-zsh plugins
# zsh-autosuggestions # zsh-autosuggestions
# zsh-syntax-highlighting # zsh-syntax-highlighting
# conda-zsh-completion # conda-zsh-completion
) )
#+end_src #+end_src
*** [[https://github.com/romkatv/powerlevel10k][Powerlevel10k]] **** [[https://github.com/romkatv/powerlevel10k][Powerlevel10k]]
install if needed create symlink if needed
#+begin_src conf :tangle pkg-list.txt
git
#+end_src
#+begin_src shell :tangle update.sh #+begin_src shell :tangle update.sh
if [ ! -d "/home/paul/.oh-my-zsh/custom/themes/powerlevel10k" ]; then if [ ! -L "$HOME/.oh-my-zsh/custom/themes/powerlevel10k" ]; then
echo "Installing Powerlevel10k..." echo "Installing Powerlevel10k..."
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git /home/paul/.oh-my-zsh/custom/themes/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 fi
#+end_src #+end_src
set as zsh theme init
#+begin_src shell :tangle .zshrc #+begin_src shell :tangle ~/.zshrc
ZSH_THEME="powerlevel10k/powerlevel10k" 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 #+end_src
**** Source oh-my-zsh
#+begin_src shell :tangle ~/.zshrc
source $ZSH/oh-my-zsh.sh
#+end_src
*** Configuration *** Configuration
**** Source Aliases **** Source Aliases
#+begin_src shell :tangle ~/.zshrc #+begin_src shell :tangle ~/.zshrc
@@ -2334,6 +2459,8 @@ style = "Regular"
#+end_src #+end_src
The size is set via the autostart script depending on the system type (Laptop/Desktop) The size is set via the autostart script depending on the system type (Laptop/Desktop)
#+begin_src shell :mkdirp yes :tangle ~/.config/autostart.sh #+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" # Check if the chassis type is "laptop"
if [ "$chassis_type" == "laptop" ]; then if [ "$chassis_type" == "laptop" ]; then
# set font size for alacritty # set font size for alacritty
@@ -2343,6 +2470,22 @@ else
sed -i 's/size = xx/size = 14/' ~/.config/alacritty/alacritty.toml sed -i 's/size = xx/size = 14/' ~/.config/alacritty/alacritty.toml
fi fi
#+end_src #+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 * Theming
This Config applies the [[https://github.com/gruvbox-community/gruvbox][Gruvbox Theme]] to as many programs as possible This Config applies the [[https://github.com/gruvbox-community/gruvbox][Gruvbox Theme]] to as many programs as possible
** Doom Emacs ** Doom Emacs