From e328fa2d75a2e08c225d9c2d9b3267c8f4c1be37 Mon Sep 17 00:00:00 2001 From: winston Date: Wed, 19 Oct 2022 07:06:29 +0200 Subject: [PATCH] chore: linux tweaks --- dot_config/picom.conf | 38 ++++++++++++------------- dot_config/wezterm/wezterm.lua | 21 ++++++++++++-- dot_config/zsh/dot_zshenv | 16 +++++++---- dot_local/bin/executable_launch_polybar | 5 ++-- 4 files changed, 49 insertions(+), 31 deletions(-) diff --git a/dot_config/picom.conf b/dot_config/picom.conf index 7b28933..6eaa221 100644 --- a/dot_config/picom.conf +++ b/dot_config/picom.conf @@ -8,22 +8,22 @@ # unless explicitly requested using the wintypes option. # # shadow = false -shadow = true +shadow = true; # The blur radius for shadows, in pixels. (defaults to 12) # shadow-radius = 12 -shadow-radius = 8 +shadow-radius = 7; # The opacity of shadows. (0.0 - 1.0, defaults to 0.75) -shadow-opacity = .5 +# shadow-opacity = .75 # The left offset for shadows, in pixels. (defaults to -15) # shadow-offset-x = -15 -shadow-offset-x = -7 +shadow-offset-x = -7; # The top offset for shadows, in pixels. (defaults to -15) # shadow-offset-y = -15 -shadow-offset-y = -7 +shadow-offset-y = -7; # Red color value of shadow (0.0 - 1.0, defaults to 0). # shadow-red = 0 @@ -73,7 +73,7 @@ shadow-exclude = [ # Fade windows in/out when opening/closing and when opacity changes, # unless no-fading-openclose is used. # fading = false -fading = false; +fading = true; # Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028) # fade-in-step = 0.028 @@ -103,11 +103,11 @@ fade-out-step = 0.03; # Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0) # inactive-opacity = 1 -#inactive-opacity = 0.8; +inactive-opacity = 0.97; # Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default) # frame-opacity = 1.0 -#frame-opacity = 1.0; +frame-opacity = 1; # Let inactive opacity set by -i override the '_NET_WM_WINDOW_OPACITY' values of windows. # inactive-opacity-override = true @@ -115,13 +115,14 @@ inactive-opacity-override = false; # Default opacity for active windows. (0.0 - 1.0, defaults to 1.0) # active-opacity = 1.0 +active-opacity = 0.97; # Dim inactive windows. (0.0 - 1.0, defaults to 0.0) # inactive-dim = 0.0 # Specify a list of conditions of windows that should never be considered focused. # focus-exclude = [] -focus-exclude = []; +focus-exclude = [ "class_g = 'Cairo-clock'" ]; # Use fixed inactive dim value, instead of adjusting according to window opacity. # inactive-dim-fixed = 1.0 @@ -143,7 +144,7 @@ focus-exclude = []; # Sets the radius of rounded window corners. When > 0, the compositor will # round the corners of windows. Does not interact well with # `transparent-clipping`. -# corner-radius = 20; +corner-radius = 0 # Exclude conditions for rounded corners. rounded-corners-exclude = [ @@ -163,8 +164,7 @@ rounded-corners-exclude = [ # # blur-deviation = false # -blur-method = "dual_kawase" -blur-strength = 2 +# blur-strength = 5 # Blur background of semi-transparent / ARGB windows. # Bad in performance, with driver-dependent behavior. @@ -181,7 +181,7 @@ blur-strength = 2 # Use fixed blur strength rather than adjusting according to window opacity. -blur-background-fixed = true +# blur-background-fixed = false # Specify the blur convolution kernel, with the following format: @@ -195,18 +195,16 @@ blur-kern = "3x3box"; # Exclude conditions for background blur. # blur-background-exclude = [] blur-background-exclude = [ - # "window_type = 'dock'", - # "window_type = 'desktop'", - # "_GTK_FRAME_EXTENTS@:c" + "window_type = 'dock'", + "window_type = 'desktop'", + "_GTK_FRAME_EXTENTS@:c" ]; +blur-method = "dual_kawase"; ################################# # General Settings # ################################# -# Enable remote control via D-Bus. See the man page for more details. -# dbus = true - # Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers. # daemon = false @@ -299,7 +297,7 @@ detect-transient = true; # practically happened) and may not work with blur-background. # My tests show a 15% performance boost. Recommended. # -# glx-no-stencil = false +glx-no-stencil = true; # GLX backend: Avoid rebinding pixmap on window damage. # Probably could improve performance on rapid window content changes, diff --git a/dot_config/wezterm/wezterm.lua b/dot_config/wezterm/wezterm.lua index e7123f7..d0eb525 100644 --- a/dot_config/wezterm/wezterm.lua +++ b/dot_config/wezterm/wezterm.lua @@ -4,6 +4,10 @@ local wezterm = require("wezterm") -- fonts I like, with the settings I prefer {{{ -- kept seperately from the rest of the config so that I can easily change them local fonts = { + berkeley = { + font = "Berkeley Mono", + size = 16, + }, comic = { font = "Comic Code Ligatures", size = 18, @@ -194,15 +198,22 @@ wezterm.on("update-status", function(window, pane) end) -- }}} +local darkTheme = "Catppuccin Frappe" +local lightTheme = "Catppuccin Latte" + local function scheme_for_appearance(appearance) + wezterm.log_info(appearance) + if string.match(wezterm.target_triple, "linux") then + return darkTheme + end if appearance:find("Dark") then - return "Catppuccin Frappe" + return darkTheme else - return "Catppuccin Latte" + return lightTheme end end -local font = get_font("victor") +local font = get_font("berkeley") local act = wezterm.action return { @@ -331,6 +342,10 @@ return { top = 0, bottom = 0, }, + inactive_pane_hsb = { + saturation = 1.0, + brightness = 0.8, + }, -- don't attempt to resize the window (tiling wm) adjust_window_size_when_changing_font_size = false, -- theme diff --git a/dot_config/zsh/dot_zshenv b/dot_config/zsh/dot_zshenv index 21bf5ad..64af220 100644 --- a/dot_config/zsh/dot_zshenv +++ b/dot_config/zsh/dot_zshenv @@ -1,11 +1,12 @@ # vim:ft=zsh:fenc=utf-8:fdm=marker ### COMMON ### -export EDITOR=nvim +export EDITOR="nvim" export HISTFILE="$HOME/.config/zsh/history" # don't write a less history -export LESSHISTFILE=- +export LESSHISTFILE="-" export GNUPGHOME="$HOME/.config/gnupg" +export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc" # check if .local/bin is directory, if not create it if [ ! -d "$HOME/.local/bin" ]; then @@ -17,14 +18,16 @@ if [ -d "/usr/local/sbin" ]; then export PATH="/usr/local/sbin:$PATH" fi -### LINUX ### - TODO: replace with chezmoi os check +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_DATA_HOME="$HOME/.local/share" +export XDG_CACHE_HOME="$HOME/.cache" + +### Linux if [[ $(uname -s) == "Linux" ]]; then BROWSER="$(which firefox)" export BROWSER fi - -### MACOS ### -export XDG_CONFIG_HOME="$HOME/.config" +### MacOS if [[ -x "$(command -v brew)" ]]; then export PATH="/opt/homebrew/sbin:$PATH" fi @@ -56,6 +59,7 @@ fi export PATH="$PATH:$CARGO_HOME/bin" ### NODE ### +export NPM_CONFIG_USERCONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/npm/npmrc" export NODE_REPL_HISTORY="" export NVM_DIR="$HOME/.local/share/nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" diff --git a/dot_local/bin/executable_launch_polybar b/dot_local/bin/executable_launch_polybar index 4d6071a..136860e 100644 --- a/dot_local/bin/executable_launch_polybar +++ b/dot_local/bin/executable_launch_polybar @@ -6,8 +6,9 @@ while pgrep -u $UID -x polybar > /dev/null; do sleep 0.5; done - outputs=$(xrandr --query | grep " connected" | cut -d" " -f1) - tray_output=$(xrandr --query | grep " primary" | cut -d" " -f 1) + monitors=$(polybar -m) + outputs=$(echo $monitors | cut -d ":" -f1) + tray_output=$(echo $monitor | grep primary | cut -d ":" -f 1) for m in $outputs; do export MONITOR=$m