diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..727bb9e --- /dev/null +++ b/.zshrc @@ -0,0 +1,37 @@ +# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. +# Initialization code that may require console input (password prompts, [y/n] +# confirmations, etc.) must go above this block; everything else may go below. +if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +fi + +HISTFILE=~/.histfile +HISTSIZE=2000 +SAVEHIST=2000 +bindkey -v + +# End of lines configured by zsh-newuser-install +# The following lines were added by compinstall +bindkey "\e[3~" delete-char +autoload -Uz compinit && compinit +zstyle ':completion:*' menu select +# End of lines added by compinstall + + +source /home/nnduc/git/powerlevel10k/powerlevel10k.zsh-theme +source /home/nnduc/git/zsh-autosuggestions/zsh-autosuggestions.zsh + +zshaddhistory() { + whence ${${(z)1}[1]} >/dev/null || return 2 +} + +# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. +[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh + +export EDITOR=nvim +export TERM='xterm-256color' +export PATH="$HOME/.local/bin:$PATH" + +alias ls='ls --color=auto' +alias doc='docker-compose' + diff --git a/i3/scripts/wallpaper-rotate b/i3/scripts/wallpaper-rotate index 78a84a1..938eea9 100755 --- a/i3/scripts/wallpaper-rotate +++ b/i3/scripts/wallpaper-rotate @@ -1,44 +1,4 @@ #!/bin/bash wall_dir="${1:?wallpaper directory required}" -interval="${2:-1800}" - -pick_wall() { - find "$wall_dir" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) | shuf -n1 -} - -set_wall() { [ -n "$1" ] && xwallpaper --zoom "$1"; } - -has_fullscreen() { - python3 - <<'EOF' -import json, subprocess, sys - -def is_fullscreen(node): - if node.get('fullscreen_mode', 0) > 0: return True - return any(is_fullscreen(c) for c in node.get('nodes', []) + node.get('floating_nodes', [])) - -def find_ws(node, name): - if node.get('type') == 'workspace' and node.get('name') == name: return node - for c in node.get('nodes', []) + node.get('floating_nodes', []): - r = find_ws(c, name) - if r: return r - -try: - wss = json.loads(subprocess.check_output(['i3-msg', '-t', 'get_workspaces'], stderr=subprocess.DEVNULL)) - tree = json.loads(subprocess.check_output(['i3-msg', '-t', 'get_tree'], stderr=subprocess.DEVNULL)) - for ws in wss: - if ws.get('visible'): - node = find_ws(tree, ws['name']) - if node and is_fullscreen(node): - sys.exit(0) -except Exception: - pass -sys.exit(1) -EOF -} - -# Initial wallpaper -set_wall "$(pick_wall)" - -while sleep "$interval"; do - has_fullscreen || set_wall "$(pick_wall)" -done +img=$(find "$wall_dir" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) | shuf -n1) +[ -n "$img" ] && feh --bg-fill "$img" diff --git a/picom/picom.conf b/picom/picom.conf index b777b3e..b37e834 100644 --- a/picom/picom.conf +++ b/picom/picom.conf @@ -1,10 +1,6 @@ -backend = "xrender"; vsync = true; use-damage = true; -# games bypass picom entirely when fullscreen -unredir-if-possible = true; - # no effects — featherweight shadow = false; fading = false; @@ -13,3 +9,11 @@ corner-radius = 0; detect-transient = true; detect-client-leader = true; + +unredir-if-possible = true; +# xrender avoids picom creating its own GL context, which conflicts +# with GTK4/WebKitGTK apps (e.g. Stremio) using their own GL context +# on NVIDIA — that conflict was rendering such windows transparent. +backend = "xrender"; + +