Compare commits
15
Commits
2027
..
537275d3ef
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
537275d3ef | ||
|
|
a713ec520b | ||
|
|
93f0d7e525 | ||
|
|
275ec43af3 | ||
|
|
57f0d97072 | ||
|
|
df97a3cfc3 | ||
|
|
7303d805ef | ||
|
|
1521e5ddf2 | ||
|
|
ebd0e1bffa | ||
|
|
06805d6245 | ||
|
|
8deeba646d | ||
|
|
94af5b761a | ||
|
|
e4e6c4e7b1 | ||
|
|
c5d7992af3 | ||
|
|
8a192fd4d2 |
@@ -1,38 +0,0 @@
|
|||||||
# 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'
|
|
||||||
alias cla='cd /home/nnduc/.cache/ && claude'
|
|
||||||
alias wa="watch -n1 "sensors | grep -E 'Tctl|edge|junction|mem:|Composite'""
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
# Shift_R+F12 shows/hides the HUD
|
|
||||||
no_display
|
|
||||||
toggle_hud=Shift_R+F12
|
|
||||||
fps
|
|
||||||
frametime
|
|
||||||
frame_timing
|
|
||||||
gpu_stats
|
|
||||||
cpu_stats
|
|
||||||
# diagnostics: log starts 20s after launch, Shift_L+F2 toggles logging
|
|
||||||
output_folder=/home/nnduc/mangologs
|
|
||||||
autostart_log=20
|
|
||||||
log_interval=0
|
|
||||||
toggle_logging=Shift_L+F2
|
|
||||||
gpu_core_clock
|
|
||||||
gpu_mem_clock
|
|
||||||
vram
|
|
||||||
ram
|
|
||||||
cpu_mhz
|
|
||||||
# fps
|
|
||||||
fps_limit=80,60,120,0
|
|
||||||
fps_limit_method=early
|
|
||||||
toggle_fps_limit=Shift_L+F1
|
|
||||||
@@ -33,264 +33,9 @@ Section "Device"
|
|||||||
Driver "intel"
|
Driver "intel"
|
||||||
Option "TearFree" "true"
|
Option "TearFree" "true"
|
||||||
EndSection
|
EndSection
|
||||||
```
|
|
||||||
- amd: xf86-video-amdgpu (`VariableRefresh` = FreeSync, fullscreen apps only under Xorg)
|
|
||||||
- sudo -e /etc/X11/xorg.conf.d/20-amdgpu.conf
|
|
||||||
```
|
|
||||||
Section "Device"
|
|
||||||
Identifier "AMD"
|
|
||||||
Driver "amdgpu"
|
|
||||||
Option "VariableRefresh" "true"
|
|
||||||
Option "TearFree" "true"
|
|
||||||
EndSection
|
|
||||||
```
|
|
||||||
## High refresh rate flicker (AMD):
|
|
||||||
- At high refresh rates (240Hz+) the vblank can be too short for the GPU to
|
|
||||||
switch VRAM clock unnoticed, so the desktop flickers under changing load.
|
|
||||||
Windows avoids it by keeping VRAM clock high; amdgpu on Linux may not.
|
|
||||||
- Check: if the `*` jumps between levels while idle, this is likely the cause.
|
|
||||||
```bash
|
|
||||||
watch -n0.2 cat /sys/class/drm/card*/device/pp_dpm_mclk
|
|
||||||
```
|
|
||||||
- Fix 1: run the desktop at a lower rate (`i3/config` uses 120Hz). Find the
|
|
||||||
output name with `xrandr` (e.g. `DisplayPort-0`) and adjust it there:
|
|
||||||
```bash
|
|
||||||
xrandr --output DisplayPort-0 --mode 1920x1080 --rate 120
|
|
||||||
```
|
|
||||||
- sway: same idea in `sway/config` (`swaymsg -t get_outputs` for the name).
|
|
||||||
Keep `adaptive_sync off` there — sway applies it to the whole desktop, which
|
|
||||||
can stutter/flicker:
|
|
||||||
```
|
|
||||||
output DP-1 mode 1920x1080@120Hz adaptive_sync off
|
|
||||||
```
|
|
||||||
- Fix 2: keep the high rate and pin VRAM clock to its top level (more idle
|
|
||||||
power, resets on reboot; top level is the last line of `pp_dpm_mclk`):
|
|
||||||
```bash
|
|
||||||
echo manual | sudo tee /sys/class/drm/card*/device/power_dpm_force_performance_level
|
|
||||||
echo 3 | sudo tee /sys/class/drm/card*/device/pp_dpm_mclk
|
|
||||||
```
|
|
||||||
- Gaming: 120Hz + FreeSync is plenty for ~60fps games (VRR covers the dips).
|
|
||||||
Cap fps a few below max refresh so VRR stays active, e.g. Dota 2 console
|
|
||||||
`fps_max 117`. Under Xorg, VRR applies to fullscreen games only; under sway
|
|
||||||
with `adaptive_sync off` games run without it.
|
|
||||||
- To turn off FreeSync for a single game (Xorg): `adaptive_sync=false %command%`
|
|
||||||
(Steam launch options).
|
|
||||||
- Login greeters (SDDM, LightDM, ...) are fullscreen and mostly static, so VRR
|
|
||||||
drops to the bottom of the range and flickers. `mesa/drirc` disables it for
|
|
||||||
any `*greeter*` executable; install system-wide (greeters don't read `~/.drirc`):
|
|
||||||
```bash
|
|
||||||
sudo cp xorg/20-amdgpu.conf /etc/X11/xorg.conf.d/
|
|
||||||
sudo cp mesa/drirc /etc/drirc
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
## Shader cache (Steam)
|
|
||||||
|
|
||||||
With Steam's *Shader Pre-caching* off (it re-downloads caches for every game
|
|
||||||
almost daily), Steam points Mesa at a temporary
|
|
||||||
`~/.local/share/Steam/shader_cache_temp_dir_*` and deletes it when the game
|
|
||||||
exits, so every session recompiles shaders (hitches everywhere, every time).
|
|
||||||
Steam only sets the legacy `MESA_GLSL_CACHE_DIR`, so the newer variable wins.
|
|
||||||
Set it session-wide (i3 is started by SDDM, `environment.d` doesn't reach
|
|
||||||
Steam). The cache lives in `/var/cache` so `~/.cache` cleaners don't wipe it,
|
|
||||||
with one private subdir per user: Mesa creates its dirs `0700`, so a single
|
|
||||||
shared dir can't work (and would let users poison each other's shaders).
|
|
||||||
`/etc/environment` can't expand `$USER`, so use `/etc/profile.d` (SDDM's
|
|
||||||
X11/Wayland sessions and TTY logins source it). Run as your normal user, not
|
|
||||||
from a root shell (`~` and `$USER` must be yours), with Steam closed:
|
|
||||||
```bash
|
|
||||||
sudo mkdir -p /var/cache/mesa_shader_cache
|
|
||||||
sudo chmod 1777 /var/cache/mesa_shader_cache # like /tmp: anyone creates own subdir
|
|
||||||
mv ~/.cache/mesa_shader_cache /var/cache/mesa_shader_cache/$USER # no sudo: keeps ownership
|
|
||||||
sudo sed -i '/^MESA_SHADER_CACHE_/d' /etc/environment
|
|
||||||
sudo tee /etc/profile.d/mesa-shader-cache.sh >/dev/null <<'EOF'
|
|
||||||
export MESA_SHADER_CACHE_DIR="/var/cache/mesa_shader_cache/$USER"
|
|
||||||
export MESA_SHADER_CACHE_MAX_SIZE=10G
|
|
||||||
export PRESSURE_VESSEL_FILESYSTEMS_RW=/var/cache/mesa_shader_cache
|
|
||||||
EOF
|
|
||||||
```
|
|
||||||
The last line matters: Steam runs games (native and Proton) in the Steam
|
|
||||||
Linux Runtime container, which shares `$HOME` but gives the game its own empty
|
|
||||||
`/var`. Without it the cache is written to a tmpfs inside the container and
|
|
||||||
thrown away when the game exits.
|
|
||||||
Re-login, then check it's yours and persists after playing (should print > 0):
|
|
||||||
```bash
|
|
||||||
echo $MESA_SHADER_CACHE_DIR; ls -ld $MESA_SHADER_CACHE_DIR # owner must be you
|
|
||||||
find $MESA_SHADER_CACHE_DIR -mmin -60 -type f | wc -l
|
|
||||||
```
|
|
||||||
Deleting the cache is harmless: shaders just recompile (stutter) on first use.
|
|
||||||
|
|
||||||
## Installing dependencies
|
|
||||||
|
|
||||||
Package availability differs between distros — Arch has everything below in the
|
|
||||||
official/multilib repos, no AUR needed. Gentoo's main tree is missing a few
|
|
||||||
newer tools (noted below); those need the [GURU overlay](https://wiki.gentoo.org/wiki/Project:GURU)
|
|
||||||
or manual/cargo install.
|
|
||||||
|
|
||||||
### Window manager & session (both i3 and sway)
|
|
||||||
|
|
||||||
**Arch**
|
|
||||||
```bash
|
|
||||||
sudo pacman -S i3-wm i3status i3blocks sway swaybg swaylock swayidle \
|
|
||||||
waybar polybar rofi alacritty dex snixembed \
|
|
||||||
xss-lock xorg-xset xorg-xrandr xclip scrot imagemagick i3lock \
|
|
||||||
network-manager-applet blueman gnome-keyring polkit-gnome \
|
|
||||||
pipewire wireplumber pipewire-pulse pipewire-alsa pipewire-jack \
|
|
||||||
pasystray playerctl brightnessctl \
|
|
||||||
fcitx5 fcitx5-im fcitx5-configtool
|
|
||||||
```
|
|
||||||
|
|
||||||
**Gentoo**
|
|
||||||
```bash
|
|
||||||
sudo emerge --ask \
|
|
||||||
x11-wm/i3 x11-misc/i3status x11-misc/i3blocks \
|
|
||||||
gui-wm/sway gui-apps/swaybg gui-apps/swaylock gui-apps/swayidle \
|
|
||||||
gui-apps/waybar x11-misc/polybar x11-misc/rofi x11-terms/alacritty \
|
|
||||||
x11-misc/dex x11-misc/snixembed \
|
|
||||||
x11-misc/xss-lock x11-apps/xset x11-apps/xrandr x11-misc/xclip media-gfx/scrot \
|
|
||||||
media-gfx/imagemagick x11-misc/i3lock \
|
|
||||||
net-misc/networkmanager net-misc/network-manager-applet net-wireless/blueman \
|
|
||||||
app-crypt/gnome-keyring gnome-extra/polkit-gnome \
|
|
||||||
media-video/pipewire media-video/wireplumber media-sound/playerctl \
|
|
||||||
app-i18n/fcitx app-i18n/fcitx-qt app-i18n/fcitx-gtk
|
|
||||||
```
|
|
||||||
- `brightnessctl` is **not in the main Gentoo tree** — install from the GURU
|
|
||||||
overlay (`sudo emerge --ask brightnessctl`, after enabling GURU below) or
|
|
||||||
build from source. Add your user to the `video` and `input` groups either way.
|
|
||||||
- PipeWire's PulseAudio/ALSA/JACK compatibility on Gentoo is controlled by
|
|
||||||
USE flags (`pulseaudio`/`alsa`/`jack`... check `equery u media-video/pipewire`)
|
|
||||||
rather than separate packages.
|
|
||||||
- `pasystray` (systray volume icon) is not in the main tree either; the GURU
|
|
||||||
overlay or `pavucontrol` are common substitutes.
|
|
||||||
|
|
||||||
Enable the GURU overlay once, needed by several packages below:
|
|
||||||
```bash
|
|
||||||
sudo eselect repository enable guru
|
|
||||||
sudo emerge --sync guru
|
|
||||||
```
|
|
||||||
|
|
||||||
### Wayland screenshots, clipboard, and screen sharing (sway)
|
|
||||||
|
|
||||||
These are the pieces the Print-key bindings and screen sharing/recording in
|
|
||||||
`sway/config` depend on — without `xdg-desktop-portal-wlr` specifically,
|
|
||||||
no app (browser tab share, Discord, OBS) can capture the screen at all.
|
|
||||||
|
|
||||||
**Arch**
|
|
||||||
```bash
|
|
||||||
sudo pacman -S grim slurp wl-clipboard cliphist \
|
|
||||||
xdg-desktop-portal xdg-desktop-portal-wlr xdg-desktop-portal-gtk \
|
|
||||||
wf-recorder obs-studio
|
|
||||||
```
|
|
||||||
|
|
||||||
**Gentoo**
|
|
||||||
```bash
|
|
||||||
sudo emerge --ask \
|
|
||||||
gui-apps/grim gui-apps/slurp gui-apps/wl-clipboard \
|
|
||||||
sys-apps/xdg-desktop-portal gui-libs/xdg-desktop-portal-wlr sys-apps/xdg-desktop-portal-gtk \
|
|
||||||
media-video/wf-recorder media-video/obs-studio
|
|
||||||
```
|
|
||||||
- `cliphist` (clipboard history) is not in the main tree — GURU overlay.
|
|
||||||
|
|
||||||
After installing the portal packages, restart the portal service so it picks
|
|
||||||
up the new backend:
|
|
||||||
```bash
|
|
||||||
systemctl --user restart xdg-desktop-portal
|
|
||||||
```
|
|
||||||
|
|
||||||
### AMD GPU stack (mesa/RADV/amdgpu)
|
|
||||||
|
|
||||||
**Arch**
|
|
||||||
```bash
|
|
||||||
sudo pacman -S mesa lib32-mesa vulkan-radeon lib32-vulkan-radeon \
|
|
||||||
xf86-video-amdgpu linux-firmware-amdgpu libvdpau-va-gl
|
|
||||||
```
|
|
||||||
Mesa on current Arch already bundles the VA-API driver (`radeonsi_drv_video.so`)
|
|
||||||
and there's no separate `mesa-vdpau`/`lib32-mesa-vdpau` package anymore —
|
|
||||||
`libvdpau-va-gl` is the VDPAU-to-VA-API translation layer that replaces it.
|
|
||||||
|
|
||||||
**Gentoo**
|
|
||||||
```bash
|
|
||||||
# In /etc/portage/make.conf:
|
|
||||||
# VIDEO_CARDS="amdgpu radeonsi"
|
|
||||||
sudo emerge --ask media-libs/mesa media-libs/vulkan-loader \
|
|
||||||
x11-drivers/xf86-video-amdgpu media-video/libvdpau media-libs/libvdpau-va-gl
|
|
||||||
```
|
|
||||||
Make sure `mesa` is built with `USE="vulkan"` and, for 32-bit/Steam
|
|
||||||
compatibility, `ABI_X86="32 64"` in `package.use`.
|
|
||||||
|
|
||||||
### Gaming & performance
|
|
||||||
|
|
||||||
**Arch**
|
|
||||||
```bash
|
|
||||||
sudo pacman -S gamemode lib32-gamemode mangohud lib32-mangohud
|
|
||||||
```
|
|
||||||
|
|
||||||
**Gentoo**
|
|
||||||
```bash
|
|
||||||
sudo emerge --ask games-util/gamemode
|
|
||||||
```
|
|
||||||
- `mangohud` is **not in the main Gentoo tree** — GURU overlay
|
|
||||||
(`sudo emerge --ask games-util/mangohud` after enabling GURU).
|
|
||||||
|
|
||||||
Adaptive sync (sway): the desktop runs at a fixed 240 Hz with VRR off, because
|
|
||||||
sway only renders on change and idle frame rates fall below the panel's 48 Hz
|
|
||||||
floor (out of LFC range → flicker). gamemode turns VRR on for DP-1 while a
|
|
||||||
game runs and off when it exits (install `gamemode/gamemode.ini` to
|
|
||||||
`~/.config/gamemode.ini`); `lock-now` turns it off while locked.
|
|
||||||
|
|
||||||
### GPU monitoring & tuning
|
|
||||||
|
|
||||||
**Arch**
|
|
||||||
```bash
|
|
||||||
sudo pacman -S radeontop amdgpu_top nvtop lact lm_sensors
|
|
||||||
```
|
|
||||||
|
|
||||||
**Gentoo**
|
|
||||||
```bash
|
|
||||||
sudo emerge --ask app-misc/radeontop sys-process/nvtop sys-power/lm-sensors
|
|
||||||
```
|
|
||||||
- `amdgpu_top`, `lact`, and `corectrl` (fan curves/overclocking GUIs) are not
|
|
||||||
in the main tree — GURU overlay, or install `lact`/`amdgpu_top` via `cargo`
|
|
||||||
since both are Rust tools.
|
|
||||||
|
|
||||||
### Razer peripherals (polling rate, DPI, RGB)
|
|
||||||
|
|
||||||
**Arch**
|
|
||||||
```bash
|
|
||||||
sudo pacman -S openrazer-daemon openrazer-meta polychromatic
|
|
||||||
sudo gpasswd -a $USER plugdev
|
|
||||||
```
|
|
||||||
|
|
||||||
**Gentoo**
|
|
||||||
```bash
|
|
||||||
sudo emerge --ask sys-apps/openrazer
|
|
||||||
sudo gpasswd -a $USER plugdev
|
|
||||||
```
|
|
||||||
- Gentoo ships a single unified `sys-apps/openrazer` package (driver +
|
|
||||||
daemon together) rather than split `-daemon`/`-meta` packages.
|
|
||||||
`polychromatic` (GUI) is not in the main tree — GURU overlay.
|
|
||||||
|
|
||||||
### Notifications & fonts
|
|
||||||
|
|
||||||
**Arch**
|
|
||||||
```bash
|
|
||||||
sudo pacman -S ttf-firacode-nerd
|
|
||||||
# tiramisu (notification daemon) is AUR-only on Arch: yay -S tiramisu
|
|
||||||
```
|
|
||||||
|
|
||||||
**Gentoo**
|
|
||||||
```bash
|
|
||||||
sudo emerge --ask media-fonts/nerd-fonts
|
|
||||||
```
|
|
||||||
- `tiramisu` is not in the main Gentoo tree — GURU overlay or build from
|
|
||||||
source (https://github.com/Sweets/tiramisu).
|
|
||||||
|
|
||||||
### PipeWire launcher (Gentoo only)
|
|
||||||
|
|
||||||
`sway/config` calls `gentoo-pipewire-launcher`, the community launcher script
|
|
||||||
documented on the [Gentoo PipeWire wiki page](https://wiki.gentoo.org/wiki/PipeWire) —
|
|
||||||
it's a shell script you place on your `PATH` yourself, not a portage package.
|
|
||||||
|
|
||||||
## Vim
|
## Vim
|
||||||
|
|
||||||
### Vimplug
|
### Vimplug
|
||||||
|
|||||||
Executable → Regular
+6
-17
@@ -16,20 +16,9 @@ family = "MesloLGS NF"
|
|||||||
[font.normal]
|
[font.normal]
|
||||||
family = "MesloLGS NF"
|
family = "MesloLGS NF"
|
||||||
|
|
||||||
[[keyboard.bindings]]
|
[keyboard]
|
||||||
key = "T"
|
bindings = [
|
||||||
mods = "Control|Shift"
|
{ key = "T", mods = "Control|Shift", action = "SpawnNewInstance" },
|
||||||
action = "SpawnNewInstance"
|
{ key = "PageUp", action = "ScrollLineUp" },
|
||||||
|
{ key = "PageDown", action = "ScrollLineDown" },
|
||||||
[[keyboard.bindings]]
|
]
|
||||||
key = "PageUp"
|
|
||||||
action = "ScrollLineUp"
|
|
||||||
|
|
||||||
[[keyboard.bindings]]
|
|
||||||
key = "PageDown"
|
|
||||||
action = "ScrollLineDown"
|
|
||||||
|
|
||||||
[[keyboard.bindings]]
|
|
||||||
key = "Return"
|
|
||||||
mods = "Shift"
|
|
||||||
chars = "\u001b\r"
|
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
[window]
|
|
||||||
startup_mode = "Maximized"
|
|
||||||
|
|
||||||
[font]
|
|
||||||
size = 14.0
|
|
||||||
|
|
||||||
[font.bold]
|
|
||||||
family = "MesloLGS NF"
|
|
||||||
|
|
||||||
[font.bold_italic]
|
|
||||||
family = "MesloLGS NF"
|
|
||||||
|
|
||||||
[font.italic]
|
|
||||||
family = "MesloLGS NF"
|
|
||||||
|
|
||||||
[font.normal]
|
|
||||||
family = "MesloLGS NF"
|
|
||||||
|
|
||||||
[keyboard]
|
|
||||||
bindings = [
|
|
||||||
{ key = "T", mods = "Control|Shift", action = "SpawnNewInstance" },
|
|
||||||
{ key = "PageUp", action = "ScrollLineUp" },
|
|
||||||
{ key = "PageDown", action = "ScrollLineDown" },
|
|
||||||
]
|
|
||||||
Executable → Regular
Executable → Regular
@@ -10,8 +10,7 @@
|
|||||||
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
|
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
|
||||||
|
|
||||||
set $mod Mod1
|
set $mod Mod1
|
||||||
set $wallpaper_dir /media/sync/images/wallpapers
|
set $wallpaper '/data/sync/images/wallpapers/suse.png'
|
||||||
set $terminal 'alacritty'
|
|
||||||
# Font for window titles. Will also be used by the bar unless a different font
|
# Font for window titles. Will also be used by the bar unless a different font
|
||||||
# is used in the bar {} block below.
|
# is used in the bar {} block below.
|
||||||
font pango:NotoSans 12
|
font pango:NotoSans 12
|
||||||
@@ -20,11 +19,6 @@ font pango:NotoSans 12
|
|||||||
# text rendering and scalability on retina/hidpi displays (thanks to pango).
|
# text rendering and scalability on retina/hidpi displays (thanks to pango).
|
||||||
#font pango:DejaVu Sans Mono 8
|
#font pango:DejaVu Sans Mono 8
|
||||||
|
|
||||||
# Clear leftover Wayland env (e.g. from a previous Hyprland/sway session) out of
|
|
||||||
# systemd/dbus so dbus-activated apps like Thunar don't try to use a dead compositor.
|
|
||||||
# Must run before anything dbus-activated starts.
|
|
||||||
exec --no-startup-id sh -c "systemctl --user unset-environment WAYLAND_DISPLAY HYPRLAND_INSTANCE_SIGNATURE SWAYSOCK; dbus-update-activation-environment --systemd DISPLAY XAUTHORITY XDG_CURRENT_DESKTOP=i3 XDG_SESSION_TYPE=x11; pkill -x Thunar"
|
|
||||||
|
|
||||||
# Start XDG autostart .desktop files using dex. See also
|
# Start XDG autostart .desktop files using dex. See also
|
||||||
# https://wiki.archlinux.org/index.php/XDG_Autostart
|
# https://wiki.archlinux.org/index.php/XDG_Autostart
|
||||||
exec --no-startup-id dex --autostart --environment i3
|
exec --no-startup-id dex --autostart --environment i3
|
||||||
@@ -33,37 +27,26 @@ exec --no-startup-id dex --autostart --environment i3
|
|||||||
# they are included here as an example. Modify as you see fit.
|
# they are included here as an example. Modify as you see fit.
|
||||||
#exec --no-startup-id /usr/bin/gnome-keyring-daemon --start --components=gpg,pkcs11,secrets,ssh
|
#exec --no-startup-id /usr/bin/gnome-keyring-daemon --start --components=gpg,pkcs11,secrets,ssh
|
||||||
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
|
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
|
||||||
# screen before suspend. Use systemctl lock-session to lock your screen.
|
# screen before suspend. Use loginctl lock-session to lock your screen.
|
||||||
|
exec --no-startup-id xrand --output HDMI-0 --mode 1920x1080 --rate 120
|
||||||
|
bindsym $mod+l exec i3lock --ignore-empty-password -i $wallpaper
|
||||||
|
|
||||||
# idle: lock after 5min (xss-lock -> scripts/lock), DPMS off after 15min;
|
bindsym $mod+Shift+p exec loginctl poweroff
|
||||||
# dpms-inhibit skips all of it while a fullscreen window is visible
|
bindsym Print exec flameshot gui -c
|
||||||
exec --no-startup-id xset b off
|
|
||||||
exec --no-startup-id xset s noblank
|
|
||||||
exec --no-startup-id xset s 300 300
|
|
||||||
exec --no-startup-id xset dpms 0 0 900
|
|
||||||
exec --no-startup-id xss-lock -- ~/.config/i3/scripts/lock $wallpaper_dir
|
|
||||||
exec --no-startup-id ~/.config/i3/scripts/dpms-inhibit
|
|
||||||
|
|
||||||
bindsym $mod+l exec ~/.config/i3/scripts/lock-now $wallpaper_dir
|
|
||||||
bindsym $mod+Shift+o exec --no-startup-id ~/.config/i3/scripts/lock-then-suspend $wallpaper_dir
|
|
||||||
bindsym $mod+Shift+p exec systemctl poweroff
|
|
||||||
|
|
||||||
bindsym Print exec --no-startup-id bash -c 'f="$(xdg-user-dir PICTURES)/$(date +%s_scrot.png)" && scrot -s "$f" && xclip -selection clipboard -t image/png -i "$f" && notify-send "Screenshot saved" "$f"'
|
|
||||||
bindsym $mod+Print exec --no-startup-id bash -c 'f="$(xdg-user-dir PICTURES)/$(date +%s_scrot.png)" && scrot "$f" && xclip -selection clipboard -t image/png -i "$f" && notify-send "Screenshot saved" "$f"'
|
|
||||||
# NetworkManager is the most popular way to manage wireless networks on Linux,
|
# NetworkManager is the most popular way to manage wireless networks on Linux,
|
||||||
# and nm-applet is a desktop environment-independent system tray GUI for it.
|
# and nm-applet is a desktop environment-independent system tray GUI for it.
|
||||||
|
|
||||||
# applets
|
# applets
|
||||||
exec --no-startup-id snixembed --fork
|
|
||||||
exec --no-startup-id fcitx5 -d
|
exec --no-startup-id fcitx5 -d
|
||||||
exec --no-startup-id nm-applet
|
exec --no-startup-id nm-applet
|
||||||
exec --no-startup-id blueman-applet
|
exec --no-startup-id blueman-applet
|
||||||
exec --no-startup-id /usr/bin/gnome-keyring-daemon --start --components=ssh,pkcs11
|
exec --no-startup-id feh --bg-fill $wallpaper
|
||||||
exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
|
exec --no-startup-id owncloud
|
||||||
exec --no-startup-id ~/.config/i3/scripts/wallpaper-rotate $wallpaper_dir
|
|
||||||
exec --no-startup-id pasystray
|
exec --no-startup-id pasystray
|
||||||
exec --no-startup-id polybar
|
exec --no-startup-id polybar
|
||||||
exec --no-startup-id ~/.config/i3/scripts/guide-freeze
|
exec --no-startup-id xset m 1/1 0
|
||||||
|
exec xinput --set-prop "Razer Razer DeathAdder V2 X HyperSpeed Mouse" "Device Accel Constant Deceleration" 3
|
||||||
|
exec --no-startup-id gentoo-pipewire-launcher restart &
|
||||||
|
|
||||||
set $refresh_i3status killall -SIGUSR1 i3status
|
set $refresh_i3status killall -SIGUSR1 i3status
|
||||||
|
|
||||||
@@ -103,20 +86,14 @@ floating_modifier $mod
|
|||||||
# or left-clicking anywhere into the window while holding the floating modifier.
|
# or left-clicking anywhere into the window while holding the floating modifier.
|
||||||
#tiling_drag modifier titlebar
|
#tiling_drag modifier titlebar
|
||||||
#xrandr --output HDMI-2 --auto --right-of eDP1
|
#xrandr --output HDMI-2 --auto --right-of eDP1
|
||||||
# High refresh rates can flicker on AMD (VRAM clock switching), so run the
|
|
||||||
# desktop at 120Hz. See README "High refresh rate flicker".
|
|
||||||
exec --no-startup-id xrandr --output DisplayPort-0 --mode 1920x1080 --rate 240
|
|
||||||
|
|
||||||
# start a terminal
|
# start a 3terminal
|
||||||
#bindsym $mod+Return exec i3-sensible-terminal
|
#bindsym $mod+Return exec i3-sensible-terminal
|
||||||
bindsym $mod+Return exec $terminal
|
bindsym $mod+Return exec alacritty
|
||||||
|
|
||||||
# kill focused window
|
# kill focused window
|
||||||
bindsym $mod+Shift+q kill
|
bindsym $mod+Shift+q kill
|
||||||
|
|
||||||
# freeze / resume focused window (SIGSTOP / SIGCONT)
|
|
||||||
bindsym $mod+m exec --no-startup-id ~/.config/i3/scripts/freeze-toggle
|
|
||||||
|
|
||||||
# start dmenu (a program launcher)
|
# start dmenu (a program launcher)
|
||||||
#bindsym $mod+d exec --no-startup-id j4-dmenu-desktop
|
#bindsym $mod+d exec --no-startup-id j4-dmenu-desktop
|
||||||
#bindsym $mod+d exec --no-startup-id dmenu
|
#bindsym $mod+d exec --no-startup-id dmenu
|
||||||
@@ -260,20 +237,23 @@ bindsym $mod+r mode "resize"
|
|||||||
bindsym $mod+Tab workspace back_and_forth
|
bindsym $mod+Tab workspace back_and_forth
|
||||||
|
|
||||||
# class border bground text indicator child_border
|
# class border bground text indicator child_border
|
||||||
client.focused #3A7CA5 #3A7CA5 #E2EBF0 #0D1B27 #3A7CA5
|
client.focused #05707E #05707E #FFFFFF #000000 #05707E
|
||||||
client.placeholder #0D1B27 #0D1B27 #BDD5E4 #0D1B27 #0D1B27
|
client.placeholder #000000 #F1E3D3 #FFFFFF #000000 #0d100f
|
||||||
client.unfocused #0D1B27 #152535 #6A8DA0 #0D1B27 #152535
|
client.unfocused #000000 #1B4D3E #FFFFFF #000000 #0d100f
|
||||||
client.focused_inactive #1A3347 #1A3347 #6A8DA0 #1A3347 #1A3347
|
client.focused_inactive #333333 #C8C9C9 #7A858D #484E50 #5F676A
|
||||||
#focused_workspace #4c7899 #285577 #ffff
|
#focused_workspace #4c7899 #285577 #ffff
|
||||||
# (No) Title Bars
|
# (No) Title Bars
|
||||||
|
|
||||||
for_window [class="^.*"] border pixel 1
|
for_window [class="^.*"] border pixel 1
|
||||||
|
|
||||||
#floating
|
#floating
|
||||||
for_window [class="signal"] floating enable
|
for_window [class="Signal"] floating enable
|
||||||
|
for_window [class="Fluffychat"] floating enable
|
||||||
|
for_window [class="Proton VPN"] floating enable
|
||||||
for_window [class="Dino"] floating enable
|
for_window [class="Dino"] floating enable
|
||||||
|
for_window [class="ownCloud"] floating enable
|
||||||
for_window [class="firefox"] move container to workspace 1
|
for_window [class="firefox"] move container to workspace 1
|
||||||
for_window [class="eu.betterbird.Betterbird"] move container to workspace 4
|
for_window [class="thunderbird"] move container to workspace 4
|
||||||
|
for_window [class="Dolphin"] move container to workspace 3
|
||||||
for_window [class="Thunar"] move container to workspace 3
|
for_window [class="Thunar"] move container to workspace 3
|
||||||
for_window [class="steam_app_1364781"] border none, fullscreen enable
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,182 +0,0 @@
|
|||||||
# i3blocks config file changed for EndeavourOS-i3 setup
|
|
||||||
|
|
||||||
# source is available here:
|
|
||||||
# https://raw.githubusercontent.com/endeavouros-team/endeavouros-i3wm-setup/main/etc/skel/.config/i3/i3blocks.conf
|
|
||||||
# Maintainer: joekamprad [joekamprad //a_t// endeavouros.com]
|
|
||||||
# Former Visual Designer: Florent Valetti [@FLVAL EndeavourOS]
|
|
||||||
# created for i3wm setup on EndeavourOS
|
|
||||||
# https://endeavouros.com
|
|
||||||
|
|
||||||
# cheatsheet for icon fonts used on the block-bar:
|
|
||||||
# https://fontawesome.com/v4.7/cheatsheet/
|
|
||||||
|
|
||||||
# --> to update this run the following command:
|
|
||||||
# wget --backups=1 https://raw.githubusercontent.com/endeavouros-team/endeavouros-i3wm-setup/main/etc/skel/.config/i3/i3blocks.conf -P ~/.config/i3/
|
|
||||||
|
|
||||||
# Please see man i3blocks for a complete reference!
|
|
||||||
# The man page is also hosted at http://vivien.github.io/i3blocks
|
|
||||||
|
|
||||||
|
|
||||||
# List of valid properties:
|
|
||||||
#
|
|
||||||
# align
|
|
||||||
# color
|
|
||||||
# command
|
|
||||||
# full_text
|
|
||||||
# instance
|
|
||||||
# interval
|
|
||||||
# label
|
|
||||||
# min_width
|
|
||||||
# name
|
|
||||||
# separator
|
|
||||||
# separator_block_width
|
|
||||||
# short_text
|
|
||||||
# signal
|
|
||||||
# urgent
|
|
||||||
|
|
||||||
# Global properties
|
|
||||||
#
|
|
||||||
# The top properties below are applied to every block, but can be overridden.
|
|
||||||
separator=false
|
|
||||||
markup=pango
|
|
||||||
|
|
||||||
#[Weather]
|
|
||||||
#command=~/.config/i3/scripts/openweather
|
|
||||||
#interval=1800
|
|
||||||
#color=#7275b3
|
|
||||||
|
|
||||||
[terminal]
|
|
||||||
full_text=
|
|
||||||
color=#807dfe
|
|
||||||
command=i3-msg -q exec xfce4-terminal
|
|
||||||
|
|
||||||
[browser]
|
|
||||||
full_text=
|
|
||||||
color=#ff7f81
|
|
||||||
command=i3-msg -q exec firefox
|
|
||||||
|
|
||||||
[files]
|
|
||||||
full_text=
|
|
||||||
color=#7f3fbf
|
|
||||||
command=i3-msg -q exec thunar ~/
|
|
||||||
|
|
||||||
#[mail]
|
|
||||||
#full_text=
|
|
||||||
#color=#dbcb75
|
|
||||||
#command=i3-msg -q exec thunderbird
|
|
||||||
|
|
||||||
[simple-2]
|
|
||||||
full_text=: :
|
|
||||||
color=#717171
|
|
||||||
|
|
||||||
# Disk usage
|
|
||||||
#
|
|
||||||
# The directory defaults to $HOME if the instance is not specified.
|
|
||||||
# The script may be called with a optional argument to set the alert
|
|
||||||
# (defaults to 10 for 10%).
|
|
||||||
[disk]
|
|
||||||
label=
|
|
||||||
instance=/
|
|
||||||
command=~/.config/i3/scripts/disk
|
|
||||||
interval=30
|
|
||||||
|
|
||||||
# Memory usage
|
|
||||||
#
|
|
||||||
# The type defaults to "mem" if the instance is not specified.
|
|
||||||
[memory]
|
|
||||||
label=
|
|
||||||
command=~/.config/i3/scripts/memory
|
|
||||||
interval=2
|
|
||||||
|
|
||||||
[cpu_usage]
|
|
||||||
label=
|
|
||||||
command=~/.config/i3/scripts/cpu_usage
|
|
||||||
#min_width=CPU: 100.00%
|
|
||||||
interval=2
|
|
||||||
|
|
||||||
[CPU-temperature]
|
|
||||||
label=
|
|
||||||
command=~/.config/i3/scripts/temperature
|
|
||||||
interval=30
|
|
||||||
#T_WARN=70
|
|
||||||
#T_CRIT=90
|
|
||||||
#SENSOR_CHIP=""
|
|
||||||
# where SENSOR_CHIP can be find with sensors output
|
|
||||||
# can be used also for GPU temperature or other temperature sensors lm-sensors detects.
|
|
||||||
|
|
||||||
# showing name of connected network (enable for wifi use)
|
|
||||||
#[net]
|
|
||||||
#label=
|
|
||||||
#command=echo "$(LANG=C nmcli d | grep connected | awk '{print $4}')"
|
|
||||||
#interval=30
|
|
||||||
|
|
||||||
[bandwidth]
|
|
||||||
command=~/.config/i3/scripts/bandwidth2
|
|
||||||
interval=persist
|
|
||||||
|
|
||||||
#[vpn]
|
|
||||||
#command=~/.config/i3/scripts/vpn
|
|
||||||
#init_color=#FFFF00
|
|
||||||
#on_color=#00FF00
|
|
||||||
#label=VPN:
|
|
||||||
#interval=5
|
|
||||||
|
|
||||||
# Battery indicator
|
|
||||||
[battery]
|
|
||||||
command=~/.config/i3/scripts/battery
|
|
||||||
# change this to battery-pinebook-pro if you are running on pinebook-pro
|
|
||||||
label=
|
|
||||||
interval=30
|
|
||||||
|
|
||||||
[simple-2]
|
|
||||||
full_text=: :
|
|
||||||
color=#717171
|
|
||||||
|
|
||||||
[pavucontrol]
|
|
||||||
full_text=♪
|
|
||||||
command=pavucontrol
|
|
||||||
|
|
||||||
[volume]
|
|
||||||
command=~/.config/i3/scripts/volume
|
|
||||||
interval=2
|
|
||||||
|
|
||||||
# display keyboard layout name
|
|
||||||
# for keyboard layouts switcher
|
|
||||||
# see i3 config file
|
|
||||||
# this needs xkblayout-state installed from the AUR:
|
|
||||||
# https://aur.archlinux.org/packages/xkblayout-state-git
|
|
||||||
#[keyboard-layout]
|
|
||||||
#command=~/.config/i3/scripts/keyboard-layout
|
|
||||||
#interval=2
|
|
||||||
|
|
||||||
[keybindings]
|
|
||||||
full_text=
|
|
||||||
command=~/.config/i3/scripts/keyhint
|
|
||||||
|
|
||||||
# power-profiles-daemon implementation:
|
|
||||||
# needs package power-profiles-daemon installed and the service running see here:
|
|
||||||
# https://wiki.archlinux.org/title/CPU_frequency_scaling#power-profiles-daemon
|
|
||||||
|
|
||||||
#set power-profile
|
|
||||||
[ppd_menu]
|
|
||||||
full_text=
|
|
||||||
command=~/.config/i3/scripts/power-profiles
|
|
||||||
color=#407437
|
|
||||||
|
|
||||||
#Show the current power-profile
|
|
||||||
[ppd-status]
|
|
||||||
command=~/.config/i3/scripts/ppd-status
|
|
||||||
interval=5
|
|
||||||
|
|
||||||
[time]
|
|
||||||
#label=
|
|
||||||
command=date '+%a %d %b %H:%M:%S'
|
|
||||||
interval=1
|
|
||||||
|
|
||||||
[shutdown_menu]
|
|
||||||
full_text=
|
|
||||||
command=~/.config/i3/scripts/powermenu
|
|
||||||
|
|
||||||
[simple-2]
|
|
||||||
full_text=: :
|
|
||||||
color=#717171
|
|
||||||
Executable → Regular
-106
@@ -1,106 +0,0 @@
|
|||||||
EndeavourOS i3wm Keybindings cheat sheet:
|
|
||||||
|
|
||||||
--> to update this run the following command:
|
|
||||||
wget --backups=1 https://raw.githubusercontent.com/endeavouros-team/endeavouros-i3wm-setup/main/.config/i3/keybindings -P ~/.config/i3/
|
|
||||||
|
|
||||||
All sources and updates are available at GitHub:
|
|
||||||
https://github.com/endeavouros-team/endeavouros-i3wm-setup
|
|
||||||
|
|
||||||
For reference consult our WIKI:
|
|
||||||
https://discovery.endeavouros.com/window-tiling-managers/i3-wm/
|
|
||||||
|
|
||||||
= windows key
|
|
||||||
|
|
||||||
# start xfce4-terminal
|
|
||||||
+Return
|
|
||||||
|
|
||||||
# kill focused window
|
|
||||||
+q
|
|
||||||
|
|
||||||
# Application menu search by typing (fancy Rofi menu):
|
|
||||||
+d
|
|
||||||
|
|
||||||
# Window switcher menu (fancy Rofi menu):
|
|
||||||
+t
|
|
||||||
|
|
||||||
# fancy exit-menu on bottom right:
|
|
||||||
+Shift+e
|
|
||||||
|
|
||||||
# Lock the system
|
|
||||||
# lock with a picture or blurring the screen (options in config)
|
|
||||||
+l
|
|
||||||
|
|
||||||
# reload the configuration file
|
|
||||||
+Shift+c
|
|
||||||
|
|
||||||
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
|
|
||||||
+Shift+r
|
|
||||||
|
|
||||||
# keybinding in fancy rofi (automated)
|
|
||||||
F1
|
|
||||||
|
|
||||||
# full keybinding list in editor:
|
|
||||||
+F1
|
|
||||||
|
|
||||||
# change window focus
|
|
||||||
+j focus left
|
|
||||||
+k focus down
|
|
||||||
+b focus up
|
|
||||||
+o focus right
|
|
||||||
|
|
||||||
# alternatively, you can use the cursor keys:
|
|
||||||
+Left focus left
|
|
||||||
+Down focus down
|
|
||||||
+Up focus up
|
|
||||||
+Right focus right
|
|
||||||
|
|
||||||
# move a focused window
|
|
||||||
+Shift+j move left
|
|
||||||
+Shift+k move down
|
|
||||||
+Shift+b move up
|
|
||||||
+Shift+o move right
|
|
||||||
|
|
||||||
# alternatively, you can use the cursor keys:
|
|
||||||
+Shift+Left move left
|
|
||||||
+Shift+Down move down
|
|
||||||
+Shift+Up move up
|
|
||||||
+Shift+Right move right
|
|
||||||
|
|
||||||
# split in horizontal orientation
|
|
||||||
+h split h
|
|
||||||
|
|
||||||
# split in vertical orientation
|
|
||||||
+v split v
|
|
||||||
|
|
||||||
# enter fullscreen mode for the focused container
|
|
||||||
+f fullscreen toggle
|
|
||||||
|
|
||||||
# change container layout (stacked, tabbed, toggle split)
|
|
||||||
+s layout stacking
|
|
||||||
+g layout tabbed
|
|
||||||
+e layout toggle split
|
|
||||||
|
|
||||||
# toggle tiling / floating
|
|
||||||
+Shift+space floating toggle
|
|
||||||
|
|
||||||
# change focus between tiling / floating windows
|
|
||||||
+space focus mode_toggle
|
|
||||||
|
|
||||||
# focus the parent container
|
|
||||||
+a focus parent
|
|
||||||
|
|
||||||
# focus the child container
|
|
||||||
#+d focus child
|
|
||||||
|
|
||||||
# resize floating window
|
|
||||||
+right mouse button
|
|
||||||
|
|
||||||
## Multimedia Keys
|
|
||||||
|
|
||||||
# Redirect sound to headphones
|
|
||||||
+p
|
|
||||||
|
|
||||||
## App shortcuts
|
|
||||||
+w starts Firefox
|
|
||||||
+n starts Thunar
|
|
||||||
Button screenshot
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
#
|
|
||||||
# Copyright (C) 2015 James Murphy
|
|
||||||
# Licensed under the terms of the GNU GPL v2 only.
|
|
||||||
#
|
|
||||||
# i3blocks blocklet script to monitor bandwidth usage
|
|
||||||
# detecting active device device
|
|
||||||
# option to set used unit
|
|
||||||
|
|
||||||
iface="${BLOCK_INSTANCE}"
|
|
||||||
iface="${IFACE:-$iface}"
|
|
||||||
dt="${DT:-3}"
|
|
||||||
unit="${UNIT:-MB}"
|
|
||||||
LABEL="${LABEL:-<span font='FontAwesome'>⇄ </span>}" # down arrow up arrow
|
|
||||||
printf_command="${PRINTF_COMMAND:-"printf \"${LABEL}%1.0f/%1.0f %s/s\\n\", rx, wx, unit;"}"
|
|
||||||
|
|
||||||
function default_interface {
|
|
||||||
ip route | awk '/^default via/ {print $5; exit}'
|
|
||||||
}
|
|
||||||
|
|
||||||
function check_proc_net_dev {
|
|
||||||
if [ ! -f "/proc/net/dev" ]; then
|
|
||||||
echo "/proc/net/dev not found"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function list_interfaces {
|
|
||||||
check_proc_net_dev
|
|
||||||
echo "Interfaces in /proc/net/dev:"
|
|
||||||
grep -o "^[^:]\\+:" /proc/net/dev | tr -d " :"
|
|
||||||
}
|
|
||||||
|
|
||||||
while getopts i:t:u:p:lh opt; do
|
|
||||||
case "$opt" in
|
|
||||||
i) iface="$OPTARG" ;;
|
|
||||||
t) dt="$OPTARG" ;;
|
|
||||||
u) unit="$OPTARG" ;;
|
|
||||||
p) printf_command="$OPTARG" ;;
|
|
||||||
l) list_interfaces && exit 0 ;;
|
|
||||||
h) printf \
|
|
||||||
"Usage: bandwidth3 [-i interface] [-t time] [-u unit] [-p printf_command] [-l] [-h]
|
|
||||||
Options:
|
|
||||||
-i\tNetwork interface to measure. Default determined using \`ip route\`.
|
|
||||||
-t\tTime interval in seconds between measurements. Default: 3
|
|
||||||
-u\tUnits to measure bytes in. Default: Mb
|
|
||||||
\tAllowed units: Kb, KB, Mb, MB, Gb, GB, Tb, TB
|
|
||||||
\tUnits may have optional it/its/yte/ytes on the end, e.g. Mbits, KByte
|
|
||||||
-p\tAwk command to be called after a measurement is made.
|
|
||||||
\tDefault: printf \"<span font='FontAwesome'> </span>%%-5.1f/%%5.1f %%s/s\\\\n\", rx, wx, unit;
|
|
||||||
\tExposed variables: rx, wx, tx, unit, iface
|
|
||||||
-l\tList available interfaces in /proc/net/dev
|
|
||||||
-h\tShow this help text
|
|
||||||
" && exit 0;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
check_proc_net_dev
|
|
||||||
|
|
||||||
iface="${iface:-$(default_interface)}"
|
|
||||||
while [ -z "$iface" ]; do
|
|
||||||
echo No default interface
|
|
||||||
sleep "$dt"
|
|
||||||
iface=$(default_interface)
|
|
||||||
done
|
|
||||||
|
|
||||||
case "$unit" in
|
|
||||||
Kb|Kbit|Kbits) bytes_per_unit=$((1024 / 8));;
|
|
||||||
KB|KByte|KBytes) bytes_per_unit=$((1024));;
|
|
||||||
Mb|Mbit|Mbits) bytes_per_unit=$((1024 * 1024 / 8));;
|
|
||||||
MB|MByte|MBytes) bytes_per_unit=$((1024 * 1024));;
|
|
||||||
Gb|Gbit|Gbits) bytes_per_unit=$((1024 * 1024 * 1024 / 8));;
|
|
||||||
GB|GByte|GBytes) bytes_per_unit=$((1024 * 1024 * 1024));;
|
|
||||||
Tb|Tbit|Tbits) bytes_per_unit=$((1024 * 1024 * 1024 * 1024 / 8));;
|
|
||||||
TB|TByte|TBytes) bytes_per_unit=$((1024 * 1024 * 1024 * 1024));;
|
|
||||||
*) echo Bad unit "$unit" && exit 1;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
scalar=$((bytes_per_unit * dt))
|
|
||||||
init_line=$(cat /proc/net/dev | grep "^[ ]*$iface:")
|
|
||||||
if [ -z "$init_line" ]; then
|
|
||||||
echo Interface not found in /proc/net/dev: "$iface"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
init_received=$(awk '{print $2}' <<< $init_line)
|
|
||||||
init_sent=$(awk '{print $10}' <<< $init_line)
|
|
||||||
|
|
||||||
(while true; do cat /proc/net/dev; sleep "$dt"; done) |\
|
|
||||||
stdbuf -oL grep "^[ ]*$iface:" |\
|
|
||||||
awk -v scalar="$scalar" -v unit="$unit" -v iface="$iface" '
|
|
||||||
BEGIN {
|
|
||||||
old_received='"$init_received"'
|
|
||||||
old_sent='"$init_sent"'
|
|
||||||
}
|
|
||||||
{
|
|
||||||
received=$2
|
|
||||||
sent=$10
|
|
||||||
rx=(received-old_received)/scalar
|
|
||||||
wx=(sent-old_sent)/scalar
|
|
||||||
tx=rx+wx
|
|
||||||
old_received=received
|
|
||||||
old_sent=sent
|
|
||||||
if (rx >= 0 && wx >= 0) {
|
|
||||||
'"$printf_command"'
|
|
||||||
fflush(stdout)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
#
|
|
||||||
# Copyright (C) 2016 James Murphy
|
|
||||||
# Licensed under the GPL version 2 only
|
|
||||||
#
|
|
||||||
# A battery indicator blocklet script for i3blocks
|
|
||||||
|
|
||||||
from subprocess import check_output
|
|
||||||
import os
|
|
||||||
import re
|
|
||||||
|
|
||||||
config = dict(os.environ)
|
|
||||||
status = check_output(['acpi'], universal_newlines=True)
|
|
||||||
|
|
||||||
if not status:
|
|
||||||
# stands for no battery found
|
|
||||||
color = config.get("color_10", "red")
|
|
||||||
fulltext = "<span color='{}'><span font='FontAwesome'>\uf00d \uf240</span></span>".format(color)
|
|
||||||
percentleft = 100
|
|
||||||
else:
|
|
||||||
# if there is more than one battery in one laptop, the percentage left is
|
|
||||||
# available for each battery separately, although state and remaining
|
|
||||||
# time for overall block is shown in the status of the first battery
|
|
||||||
batteries = status.split("\n")
|
|
||||||
state_batteries=[]
|
|
||||||
commasplitstatus_batteries=[]
|
|
||||||
percentleft_batteries=[]
|
|
||||||
time = ""
|
|
||||||
for battery in batteries:
|
|
||||||
if battery!='':
|
|
||||||
state_batteries.append(battery.split(": ")[1].split(", ")[0])
|
|
||||||
commasplitstatus = battery.split(", ")
|
|
||||||
if not time:
|
|
||||||
time = commasplitstatus[-1].strip()
|
|
||||||
# check if it matches a time
|
|
||||||
time = re.match(r"(\d+):(\d+)", time)
|
|
||||||
if time:
|
|
||||||
time = ":".join(time.groups())
|
|
||||||
timeleft = " ({})".format(time)
|
|
||||||
else:
|
|
||||||
timeleft = ""
|
|
||||||
|
|
||||||
p = int(commasplitstatus[1].rstrip("%\n"))
|
|
||||||
if p>0:
|
|
||||||
percentleft_batteries.append(p)
|
|
||||||
commasplitstatus_batteries.append(commasplitstatus)
|
|
||||||
state = state_batteries[0]
|
|
||||||
commasplitstatus = commasplitstatus_batteries[0]
|
|
||||||
if percentleft_batteries:
|
|
||||||
percentleft = int(sum(percentleft_batteries)/len(percentleft_batteries))
|
|
||||||
else:
|
|
||||||
percentleft = 0
|
|
||||||
|
|
||||||
# stands for charging
|
|
||||||
color = config.get("color_charging", "yellow")
|
|
||||||
FA_LIGHTNING = "<span color='{}'><span font='FontAwesome'>\uf0e7</span></span>".format(color)
|
|
||||||
|
|
||||||
# stands for plugged in
|
|
||||||
FA_PLUG = "<span font='FontAwesome'>\uf1e6</span>"
|
|
||||||
|
|
||||||
# stands for using battery
|
|
||||||
FA_BATTERY = "<span font='FontAwesome'>\uf240</span>"
|
|
||||||
|
|
||||||
# stands for unknown status of battery
|
|
||||||
FA_QUESTION = "<span font='FontAwesome'>\uf128</span>"
|
|
||||||
|
|
||||||
|
|
||||||
if state == "Discharging":
|
|
||||||
fulltext = FA_BATTERY + " "
|
|
||||||
elif state == "Full":
|
|
||||||
fulltext = FA_PLUG + " "
|
|
||||||
timeleft = ""
|
|
||||||
elif state == "Unknown":
|
|
||||||
fulltext = FA_QUESTION + " " + FA_BATTERY + " "
|
|
||||||
timeleft = ""
|
|
||||||
else:
|
|
||||||
fulltext = FA_LIGHTNING + " " + FA_PLUG + " "
|
|
||||||
|
|
||||||
def color(percent):
|
|
||||||
if percent < 10:
|
|
||||||
# exit code 33 will turn background red
|
|
||||||
return config.get("color_10", "#FFFFFF")
|
|
||||||
if percent < 20:
|
|
||||||
return config.get("color_20", "#FF3300")
|
|
||||||
if percent < 30:
|
|
||||||
return config.get("color_30", "#FF6600")
|
|
||||||
if percent < 40:
|
|
||||||
return config.get("color_40", "#FF9900")
|
|
||||||
if percent < 50:
|
|
||||||
return config.get("color_50", "#FFCC00")
|
|
||||||
if percent < 60:
|
|
||||||
return config.get("color_60", "#FFFF00")
|
|
||||||
if percent < 70:
|
|
||||||
return config.get("color_70", "#FFFF33")
|
|
||||||
if percent < 80:
|
|
||||||
return config.get("color_80", "#FFFF66")
|
|
||||||
return config.get("color_full", "#FFFFFF")
|
|
||||||
|
|
||||||
form = '<span color="{}">{}%</span>'
|
|
||||||
fulltext += form.format(color(percentleft), percentleft)
|
|
||||||
#fulltext += timeleft
|
|
||||||
|
|
||||||
print(fulltext)
|
|
||||||
print(fulltext)
|
|
||||||
if percentleft < 10:
|
|
||||||
exit(33)
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# simple Shellscript for i3blocks on Pinebook pro
|
|
||||||
# 05012020 geri123 //at// gmx.net Gerhard S.
|
|
||||||
# battery-symbols: you need the awesome-terminal-font package installed
|
|
||||||
|
|
||||||
PERCENT=$(cat /sys/class/power_supply/cw2015-battery/capacity)
|
|
||||||
STATUS=$(cat /sys/class/power_supply/cw2015-battery/status)
|
|
||||||
case $((
|
|
||||||
$PERCENT >= 0 && $PERCENT <= 20 ? 1 :
|
|
||||||
$PERCENT > 20 && $PERCENT <= 40 ? 2 :
|
|
||||||
$PERCENT > 40 && $PERCENT <= 60 ? 3 :
|
|
||||||
$PERCENT > 60 && $PERCENT <= 80 ? 4 : 5)) in
|
|
||||||
#
|
|
||||||
(1) echo $STATUS:"" :$PERCENT%;;
|
|
||||||
(2) echo $STATUS:"" :$PERCENT%;;
|
|
||||||
(3) echo $STATUS:"" :$PERCENT%;;
|
|
||||||
(4) echo $STATUS:"" :$PERCENT%;;
|
|
||||||
(5) echo $STATUS:"" :$PERCENT%;;
|
|
||||||
esac
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# simple screenlocker using i3lock that creates ablurred screenshot to overlay
|
|
||||||
|
|
||||||
PICTURE=/tmp/i3lock.png
|
|
||||||
SCREENSHOT="scrot -z $PICTURE"
|
|
||||||
|
|
||||||
BLUR="5x4"
|
|
||||||
|
|
||||||
$SCREENSHOT
|
|
||||||
magick $PICTURE -blur $BLUR $PICTURE
|
|
||||||
i3lock -i $PICTURE
|
|
||||||
shred $PICTURE
|
|
||||||
rm $PICTURE
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
#!/usr/bin/perl
|
|
||||||
#
|
|
||||||
# Copyright 2014 Pierre Mavro <deimos@deimos.fr>
|
|
||||||
# Copyright 2014 Vivien Didelot <vivien@didelot.org>
|
|
||||||
# Copyright 2014 Andreas Guldstrand <andreas.guldstrand@gmail.com>
|
|
||||||
#
|
|
||||||
# Licensed under the terms of the GNU GPL v3, or any later version.
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use utf8;
|
|
||||||
use Getopt::Long;
|
|
||||||
|
|
||||||
# default values
|
|
||||||
my $t_warn = $ENV{T_WARN} // 50;
|
|
||||||
my $t_crit = $ENV{T_CRIT} // 80;
|
|
||||||
my $cpu_usage = -1;
|
|
||||||
my $decimals = $ENV{DECIMALS} // 0;
|
|
||||||
my $label = $ENV{LABEL} // "";
|
|
||||||
|
|
||||||
sub help {
|
|
||||||
print "Usage: cpu_usage [-w <warning>] [-c <critical>] [-d <decimals>]\n";
|
|
||||||
print "-w <percent>: warning threshold to become yellow\n";
|
|
||||||
print "-c <percent>: critical threshold to become red\n";
|
|
||||||
print "-d <decimals>: Use <decimals> decimals for percentage (default is $decimals) \n";
|
|
||||||
exit 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
GetOptions("help|h" => \&help,
|
|
||||||
"w=i" => \$t_warn,
|
|
||||||
"c=i" => \$t_crit,
|
|
||||||
"d=i" => \$decimals,
|
|
||||||
);
|
|
||||||
|
|
||||||
# Get CPU usage
|
|
||||||
$ENV{LC_ALL}="en_US"; # if mpstat is not run under en_US locale, things may break, so make sure it is
|
|
||||||
open (MPSTAT, 'mpstat 1 1 |') or die;
|
|
||||||
while (<MPSTAT>) {
|
|
||||||
if (/^.*\s+(\d+\.\d+)[\s\x00]?$/) {
|
|
||||||
$cpu_usage = 100 - $1; # 100% - %idle
|
|
||||||
last;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
close(MPSTAT);
|
|
||||||
|
|
||||||
$cpu_usage eq -1 and die 'Can\'t find CPU information';
|
|
||||||
|
|
||||||
# Print short_text, full_text
|
|
||||||
print "${label}";
|
|
||||||
printf "%02.${decimals}f%%\n", $cpu_usage;
|
|
||||||
print "${label}";
|
|
||||||
printf "%02.${decimals}f%%\n", $cpu_usage;
|
|
||||||
|
|
||||||
# Print color, if needed
|
|
||||||
if ($cpu_usage >= $t_crit) {
|
|
||||||
print "#FF0000\n";
|
|
||||||
exit 33;
|
|
||||||
} elsif ($cpu_usage >= $t_warn) {
|
|
||||||
print "#FFFC00\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
DIR="${DIR:-$BLOCK_INSTANCE}"
|
|
||||||
DIR="${DIR:-$HOME}"
|
|
||||||
ALERT_LOW="${ALERT_LOW:-$1}"
|
|
||||||
ALERT_LOW="${ALERT_LOW:-10}" # color will turn red under this value (default: 10%)
|
|
||||||
|
|
||||||
LOCAL_FLAG="-l"
|
|
||||||
if [ "$1" = "-n" ] || [ "$2" = "-n" ]; then
|
|
||||||
LOCAL_FLAG=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
df -h -P $LOCAL_FLAG "$DIR" | awk -v label="$LABEL" -v alert_low=$ALERT_LOW '
|
|
||||||
/\/.*/ {
|
|
||||||
# full text
|
|
||||||
print label $4
|
|
||||||
|
|
||||||
# short text
|
|
||||||
print label $4
|
|
||||||
|
|
||||||
use=$5
|
|
||||||
|
|
||||||
# no need to continue parsing
|
|
||||||
exit 0
|
|
||||||
}
|
|
||||||
|
|
||||||
END {
|
|
||||||
gsub(/%$/,"",use)
|
|
||||||
if (100 - use < alert_low) {
|
|
||||||
# color
|
|
||||||
print "#FF0000"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Suspends xset screensaver/DPMS blanking while any visible workspace has a
|
|
||||||
# fullscreen window (video, game, presentation), restores normal timeouts
|
|
||||||
# once nothing is fullscreen.
|
|
||||||
interval="${1:-5}"
|
|
||||||
|
|
||||||
# Single-instance lock: i3 restarts/reloads re-run our autostart exec, so
|
|
||||||
# without this, stray duplicate loops accumulate and race each other's state.
|
|
||||||
# Per session, so a loop lingering from a logged-out session can't block this one.
|
|
||||||
exec 9>"/tmp/.dpms-inhibit-$(id -u)-${XDG_SESSION_ID:-0}.lock"
|
|
||||||
flock -n 9 || exit 0
|
|
||||||
|
|
||||||
has_fullscreen() {
|
|
||||||
python3 - <<'EOF'
|
|
||||||
import json, subprocess, sys
|
|
||||||
|
|
||||||
def is_fullscreen(node):
|
|
||||||
if node.get('window') and 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
|
|
||||||
}
|
|
||||||
|
|
||||||
inhibited=0
|
|
||||||
while true; do
|
|
||||||
# our i3 is gone (logged out): don't linger into the next session
|
|
||||||
i3-msg -t get_version >/dev/null 2>&1 || exit 0
|
|
||||||
if has_fullscreen; then
|
|
||||||
xset s off
|
|
||||||
xset -dpms
|
|
||||||
inhibited=1
|
|
||||||
else
|
|
||||||
if [ "$inhibited" -eq 1 ]; then
|
|
||||||
xset s 300 300
|
|
||||||
xset dpms 0 0 900
|
|
||||||
inhibited=0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
sleep "$interval"
|
|
||||||
done
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Freeze / resume the focused window's process tree (SIGSTOP / SIGCONT).
|
|
||||||
pid=$(xdotool getactivewindow getwindowpid 2>/dev/null) || exit 1
|
|
||||||
|
|
||||||
# collect pid plus all descendants (Wine/Proton games spawn several)
|
|
||||||
descendants() {
|
|
||||||
local p
|
|
||||||
for p in $(pgrep -P "$1"); do
|
|
||||||
echo "$p"
|
|
||||||
descendants "$p"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
pids="$pid $(descendants "$pid")"
|
|
||||||
name=$(ps -o comm= -p "$pid")
|
|
||||||
|
|
||||||
case "$(ps -o state= -p "$pid")" in
|
|
||||||
T*) kill -CONT $pids && notify-send -t 1500 "Resumed" "$name ($pid)" ;;
|
|
||||||
*) kill -STOP $pids && notify-send -t 1500 "Frozen" "$name ($pid)" ;;
|
|
||||||
esac
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
# Freeze/resume the focused window on the controller's Home/guide button (BTN_MODE).
|
|
||||||
# Stdlib only: reads raw evdev events. Gamepads are readable by the seat user.
|
|
||||||
import glob, os, select, signal, struct, subprocess, time
|
|
||||||
|
|
||||||
EV_KEY, BTN_MODE = 1, 0x13c
|
|
||||||
EVENT = struct.Struct('llHHi') # struct input_event
|
|
||||||
LONG_BITS = struct.calcsize('l') * 8
|
|
||||||
CMD = [os.path.expanduser('~/.config/i3/scripts/freeze-toggle')]
|
|
||||||
|
|
||||||
signal.signal(signal.SIGCHLD, signal.SIG_IGN) # auto-reap child processes
|
|
||||||
|
|
||||||
def has_btn_mode(path):
|
|
||||||
try:
|
|
||||||
with open(f'/sys/class/input/{os.path.basename(path)}/device/capabilities/key') as f:
|
|
||||||
words = f.read().split()
|
|
||||||
except OSError:
|
|
||||||
return False
|
|
||||||
bits = 0
|
|
||||||
for w in words:
|
|
||||||
bits = bits << LONG_BITS | int(w, 16)
|
|
||||||
return bits >> BTN_MODE & 1
|
|
||||||
|
|
||||||
fds = {} # fd -> device path
|
|
||||||
last = 0.0
|
|
||||||
rescan = 0.0
|
|
||||||
while True:
|
|
||||||
if time.monotonic() >= rescan: # pick up hotplugged controllers
|
|
||||||
for path in glob.glob('/dev/input/event*'):
|
|
||||||
if path not in fds.values() and has_btn_mode(path):
|
|
||||||
try:
|
|
||||||
fds[os.open(path, os.O_RDONLY)] = path
|
|
||||||
except OSError:
|
|
||||||
pass
|
|
||||||
rescan = time.monotonic() + 2
|
|
||||||
ready, _, _ = select.select(list(fds), [], [], 2)
|
|
||||||
for fd in ready:
|
|
||||||
try:
|
|
||||||
data = os.read(fd, EVENT.size * 64)
|
|
||||||
except OSError: # controller unplugged
|
|
||||||
os.close(fd)
|
|
||||||
del fds[fd]
|
|
||||||
continue
|
|
||||||
for sec, usec, type_, code, value in EVENT.iter_unpack(data):
|
|
||||||
if type_ == EV_KEY and code == BTN_MODE and value == 1:
|
|
||||||
now = sec + usec / 1e6
|
|
||||||
if now - last < 0.4: # GuliKit's Home button double-fires ~10ms apart
|
|
||||||
continue
|
|
||||||
last = now
|
|
||||||
subprocess.Popen(CMD, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# simple yad gui to show default keybindings
|
|
||||||
|
|
||||||
Main() {
|
|
||||||
source /usr/share/endeavouros/scripts/eos-script-lib-yad || return 1
|
|
||||||
|
|
||||||
local command=(
|
|
||||||
eos_yad --title="EndeavourOS i3-wm keybindings:" --no-buttons --geometry=400x345-15-400 --list
|
|
||||||
--column=key: --column=description: --column=command:
|
|
||||||
"ESC" "close this app" ""
|
|
||||||
"=" "modkey" "(set mod Mod4)"
|
|
||||||
"+enter" "open a terminal" ""
|
|
||||||
"+Shift+n" "new empty workspace" ""
|
|
||||||
"+w" "open Browser" ""
|
|
||||||
"+n" "open Filebrowser" ""
|
|
||||||
"+d" "app menu" ""
|
|
||||||
"+q" "close focused app" ""
|
|
||||||
"Print-key" "screenshot" ""
|
|
||||||
"+Shift+e" "logout menu" ""
|
|
||||||
"F1" "open keybinding helper" ""
|
|
||||||
)
|
|
||||||
|
|
||||||
"${command[@]}"
|
|
||||||
}
|
|
||||||
|
|
||||||
Main "$@"
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Invoked by xss-lock on idle (after 5min) and before suspend. Idle locking
|
|
||||||
# during fullscreen is suppressed by dpms-inhibit.
|
|
||||||
exec ~/.config/i3/scripts/lock-now "$1"
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
wall_dir="${1:?wallpaper directory required}"
|
|
||||||
img=$(find "$wall_dir" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) | shuf -n1)
|
|
||||||
tmp=/tmp/lockscreen.png
|
|
||||||
res=$(xrandr --current | awk '/ connected/ {getline; print $1; exit}')
|
|
||||||
: "${res:=1920x1080}"
|
|
||||||
if [ -n "$img" ] && convert "$img" -resize "${res}^" -gravity Center -extent "$res" "$tmp" 2>/dev/null; then
|
|
||||||
exec i3lock -i "$tmp" --nofork
|
|
||||||
else
|
|
||||||
exec i3lock -c 000000 --nofork
|
|
||||||
fi
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
wall_dir="${1:?wallpaper directory required}"
|
|
||||||
img=$(find "$wall_dir" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) | shuf -n1)
|
|
||||||
tmp=/tmp/lockscreen.png
|
|
||||||
res=$(xrandr --current | awk '/ connected/ {getline; print $1; exit}')
|
|
||||||
: "${res:=1920x1080}"
|
|
||||||
if [ -n "$img" ] && convert "$img" -resize "${res}^" -gravity Center -extent "$res" "$tmp" 2>/dev/null; then
|
|
||||||
i3lock -i "$tmp"
|
|
||||||
else
|
|
||||||
i3lock -c 000000
|
|
||||||
fi
|
|
||||||
systemctl suspend
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
|
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
TYPE="${BLOCK_INSTANCE:-mem}"
|
|
||||||
|
|
||||||
awk -v type=$TYPE '
|
|
||||||
/^MemTotal:/ {
|
|
||||||
mem_total=$2
|
|
||||||
}
|
|
||||||
/^MemFree:/ {
|
|
||||||
mem_free=$2
|
|
||||||
}
|
|
||||||
/^Buffers:/ {
|
|
||||||
mem_free+=$2
|
|
||||||
}
|
|
||||||
/^Cached:/ {
|
|
||||||
mem_free+=$2
|
|
||||||
}
|
|
||||||
/^SwapTotal:/ {
|
|
||||||
swap_total=$2
|
|
||||||
}
|
|
||||||
/^SwapFree:/ {
|
|
||||||
swap_free=$2
|
|
||||||
}
|
|
||||||
END {
|
|
||||||
if (type == "swap") {
|
|
||||||
free=swap_free/1024/1024
|
|
||||||
used=(swap_total-swap_free)/1024/1024
|
|
||||||
total=swap_total/1024/1024
|
|
||||||
} else {
|
|
||||||
free=mem_free/1024/1024
|
|
||||||
used=(mem_total-mem_free)/1024/1024
|
|
||||||
total=mem_total/1024/1024
|
|
||||||
}
|
|
||||||
|
|
||||||
pct=0
|
|
||||||
if (total > 0) {
|
|
||||||
pct=used/total*100
|
|
||||||
}
|
|
||||||
|
|
||||||
# full text
|
|
||||||
# printf("%.1fG/%.1fG (%.f%%)\n", used, total, pct)
|
|
||||||
|
|
||||||
# short text
|
|
||||||
printf("%02.f%%\n", pct)
|
|
||||||
|
|
||||||
# color
|
|
||||||
if (pct > 90) {
|
|
||||||
print("#FF0000")
|
|
||||||
} else if (pct > 80) {
|
|
||||||
print("#FFAE00")
|
|
||||||
} else if (pct > 70) {
|
|
||||||
print("#FFF600")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
' /proc/meminfo
|
|
||||||
@@ -1,471 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# openweater - OpenWeatherMap Weather Fetcher for Waybar/Status Bars
|
|
||||||
#
|
|
||||||
# Copyright (C) 2025 Johannes Kamprad
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
|
|
||||||
# openweater - OpenWeatherMap Weather Fetcher for Waybar/Status Bars
|
|
||||||
# Secure API key handling with configurable locations
|
|
||||||
# including setup script and help
|
|
||||||
# Options:
|
|
||||||
# -h, --help Show this help message
|
|
||||||
# -c, --city-id ID Override city ID (required if not in config)
|
|
||||||
# -k, --api-key KEY Override API key (not recommended, use config file)
|
|
||||||
# -u, --units UNITS Units: metric, imperial, kelvin (default: $DEFAULT_UNITS)
|
|
||||||
# -f, --force-refresh Force refresh (ignore cache)
|
|
||||||
# --setup Interactive setup wizard
|
|
||||||
# --show-config Show current configuration
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
# Set C locale to avoid German decimal formatting issues
|
|
||||||
export LC_NUMERIC=C
|
|
||||||
export LC_ALL=C
|
|
||||||
|
|
||||||
# Colors for output
|
|
||||||
RED='\033[0;31m'
|
|
||||||
GREEN='\033[0;32m'
|
|
||||||
YELLOW='\033[1;33m'
|
|
||||||
NC='\033[0m' # No Color
|
|
||||||
|
|
||||||
# Default configuration (no default location)
|
|
||||||
DEFAULT_UNITS="metric"
|
|
||||||
CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}"
|
|
||||||
CONFIG_FILE="$CONFIG_DIR/openweather/config"
|
|
||||||
CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/openweather"
|
|
||||||
CACHE_FILE="$CACHE_DIR/weather_data"
|
|
||||||
CACHE_DURATION=600 # 10 minutes
|
|
||||||
|
|
||||||
# Logging functions
|
|
||||||
log_error() {
|
|
||||||
echo -e "${RED}[ERROR]${NC} $*" >&2
|
|
||||||
}
|
|
||||||
|
|
||||||
log_warn() {
|
|
||||||
echo -e "${YELLOW}[WARN]${NC} $*" >&2
|
|
||||||
}
|
|
||||||
|
|
||||||
# Show help
|
|
||||||
show_help() {
|
|
||||||
cat << EOF
|
|
||||||
Usage: $(basename "$0") [OPTIONS]
|
|
||||||
|
|
||||||
Secure OpenWeatherMap weather fetcher with configurable locations.
|
|
||||||
|
|
||||||
Options:
|
|
||||||
-h, --help Show this help message
|
|
||||||
-c, --city-id ID Override city ID (required if not in config)
|
|
||||||
-k, --api-key KEY Override API key (not recommended, use config file)
|
|
||||||
-u, --units UNITS Units: metric, imperial, kelvin (default: $DEFAULT_UNITS)
|
|
||||||
-f, --force-refresh Force refresh (ignore cache)
|
|
||||||
--setup Interactive setup wizard
|
|
||||||
--show-config Show current configuration
|
|
||||||
|
|
||||||
Configuration:
|
|
||||||
Config file: $CONFIG_FILE
|
|
||||||
|
|
||||||
Create config file with:
|
|
||||||
OPENWEATHER_API_KEY="your_api_key_here"
|
|
||||||
OPENWEATHER_CITY_ID="your_city_id" # Required
|
|
||||||
OPENWEATHER_UNITS="metric" # Optional
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
$(basename "$0") # Use config file settings
|
|
||||||
$(basename "$0") --city-id 5128581 # New York
|
|
||||||
$(basename "$0") --units imperial # Fahrenheit
|
|
||||||
$(basename "$0") --setup # Run setup wizard
|
|
||||||
|
|
||||||
Get your free API key at: https://openweathermap.org/api
|
|
||||||
Find city IDs at: https://openweathermap.org/find
|
|
||||||
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check dependencies
|
|
||||||
check_dependencies() {
|
|
||||||
local missing_deps=()
|
|
||||||
|
|
||||||
for cmd in jq curl; do
|
|
||||||
if ! command -v "$cmd" >/dev/null 2>&1; then
|
|
||||||
missing_deps+=("$cmd")
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [[ ${#missing_deps[@]} -gt 0 ]]; then
|
|
||||||
log_error "Missing required dependencies: ${missing_deps[*]}"
|
|
||||||
echo "Install with: sudo pacman -S ${missing_deps[*]}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Load configuration
|
|
||||||
load_config() {
|
|
||||||
# Set defaults (no default city ID)
|
|
||||||
OPENWEATHER_CITY_ID=""
|
|
||||||
OPENWEATHER_UNITS="$DEFAULT_UNITS"
|
|
||||||
|
|
||||||
# Load from config file if it exists
|
|
||||||
if [[ -f "$CONFIG_FILE" ]]; then
|
|
||||||
source "$CONFIG_FILE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Override with environment variables if set
|
|
||||||
OPENWEATHER_API_KEY="${OPENWEATHER_API_KEY:-}"
|
|
||||||
OPENWEATHER_CITY_ID="${OPENWEATHER_CITY_ID:-}"
|
|
||||||
OPENWEATHER_UNITS="${OPENWEATHER_UNITS:-$DEFAULT_UNITS}"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Validate API key
|
|
||||||
validate_api_key() {
|
|
||||||
if [[ -z "$OPENWEATHER_API_KEY" ]]; then
|
|
||||||
log_error "No API key found!"
|
|
||||||
echo
|
|
||||||
echo "To fix this:"
|
|
||||||
echo "1. Get free API key: https://openweathermap.org/api"
|
|
||||||
echo "2. Run setup wizard: $0 --setup"
|
|
||||||
echo "3. Or set environment variable: export OPENWEATHER_API_KEY=your_key"
|
|
||||||
echo "4. Or create config file: $CONFIG_FILE"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Basic validation (OpenWeatherMap keys are typically 32 chars)
|
|
||||||
if [[ ${#OPENWEATHER_API_KEY} -ne 32 ]]; then
|
|
||||||
log_warn "API key length seems incorrect (expected 32 characters, got ${#OPENWEATHER_API_KEY})"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Validate city ID
|
|
||||||
validate_city_id() {
|
|
||||||
if [[ -z "$OPENWEATHER_CITY_ID" ]]; then
|
|
||||||
log_error "No city ID found!"
|
|
||||||
echo
|
|
||||||
echo "To fix this:"
|
|
||||||
echo "1. Run setup wizard: $0 --setup"
|
|
||||||
echo "2. Or set environment variable: export OPENWEATHER_CITY_ID=your_city_id"
|
|
||||||
echo "3. Or add OPENWEATHER_CITY_ID=\"your_city_id\" to: $CONFIG_FILE"
|
|
||||||
echo "4. Or provide city ID via command line: $0 --city-id your_city_id"
|
|
||||||
echo
|
|
||||||
echo "Find city IDs at: https://openweathermap.org/find"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Basic validation (city IDs are typically numeric)
|
|
||||||
if [[ ! "$OPENWEATHER_CITY_ID" =~ ^[0-9]+$ ]]; then
|
|
||||||
log_warn "City ID format seems incorrect (expected numeric, got: $OPENWEATHER_CITY_ID)"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Setup wizard
|
|
||||||
run_setup() {
|
|
||||||
echo -e "${GREEN}=== OpenWeatherMap Setup Wizard ===${NC}"
|
|
||||||
echo
|
|
||||||
|
|
||||||
# Create config directory
|
|
||||||
mkdir -p "$(dirname "$CONFIG_FILE")"
|
|
||||||
|
|
||||||
# Get API key
|
|
||||||
echo "Get your free API key at: https://openweathermap.org/api"
|
|
||||||
echo
|
|
||||||
echo -n "Enter your OpenWeatherMap API key: "
|
|
||||||
read -r api_key
|
|
||||||
|
|
||||||
if [[ -z "$api_key" ]]; then
|
|
||||||
log_error "API key cannot be empty"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Get city ID (required)
|
|
||||||
echo
|
|
||||||
echo "Find your city ID at: https://openweathermap.org/find"
|
|
||||||
echo -n "Enter city ID: "
|
|
||||||
read -r city_id
|
|
||||||
|
|
||||||
if [[ -z "$city_id" ]]; then
|
|
||||||
log_error "City ID cannot be empty"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Get units (optional)
|
|
||||||
echo
|
|
||||||
echo "Available units: metric (°C), imperial (°F), kelvin (K)"
|
|
||||||
echo -n "Enter units [metric]: "
|
|
||||||
read -r units
|
|
||||||
units="${units:-metric}"
|
|
||||||
|
|
||||||
# Write config file
|
|
||||||
cat > "$CONFIG_FILE" << EOF
|
|
||||||
# OpenWeatherMap Configuration
|
|
||||||
# Generated by $(basename "$0") setup wizard on $(date)
|
|
||||||
|
|
||||||
# Your API key from https://openweathermap.org/api
|
|
||||||
OPENWEATHER_API_KEY="$api_key"
|
|
||||||
|
|
||||||
# City ID from https://openweathermap.org/find
|
|
||||||
OPENWEATHER_CITY_ID="$city_id"
|
|
||||||
|
|
||||||
# Units: metric, imperial, kelvin
|
|
||||||
OPENWEATHER_UNITS="$units"
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Set secure permissions
|
|
||||||
chmod 600 "$CONFIG_FILE"
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo -e "${GREEN}✅ Configuration saved to: $CONFIG_FILE${NC}"
|
|
||||||
echo -e "${GREEN}✅ File permissions set to 600 (user read/write only)${NC}"
|
|
||||||
echo
|
|
||||||
echo "Testing configuration..."
|
|
||||||
|
|
||||||
# Test the configuration
|
|
||||||
OPENWEATHER_API_KEY="$api_key"
|
|
||||||
OPENWEATHER_CITY_ID="$city_id"
|
|
||||||
OPENWEATHER_UNITS="$units"
|
|
||||||
|
|
||||||
if fetch_weather_data; then
|
|
||||||
echo -e "${GREEN}✅ Configuration test successful!${NC}"
|
|
||||||
else
|
|
||||||
log_error "Configuration test failed. Please check your API key and city ID."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Show current configuration
|
|
||||||
show_config() {
|
|
||||||
echo "=== Current Configuration ==="
|
|
||||||
echo "Config file: $CONFIG_FILE"
|
|
||||||
echo "Cache file: $CACHE_FILE"
|
|
||||||
echo "Cache duration: ${CACHE_DURATION}s"
|
|
||||||
echo
|
|
||||||
|
|
||||||
if [[ -f "$CONFIG_FILE" ]]; then
|
|
||||||
echo "Configuration:"
|
|
||||||
echo " API Key: ${OPENWEATHER_API_KEY:0:8}... (${#OPENWEATHER_API_KEY} chars)"
|
|
||||||
echo " City ID: $OPENWEATHER_CITY_ID"
|
|
||||||
echo " Units: $OPENWEATHER_UNITS"
|
|
||||||
else
|
|
||||||
echo "❌ No configuration file found at: $CONFIG_FILE"
|
|
||||||
echo "Run: $0 --setup"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check cache validity
|
|
||||||
is_cache_valid() {
|
|
||||||
[[ -f "$CACHE_FILE" ]] && \
|
|
||||||
[[ $(($(date +%s) - $(stat -c %Y "$CACHE_FILE" 2>/dev/null || echo 0))) -lt $CACHE_DURATION ]]
|
|
||||||
}
|
|
||||||
|
|
||||||
# Fetch weather data from API
|
|
||||||
fetch_weather_data() {
|
|
||||||
local url="https://api.openweathermap.org/data/2.5/weather?id=${OPENWEATHER_CITY_ID}&units=${OPENWEATHER_UNITS}&appid=${OPENWEATHER_API_KEY}"
|
|
||||||
|
|
||||||
local response
|
|
||||||
if ! response=$(curl -sf "$url" 2>/dev/null); then
|
|
||||||
log_error "Failed to fetch weather data from API"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Validate JSON response
|
|
||||||
if ! echo "$response" | jq . >/dev/null 2>&1; then
|
|
||||||
log_error "Invalid JSON response from API"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check for API error
|
|
||||||
local api_code
|
|
||||||
api_code=$(echo "$response" | jq -r '.cod // empty')
|
|
||||||
if [[ "$api_code" != "200" ]]; then
|
|
||||||
local api_message
|
|
||||||
api_message=$(echo "$response" | jq -r '.message // "Unknown API error"')
|
|
||||||
log_error "API Error ($api_code): $api_message"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Cache the response
|
|
||||||
mkdir -p "$CACHE_DIR"
|
|
||||||
echo "$response" > "$CACHE_FILE"
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# Get weather data (from cache or API)
|
|
||||||
get_weather_data() {
|
|
||||||
local force_refresh="${1:-false}"
|
|
||||||
|
|
||||||
if [[ "$force_refresh" != "true" ]] && is_cache_valid; then
|
|
||||||
cat "$CACHE_FILE"
|
|
||||||
else
|
|
||||||
if fetch_weather_data; then
|
|
||||||
cat "$CACHE_FILE"
|
|
||||||
else
|
|
||||||
# Fallback to cache if available
|
|
||||||
if [[ -f "$CACHE_FILE" ]]; then
|
|
||||||
log_warn "Using stale cache data due to API failure"
|
|
||||||
cat "$CACHE_FILE"
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Calculate wind direction
|
|
||||||
get_wind_direction() {
|
|
||||||
local degrees="$1"
|
|
||||||
local directions=(N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW NNW)
|
|
||||||
local index
|
|
||||||
index=$(awk "BEGIN {print int(($degrees % 360) / 22.5)}")
|
|
||||||
echo "${directions[$index]}"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Get weather icon
|
|
||||||
get_weather_icon() {
|
|
||||||
local condition="$1"
|
|
||||||
case "$condition" in
|
|
||||||
'Clear') echo "☀" ;; # Clear sky
|
|
||||||
'Clouds') echo "☁" ;; # Cloudy
|
|
||||||
'Rain'|'Drizzle') echo "🌧" ;; # Rain
|
|
||||||
'Snow') echo "❄" ;; # Snow
|
|
||||||
'Thunderstorm') echo "⛈" ;; # Thunder
|
|
||||||
'Mist'|'Fog') echo "🌫" ;; # Fog
|
|
||||||
*) echo "🌤" ;; # Default
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
# Safe number formatting (handles locale issues)
|
|
||||||
safe_printf() {
|
|
||||||
local format="$1"
|
|
||||||
local number="$2"
|
|
||||||
|
|
||||||
# Validate number is actually numeric
|
|
||||||
if [[ ! "$number" =~ ^-?[0-9]+(\.[0-9]+)?$ ]]; then
|
|
||||||
echo "0.0"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Use awk for reliable formatting regardless of locale
|
|
||||||
awk "BEGIN {printf \"$format\", $number}"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Format weather output
|
|
||||||
format_weather() {
|
|
||||||
local weather_data="$1"
|
|
||||||
|
|
||||||
# Parse weather data with error checking
|
|
||||||
local condition temp wind_speed_ms wind_deg
|
|
||||||
condition=$(echo "$weather_data" | jq -r '.weather[0].main // "Unknown"')
|
|
||||||
temp=$(echo "$weather_data" | jq -r '.main.temp // "0"')
|
|
||||||
wind_speed_ms=$(echo "$weather_data" | jq -r '.wind.speed // "0"')
|
|
||||||
wind_deg=$(echo "$weather_data" | jq -r '.wind.deg // "0"')
|
|
||||||
|
|
||||||
# Validate parsed data
|
|
||||||
[[ "$condition" == "null" ]] && condition="Unknown"
|
|
||||||
[[ "$temp" == "null" ]] && temp="0"
|
|
||||||
[[ "$wind_speed_ms" == "null" ]] && wind_speed_ms="0"
|
|
||||||
[[ "$wind_deg" == "null" ]] && wind_deg="0"
|
|
||||||
|
|
||||||
# Format temperature with safe formatting
|
|
||||||
local temp_formatted
|
|
||||||
temp_formatted=$(safe_printf "%.1f" "$temp")
|
|
||||||
|
|
||||||
# Convert wind speed to km/h with safe formatting
|
|
||||||
local wind_speed_kmh
|
|
||||||
wind_speed_kmh=$(awk "BEGIN {printf \"%.1f\", ($wind_speed_ms + 0) * 3.6}")
|
|
||||||
|
|
||||||
# Get wind direction
|
|
||||||
local wind_dir
|
|
||||||
wind_dir=$(get_wind_direction "$wind_deg")
|
|
||||||
|
|
||||||
# Get weather icon
|
|
||||||
local icon
|
|
||||||
icon=$(get_weather_icon "$condition")
|
|
||||||
|
|
||||||
# Format unit symbol
|
|
||||||
local unit_symbol
|
|
||||||
case "$OPENWEATHER_UNITS" in
|
|
||||||
"imperial") unit_symbol="°F" ;;
|
|
||||||
"kelvin") unit_symbol="K" ;;
|
|
||||||
*) unit_symbol="°C" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Output formatted weather
|
|
||||||
echo "${icon} ${temp_formatted}${unit_symbol}, ${wind_speed_kmh} km/h ${wind_dir}"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Main function
|
|
||||||
main() {
|
|
||||||
local city_id_override=""
|
|
||||||
local api_key_override=""
|
|
||||||
local units_override=""
|
|
||||||
local force_refresh="false"
|
|
||||||
|
|
||||||
# Parse command line arguments
|
|
||||||
while [[ $# -gt 0 ]]; do
|
|
||||||
case $1 in
|
|
||||||
-h|--help)
|
|
||||||
show_help
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
-c|--city-id)
|
|
||||||
city_id_override="$2"
|
|
||||||
shift 2
|
|
||||||
;;
|
|
||||||
-k|--api-key)
|
|
||||||
api_key_override="$2"
|
|
||||||
shift 2
|
|
||||||
;;
|
|
||||||
-u|--units)
|
|
||||||
units_override="$2"
|
|
||||||
shift 2
|
|
||||||
;;
|
|
||||||
-f|--force-refresh)
|
|
||||||
force_refresh="true"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
--setup)
|
|
||||||
check_dependencies
|
|
||||||
run_setup
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
--show-config)
|
|
||||||
load_config
|
|
||||||
show_config
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
log_error "Unknown option: $1"
|
|
||||||
show_help
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
# Check dependencies
|
|
||||||
check_dependencies
|
|
||||||
|
|
||||||
# Load configuration
|
|
||||||
load_config
|
|
||||||
|
|
||||||
# Apply overrides
|
|
||||||
[[ -n "$city_id_override" ]] && OPENWEATHER_CITY_ID="$city_id_override"
|
|
||||||
[[ -n "$api_key_override" ]] && OPENWEATHER_API_KEY="$api_key_override"
|
|
||||||
[[ -n "$units_override" ]] && OPENWEATHER_UNITS="$units_override"
|
|
||||||
|
|
||||||
# Validate configuration
|
|
||||||
validate_api_key
|
|
||||||
validate_city_id
|
|
||||||
|
|
||||||
# Get and format weather data
|
|
||||||
local weather_data
|
|
||||||
if weather_data=$(get_weather_data "$force_refresh"); then
|
|
||||||
format_weather "$weather_data"
|
|
||||||
else
|
|
||||||
echo "⚠️ Weather data unavailable"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Run main function
|
|
||||||
main "$@"
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Simple power-profiles-daemon switcher using rofi and static theme, with notification
|
|
||||||
#
|
|
||||||
# Copyright (C) 2025 Johannes Kamprad
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
# needs rofi config:
|
|
||||||
# $HOME/.config/rofi/powermenu.rasi
|
|
||||||
|
|
||||||
ROFI_THEME="${HOME}/.config/rofi/power-profiles.rasi"
|
|
||||||
|
|
||||||
# Dependency checks
|
|
||||||
command -v powerprofilesctl >/dev/null 2>&1 || { echo "powerprofilesctl not found"; exit 1; }
|
|
||||||
command -v rofi >/dev/null 2>&1 || { echo "rofi not found"; exit 1; }
|
|
||||||
if ! command -v notify-send >/dev/null 2>&1; then
|
|
||||||
notify_send_missing=true
|
|
||||||
fi
|
|
||||||
|
|
||||||
current_profile="$(powerprofilesctl get 2>/dev/null)"
|
|
||||||
ROFI_ARGS=(-dmenu -i -theme "$ROFI_THEME" -p "Change Profile" -mesg "<b>Current used:</b> $current_profile" -markup-rows)
|
|
||||||
|
|
||||||
# Menu entries
|
|
||||||
cancel=" Cancel"
|
|
||||||
perf=" Performance"
|
|
||||||
balanced=" Balanced"
|
|
||||||
powersave=" Power Saver"
|
|
||||||
# sets chancel to be on top
|
|
||||||
options="$cancel"
|
|
||||||
|
|
||||||
if powerprofilesctl list | grep -q "performance"; then
|
|
||||||
options="$options\n$perf"
|
|
||||||
fi
|
|
||||||
if powerprofilesctl list | grep -q "balanced"; then
|
|
||||||
options="$options\n$balanced"
|
|
||||||
fi
|
|
||||||
if powerprofilesctl list | grep -q "power-saver"; then
|
|
||||||
options="$options\n$powersave"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Show menu
|
|
||||||
chosen="$(echo -e "$options" | rofi "${ROFI_ARGS[@]}")"
|
|
||||||
|
|
||||||
# Run selection
|
|
||||||
case $chosen in
|
|
||||||
"$perf")
|
|
||||||
powerprofilesctl set performance
|
|
||||||
;;
|
|
||||||
"$balanced")
|
|
||||||
powerprofilesctl set balanced
|
|
||||||
;;
|
|
||||||
"$powersave")
|
|
||||||
powerprofilesctl set power-saver
|
|
||||||
;;
|
|
||||||
"$cancel"|"")
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Send notification if available
|
|
||||||
if [[ "$chosen" != "$cancel" && -z "${notify_send_missing}" ]]; then
|
|
||||||
notify-send -i dialog-information "Power Profile Changed" "New profile: ${chosen}"
|
|
||||||
fi
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
#
|
|
||||||
# powermenu - a very simple rofi powermenu
|
|
||||||
#
|
|
||||||
# Copyright (C) 2025 Johannes Kamprad
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
# needs rofi config:
|
|
||||||
# $HOME/.config/rofi/powermenu.rasi
|
|
||||||
# set to be used in i3wm
|
|
||||||
|
|
||||||
ROFI_THEME="${HOME}/.config/rofi/powermenu.rasi"
|
|
||||||
# Define possible lock scripts/commands (edit this list as you like)
|
|
||||||
LOCK_SCRIPTS=("${HOME}/.config/i3/scripts/blur-lock" "i3lock")
|
|
||||||
|
|
||||||
# Find available lock script
|
|
||||||
find_lock_script() {
|
|
||||||
for script in "${LOCK_SCRIPTS[@]}"; do
|
|
||||||
# Handle command names vs full paths
|
|
||||||
if [[ "$script" =~ ^[a-zA-Z0-9_-]+$ ]]; then
|
|
||||||
# It's a command name, check if available
|
|
||||||
if command -v "$script" >/dev/null 2>&1; then
|
|
||||||
echo "$script"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
# It's a path, check if file exists and is executable
|
|
||||||
if [[ -x "$script" ]]; then
|
|
||||||
echo "$script"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Menu entries
|
|
||||||
chancel=" Cancel"
|
|
||||||
lock=" Lock"
|
|
||||||
logout=" Logout"
|
|
||||||
reboot=" Reboot"
|
|
||||||
shutdown=" Shutdown"
|
|
||||||
suspend=" Suspend"
|
|
||||||
hibernate=" Hibernate"
|
|
||||||
|
|
||||||
|
|
||||||
# Add lock only if script is found
|
|
||||||
if lockcmd="$(find_lock_script)"; then
|
|
||||||
options="$chancel\n$lock\n$logout\n$reboot\n$shutdown\n$suspend\n$hibernate"
|
|
||||||
else
|
|
||||||
options="$chancel\n$logout\n$reboot\n$shutdown\n$suspend\n$hibernate"
|
|
||||||
fi
|
|
||||||
|
|
||||||
chosen="$(echo -e "$options" | rofi -dmenu -i -p "Power Menu" \
|
|
||||||
-theme $ROFI_THEME)"
|
|
||||||
|
|
||||||
case $chosen in
|
|
||||||
"$lock")
|
|
||||||
$lockcmd
|
|
||||||
;;
|
|
||||||
"$cancel"|"")
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
"$logout")
|
|
||||||
i3-msg exit
|
|
||||||
;;
|
|
||||||
"$reboot")
|
|
||||||
systemctl reboot
|
|
||||||
;;
|
|
||||||
"$shutdown")
|
|
||||||
systemctl poweroff
|
|
||||||
;;
|
|
||||||
"$suspend")
|
|
||||||
systemctl suspend
|
|
||||||
;;
|
|
||||||
"$hibernate")
|
|
||||||
systemctl hibernate
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
|
|
||||||
# power-profiles-daemon implementation:
|
|
||||||
# needs package power-profiles-daemon installed and the service running see here:
|
|
||||||
# https://wiki.archlinux.org/title/CPU_frequency_scaling#power-profiles-daemon
|
|
||||||
# used in i3-blocks: ~/.config/i3/i3blocks.conf together with: ~/.config/i3/scripts/power-profiles
|
|
||||||
|
|
||||||
|
|
||||||
# assign tags or translations to each profile
|
|
||||||
declare -A tags
|
|
||||||
tags=(
|
|
||||||
[performance]="Performance"
|
|
||||||
[balanced]="Balanced"
|
|
||||||
[power-saver]="Power saver"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Get current profile
|
|
||||||
current_profile=$(/usr/bin/powerprofilesctl get)
|
|
||||||
|
|
||||||
# Get tag from the array
|
|
||||||
profile_tag=${tags[$current_profile]}
|
|
||||||
|
|
||||||
# Show tag on i3block
|
|
||||||
echo "${profile_tag:-$current_profile}"
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
#!/usr/bin/env perl
|
|
||||||
|
|
||||||
# Copyright 2014 Pierre Mavro <deimos at deimos dot fr>
|
|
||||||
# Copyright 2014 Vivien Didelot <vivien at didelot.org>
|
|
||||||
# Copyright 2014 Andreas Guldstrand <andreas.guldstrand at gmail dot com>
|
|
||||||
# Copyright 2014 Benjamin Chretien <chretien at lirmm dot fr>
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
# Edited by Andreas Lindlbauer <endeavouros.mousily@aleeas.com>
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use utf8;
|
|
||||||
use Getopt::Long;
|
|
||||||
|
|
||||||
binmode(STDOUT, ":utf8");
|
|
||||||
|
|
||||||
# default values
|
|
||||||
my $t_warn = $ENV{T_WARN} || 70;
|
|
||||||
my $t_crit = $ENV{T_CRIT} || 90;
|
|
||||||
my $chip = $ENV{SENSOR_CHIP} || "";
|
|
||||||
my $temperature = -9999;
|
|
||||||
my $label = "😀 ";
|
|
||||||
|
|
||||||
sub help {
|
|
||||||
print "Usage: temperature [-w <warning>] [-c <critical>] [--chip <chip>]\n";
|
|
||||||
print "-w <percent>: warning threshold to become yellow\n";
|
|
||||||
print "-c <percent>: critical threshold to become red\n";
|
|
||||||
print "--chip <chip>: sensor chip\n";
|
|
||||||
exit 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
GetOptions("help|h" => \&help,
|
|
||||||
"w=i" => \$t_warn,
|
|
||||||
"c=i" => \$t_crit,
|
|
||||||
"chip=s" => \$chip);
|
|
||||||
|
|
||||||
# Get chip temperature
|
|
||||||
open (SENSORS, "sensors -u $chip |") or die;
|
|
||||||
while (<SENSORS>) {
|
|
||||||
if (/^\s+temp1_input:\s+[\+]*([\-]*\d+\.\d)/) {
|
|
||||||
$temperature = $1;
|
|
||||||
last;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
close(SENSORS);
|
|
||||||
|
|
||||||
$temperature eq -9999 and die 'Cannot find temperature';
|
|
||||||
|
|
||||||
if ($temperature < 45) {
|
|
||||||
$label = '';
|
|
||||||
} elsif ($temperature < 55) {
|
|
||||||
$label = '';
|
|
||||||
} elsif ($temperature < 65) {
|
|
||||||
$label = '';
|
|
||||||
} elsif ($temperature < 75) {
|
|
||||||
$label = '';
|
|
||||||
} else {
|
|
||||||
$label = '';
|
|
||||||
}
|
|
||||||
# Print short_text, full_text
|
|
||||||
print "${label}";
|
|
||||||
print " $temperature°C\n";
|
|
||||||
print "${label}";
|
|
||||||
print " $temperature°C\n";
|
|
||||||
|
|
||||||
# Print color, if needed
|
|
||||||
if ($temperature >= $t_crit) {
|
|
||||||
print "#FF0000\n";
|
|
||||||
exit 33;
|
|
||||||
} elsif ($temperature >= $t_warn) {
|
|
||||||
print "#FFFC00\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# i3blocks volume block for PipeWire (PulseAudio compatible)
|
|
||||||
|
|
||||||
STEP=${1:-5%}
|
|
||||||
|
|
||||||
# Default sink
|
|
||||||
SINK=$(pactl info | awk '/Default Sink/ {print $3}')
|
|
||||||
[[ -z "$SINK" ]] && { echo "No audio"; exit 0; }
|
|
||||||
|
|
||||||
# Handle scroll/middle-click
|
|
||||||
case "$BLOCK_BUTTON" in
|
|
||||||
3) pactl set-sink-mute "$SINK" toggle ;; # right click = mute/unmute
|
|
||||||
4) pactl set-sink-volume "$SINK" +$STEP ;; # scroll up
|
|
||||||
5) pactl set-sink-volume "$SINK" -$STEP ;; # scroll down
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Get current volume (front-left channel)
|
|
||||||
VOL=$(pactl list sinks | awk -v s="$SINK" '
|
|
||||||
$0 ~ "Name: " s {found=1}
|
|
||||||
found && /Volume:/ {gsub("%","",$5); print $5; exit}
|
|
||||||
')
|
|
||||||
|
|
||||||
# Get mute state
|
|
||||||
MUTED=$(pactl list sinks | awk -v s="$SINK" '
|
|
||||||
$0 ~ "Name: " s {found=1}
|
|
||||||
found && /Mute:/ {print $2; exit}
|
|
||||||
')
|
|
||||||
|
|
||||||
# Choose symbol
|
|
||||||
AUDIO_HIGH=''
|
|
||||||
AUDIO_MED=''
|
|
||||||
AUDIO_LOW=''
|
|
||||||
AUDIO_MUTED=''
|
|
||||||
MED_THRESH=50
|
|
||||||
LOW_THRESH=0
|
|
||||||
|
|
||||||
if [[ "$MUTED" == "no" ]]; then
|
|
||||||
SYMB=$AUDIO_HIGH
|
|
||||||
[[ $VOL -le $MED_THRESH ]] && SYMB=$AUDIO_MED
|
|
||||||
[[ $VOL -le $LOW_THRESH ]] && SYMB=$AUDIO_LOW
|
|
||||||
else
|
|
||||||
SYMB=$AUDIO_MUTED
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Single-line output for i3blocks
|
|
||||||
echo "${SYMB} ${VOL}%"
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
|
|
||||||
# Parses output from nmcli to show the current connected VPN name/status for i3block
|
|
||||||
# Source: https://github.com/vivien/i3blocks-contrib/tree/master/nm-vpn
|
|
||||||
# uncomment in $HOME/.config/i3/i3blocks.conf if you want to use it
|
|
||||||
|
|
||||||
init_color=${init_color:-#FFFF00}
|
|
||||||
on_color=${on_color:-#00FF00}
|
|
||||||
export init_color on_color
|
|
||||||
nmcli -t connection show --active | awk -F ':' '
|
|
||||||
BEGIN {
|
|
||||||
init_color=ENVIRON["init_color"]
|
|
||||||
on_color=ENVIRON["on_color"]
|
|
||||||
}
|
|
||||||
$3=="vpn" {
|
|
||||||
name=$1
|
|
||||||
status="INIT"
|
|
||||||
color=init_color
|
|
||||||
}
|
|
||||||
$3=="tun" || ($4~/^tap/ || $3~/^tap/) {
|
|
||||||
if(!name) name=$1
|
|
||||||
status="ON"
|
|
||||||
color=on_color
|
|
||||||
}
|
|
||||||
END {if(status) printf("%s\n%s\n%s\n", name, status, color)}'
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
#!/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('window') and 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
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<driconf>
|
|
||||||
<device>
|
|
||||||
<application name="Login greeters" executable_regexp=".*greeter.*">
|
|
||||||
<option name="adaptive_sync" value="false" />
|
|
||||||
</application>
|
|
||||||
</device>
|
|
||||||
</driconf>
|
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
-- Minimal server editor config
|
|
||||||
-- Launch with: NVIM_APPNAME=nvim-server nvim
|
|
||||||
|
|
||||||
-------------------- Options --------------------
|
|
||||||
vim.g.mapleader = ","
|
|
||||||
vim.opt.number = true
|
|
||||||
vim.opt.cursorline = true
|
|
||||||
vim.opt.expandtab = true
|
|
||||||
vim.opt.tabstop = 4
|
|
||||||
vim.opt.shiftwidth = 4
|
|
||||||
vim.opt.softtabstop = 4
|
|
||||||
vim.opt.autoindent = true
|
|
||||||
vim.opt.smartindent = true
|
|
||||||
vim.opt.hlsearch = true
|
|
||||||
vim.opt.incsearch = true
|
|
||||||
vim.opt.ignorecase = true
|
|
||||||
vim.opt.smartcase = true
|
|
||||||
vim.opt.splitright = true
|
|
||||||
vim.opt.splitbelow = true
|
|
||||||
vim.opt.termguicolors = true
|
|
||||||
vim.opt.scrolloff = 8
|
|
||||||
vim.opt.signcolumn = "no"
|
|
||||||
vim.opt.updatetime = 250
|
|
||||||
vim.opt.undofile = true
|
|
||||||
|
|
||||||
-------------------- Clipboard --------------------
|
|
||||||
--vim.opt.clipboard = 'unnamedplus'
|
|
||||||
|
|
||||||
vim.g.clipboard = {
|
|
||||||
name = 'OSC 52',
|
|
||||||
copy = {
|
|
||||||
['+'] = require('vim.ui.clipboard.osc52').copy('+'),
|
|
||||||
['*'] = require('vim.ui.clipboard.osc52').copy('*'),
|
|
||||||
},
|
|
||||||
paste = {
|
|
||||||
['+'] = require('vim.ui.clipboard.osc52').paste('+'),
|
|
||||||
['*'] = require('vim.ui.clipboard.osc52').paste('*'),
|
|
||||||
},
|
|
||||||
}
|
|
||||||
vim.keymap.set("v", "<leader>y", '"+y')
|
|
||||||
vim.keymap.set("n", "<leader>Y", '"+yg_')
|
|
||||||
vim.keymap.set("n", "<leader>y", '"+y')
|
|
||||||
vim.keymap.set("n", "<leader>yy", '"+yy')
|
|
||||||
-- "+p/"+P dropped: OSC52 paste blocks 1-10s waiting for a terminal response
|
|
||||||
-- most SSH clients never send. Plain p/P already pastes the last yank via
|
|
||||||
-- the unnamed register, instantly.
|
|
||||||
|
|
||||||
-------------------- Keymaps --------------------
|
|
||||||
vim.keymap.set("n", "i", ":nohls<CR>i", { silent = true })
|
|
||||||
vim.keymap.set("n", "<Space>", ":w<CR>", { silent = true })
|
|
||||||
|
|
||||||
-- Window navigation
|
|
||||||
vim.keymap.set("n", "<C-h>", "<C-W>h")
|
|
||||||
vim.keymap.set("n", "<C-j>", "<C-W>j")
|
|
||||||
vim.keymap.set("n", "<C-k>", "<C-W>k")
|
|
||||||
vim.keymap.set("n", "<C-l>", "<C-W>l")
|
|
||||||
vim.keymap.set("n", "<C-Left>", "<C-W>h")
|
|
||||||
vim.keymap.set("n", "<C-Down>", "<C-W>j")
|
|
||||||
vim.keymap.set("n", "<C-Up>", "<C-W>k")
|
|
||||||
vim.keymap.set("n", "<C-Right>", "<C-W>l")
|
|
||||||
|
|
||||||
-- Tab management
|
|
||||||
vim.keymap.set("n", "<leader>to", ":tabonly<CR>", { silent = true })
|
|
||||||
vim.keymap.set("n", "<leader>o", ":only<CR>", { silent = true })
|
|
||||||
vim.keymap.set("n", "<leader><Tab>", ":tabn<CR>", { silent = true })
|
|
||||||
vim.keymap.set("n", "<S-Tab>", ":tabp<CR>", { silent = true })
|
|
||||||
|
|
||||||
|
|
||||||
-------------------- Netrw (built-in file browser) --------------------
|
|
||||||
vim.g.netrw_banner = 0
|
|
||||||
vim.g.netrw_liststyle = 3
|
|
||||||
vim.keymap.set("n", "<F2>", ":Explore<CR>", { silent = true })
|
|
||||||
|
|
||||||
-------------------- Statusline (built-in) --------------------
|
|
||||||
vim.opt.statusline = " %f %m%r%= %y %l:%c %p%% "
|
|
||||||
|
|
||||||
-------------------- Bootstrap lazy.nvim --------------------
|
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
|
||||||
if vim.fn.isdirectory(lazypath) == 0 then
|
|
||||||
vim.fn.system({
|
|
||||||
"git", "clone", "--filter=blob:none",
|
|
||||||
"https://github.com/folke/lazy.nvim.git",
|
|
||||||
"--branch=stable",
|
|
||||||
lazypath,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
vim.opt.rtp:prepend(lazypath)
|
|
||||||
|
|
||||||
require("lazy").setup({
|
|
||||||
{ "4ree/viml-surround", event = "VeryLazy" },
|
|
||||||
{ "numToStr/Comment.nvim", event = "VeryLazy", opts = {} },
|
|
||||||
{
|
|
||||||
"junegunn/fzf.vim",
|
|
||||||
dependencies = { "junegunn/fzf" },
|
|
||||||
keys = {
|
|
||||||
{ "<leader>f", "<cmd>Files<CR>", desc = "Find files" },
|
|
||||||
{ "<leader>b", "<cmd>Buffers<CR>", desc = "Buffers" },
|
|
||||||
{ "<leader>r", "<cmd>Rg<CR>", desc = "Ripgrep" },
|
|
||||||
{ "<leader>g", "<cmd>GFiles<CR>", desc = "Git files" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-------------------- Grep (use ripgrep if available) --------------------
|
|
||||||
if vim.fn.executable("rg") == 1 then
|
|
||||||
vim.opt.grepprg = "rg --vimgrep --smart-case"
|
|
||||||
vim.opt.grepformat = "%f:%l:%c:%m"
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
+142
@@ -0,0 +1,142 @@
|
|||||||
|
syntax on
|
||||||
|
set number
|
||||||
|
set cursorline
|
||||||
|
set expandtab tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
|
set autoindent
|
||||||
|
set spelllang=vi,en
|
||||||
|
|
||||||
|
|
||||||
|
" Fold
|
||||||
|
set foldmethod=syntax
|
||||||
|
set foldlevel=1
|
||||||
|
set foldnestmax=1
|
||||||
|
set encoding=utf8
|
||||||
|
|
||||||
|
" Search
|
||||||
|
set hlsearch
|
||||||
|
nnoremap i :nohls<CR>i
|
||||||
|
|
||||||
|
" Plugin
|
||||||
|
call plug#begin()
|
||||||
|
Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
||||||
|
Plug 'dense-analysis/ale'
|
||||||
|
Plug 'preservim/nerdtree'
|
||||||
|
Plug 'preservim/nerdcommenter'
|
||||||
|
Plug 'lervag/vimtex'
|
||||||
|
Plug 'JuliaEditorSupport/julia-vim'
|
||||||
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
||||||
|
Plug 'junegunn/fzf.vim'
|
||||||
|
Plug 'honza/vim-snippets'
|
||||||
|
Plug 'vim-airline/vim-airline'
|
||||||
|
Plug 'vim-airline/vim-airline-themes'
|
||||||
|
Plug 'kevinhwang91/nvim-bqf'
|
||||||
|
Plug 'morhetz/gruvbox'
|
||||||
|
Plug 'tpope/vim-fugitive'
|
||||||
|
Plug 'ynkdir/vim-diff'
|
||||||
|
Plug '4ree/vim-ime'
|
||||||
|
call plug#end()
|
||||||
|
|
||||||
|
"Color scheme
|
||||||
|
"colorscheme iceberg
|
||||||
|
"set background=light
|
||||||
|
colorscheme gruvbox
|
||||||
|
let g:gruvbox_contrast_light = 'hard'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
"Open NERDTree
|
||||||
|
:nnoremap <silent> <expr> <F2> g:NERDTree.IsOpen() ? "\:NERDTreeClose<CR>" : bufexists(expand('%')) ? "\:NERDTreeFind<CR>" : "\:NERDTree<CR>"
|
||||||
|
|
||||||
|
"Coc.nvim
|
||||||
|
inoremap <silent><expr> <TAB>
|
||||||
|
\ coc#pum#visible() ? coc#_select_confirm() :
|
||||||
|
\ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
|
||||||
|
\ CheckBackSpace() ? "\<TAB>" :
|
||||||
|
\ coc#refresh()
|
||||||
|
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
|
||||||
|
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
|
||||||
|
|
||||||
|
function! CheckBackSpace() abort
|
||||||
|
let col = col('.') - 1
|
||||||
|
return !col || getline('.')[col - 1] =~# '\s'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
let g:coc_snippet_next = '<tab>'
|
||||||
|
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
|
||||||
|
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
|
||||||
|
|
||||||
|
" Comments
|
||||||
|
let mapleader = ","
|
||||||
|
|
||||||
|
" remap save
|
||||||
|
nnoremap <space> :w<CR>
|
||||||
|
|
||||||
|
" moving between windows
|
||||||
|
nnoremap <C-h> <C-W>h
|
||||||
|
nnoremap <C-j> <C-W>j
|
||||||
|
nnoremap <C-k> <C-W>k
|
||||||
|
nnoremap <C-l> <C-W>l
|
||||||
|
nnoremap <C-Left> <C-W>h
|
||||||
|
nnoremap <C-Down> <C-W>j
|
||||||
|
nnoremap <C-Up> <C-W>k
|
||||||
|
nnoremap <C-Right> <C-W>l
|
||||||
|
nnoremap <leader>to :tabonly<CR>
|
||||||
|
nnoremap <leader>o :only<CR>
|
||||||
|
nnoremap <leader><tab> :tabn<CR>
|
||||||
|
nnoremap <S-tab> :tabp<CR>
|
||||||
|
|
||||||
|
"set clipboard+=unnamedplus
|
||||||
|
" " Copy to clipboard
|
||||||
|
vnoremap <leader>y "+y
|
||||||
|
nnoremap <leader>Y "+yg_
|
||||||
|
nnoremap <leader>y "+y
|
||||||
|
nnoremap <leader>yy "+yy
|
||||||
|
|
||||||
|
" " Paste from clipboard
|
||||||
|
nnoremap <leader>p "+p
|
||||||
|
nnoremap <leader>P "+P
|
||||||
|
|
||||||
|
|
||||||
|
" FZF key mapping
|
||||||
|
nnoremap <silent> <Leader>b :Buffers<CR>
|
||||||
|
nnoremap <silent> <Leader>r :Rg<CR>
|
||||||
|
nnoremap <silent> <Leader>f :Files<CR>
|
||||||
|
nnoremap <silent> <Leader>g :GFiles<CR>
|
||||||
|
nnoremap <silent> <Leader>w :Rg <C-R><C-W><CR>
|
||||||
|
|
||||||
|
filetype plugin on
|
||||||
|
set splitright
|
||||||
|
set splitbelow
|
||||||
|
|
||||||
|
let g:vimtex_view_method= 'zathura'
|
||||||
|
|
||||||
|
"Language tool
|
||||||
|
map <F3> :ALEToggle<CR>
|
||||||
|
|
||||||
|
|
||||||
|
"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
|
||||||
|
"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
|
||||||
|
"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
|
||||||
|
if (empty($TMUX))
|
||||||
|
if (has("nvim"))
|
||||||
|
"For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
|
||||||
|
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
|
||||||
|
endif
|
||||||
|
"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
|
||||||
|
"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
|
||||||
|
" < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
|
||||||
|
if (has("termguicolors"))
|
||||||
|
set termguicolors
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if &term =~ 'xterm' || &term == 'win32'
|
||||||
|
" Use DECSCUSR escape sequences
|
||||||
|
let &t_SI = "\e[5 q" " blink bar
|
||||||
|
let &t_SR = "\e[3 q" " blink underline
|
||||||
|
let &t_EI = "\e[1 q" " blink block
|
||||||
|
let &t_ti ..= "\e[1 q" " blink block
|
||||||
|
let &t_te ..= "\e[0 q" " default (depends on terminal, normally blink
|
||||||
|
" block)
|
||||||
|
endif
|
||||||
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
{"coc.preferences.diagnostic.displayByAle":1
|
||||||
|
}
|
||||||
-240
@@ -1,240 +0,0 @@
|
|||||||
-- Leader key (must be set before lazy.nvim loads)
|
|
||||||
vim.g.mapleader = ","
|
|
||||||
|
|
||||||
-------------------- Options --------------------
|
|
||||||
vim.opt.number = true
|
|
||||||
vim.opt.cursorline = true
|
|
||||||
vim.opt.expandtab = true
|
|
||||||
vim.opt.tabstop = 4
|
|
||||||
vim.opt.shiftwidth = 4
|
|
||||||
vim.opt.softtabstop = 4
|
|
||||||
vim.opt.autoindent = true
|
|
||||||
vim.opt.spelllang = "vi,en"
|
|
||||||
vim.opt.foldmethod = "syntax"
|
|
||||||
vim.opt.foldlevel = 1
|
|
||||||
vim.opt.foldnestmax = 1
|
|
||||||
vim.opt.hlsearch = true
|
|
||||||
vim.opt.splitright = true
|
|
||||||
vim.opt.splitbelow = true
|
|
||||||
vim.opt.termguicolors = true
|
|
||||||
vim.opt.autoread = true
|
|
||||||
|
|
||||||
-------------------- Keymaps --------------------
|
|
||||||
-- Clear hlsearch then enter insert mode
|
|
||||||
vim.keymap.set("n", "i", ":nohls<CR>i", { silent = true })
|
|
||||||
|
|
||||||
-- Save with space
|
|
||||||
vim.keymap.set("n", "<Space>", ":w<CR>", { silent = true })
|
|
||||||
|
|
||||||
-- Window navigation
|
|
||||||
vim.keymap.set("n", "<C-h>", "<C-W>h")
|
|
||||||
vim.keymap.set("n", "<C-j>", "<C-W>j")
|
|
||||||
vim.keymap.set("n", "<C-k>", "<C-W>k")
|
|
||||||
vim.keymap.set("n", "<C-l>", "<C-W>l")
|
|
||||||
vim.keymap.set("n", "<C-Left>", "<C-W>h")
|
|
||||||
vim.keymap.set("n", "<C-Down>", "<C-W>j")
|
|
||||||
vim.keymap.set("n", "<C-Up>", "<C-W>k")
|
|
||||||
vim.keymap.set("n", "<C-Right>", "<C-W>l")
|
|
||||||
|
|
||||||
-- Tab management
|
|
||||||
vim.keymap.set("n", "<leader>to", ":tabonly<CR>", { silent = true })
|
|
||||||
vim.keymap.set("n", "<leader>o", ":only<CR>", { silent = true })
|
|
||||||
vim.keymap.set("n", "<leader><Tab>", ":tabn<CR>", { silent = true })
|
|
||||||
vim.keymap.set("n", "<S-Tab>", ":tabp<CR>", { silent = true })
|
|
||||||
|
|
||||||
-- Clipboard operations
|
|
||||||
vim.keymap.set("v", "<leader>y", '"+y')
|
|
||||||
vim.keymap.set("n", "<leader>Y", '"+yg_')
|
|
||||||
vim.keymap.set("n", "<leader>y", '"+y')
|
|
||||||
vim.keymap.set("n", "<leader>yy", '"+yy')
|
|
||||||
vim.keymap.set("n", "<leader>p", '"+p')
|
|
||||||
vim.keymap.set("n", "<leader>P", '"+P')
|
|
||||||
|
|
||||||
-- Background toogling
|
|
||||||
vim.keymap.set("n", "<leader>bg", function()
|
|
||||||
vim.o.background = vim.o.background == "dark" and "light" or "dark"
|
|
||||||
end, { desc = "Toggle light/dark background" })
|
|
||||||
|
|
||||||
-- Join paragraph
|
|
||||||
vim.keymap.set("n", "<leader>j", "vipJ", { desc = "Join paragraph into one line" })
|
|
||||||
|
|
||||||
-------------------- Bootstrap lazy.nvim --------------------
|
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
|
||||||
if not vim.uv.fs_stat(lazypath) then
|
|
||||||
vim.fn.system({
|
|
||||||
"git", "clone", "--filter=blob:none",
|
|
||||||
"https://github.com/folke/lazy.nvim.git",
|
|
||||||
"--branch=stable",
|
|
||||||
lazypath,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
vim.opt.rtp:prepend(lazypath)
|
|
||||||
|
|
||||||
-------------------- Plugins --------------------
|
|
||||||
require("lazy").setup({
|
|
||||||
|
|
||||||
-- Colorscheme
|
|
||||||
{
|
|
||||||
"ellisonleao/gruvbox.nvim",
|
|
||||||
priority = 1000,
|
|
||||||
config = function()
|
|
||||||
require("gruvbox").setup({
|
|
||||||
contrast = "soft",
|
|
||||||
})
|
|
||||||
vim.cmd.colorscheme("gruvbox")
|
|
||||||
vim.o.background = "light"
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Icons (dependency for nvim-tree and lualine)
|
|
||||||
{ "nvim-tree/nvim-web-devicons", lazy = true },
|
|
||||||
|
|
||||||
-- File tree
|
|
||||||
{
|
|
||||||
"nvim-tree/nvim-tree.lua",
|
|
||||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
|
||||||
keys = {
|
|
||||||
{ "<F2>", "<cmd>NvimTreeToggle<CR>", desc = "Toggle file tree" },
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("nvim-tree").setup()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Comments
|
|
||||||
{
|
|
||||||
"numToStr/Comment.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
config = function()
|
|
||||||
require("Comment").setup()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Fuzzy finder (fzf-lua with ripgrep)
|
|
||||||
{
|
|
||||||
"ibhagwan/fzf-lua",
|
|
||||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
|
||||||
keys = {
|
|
||||||
{ "<leader>b", "<cmd>FzfLua buffers<CR>", desc = "Buffers" },
|
|
||||||
{ "<leader>r", "<cmd>FzfLua live_grep<CR>", desc = "Live grep" },
|
|
||||||
{ "<leader>f", "<cmd>FzfLua files<CR>", desc = "Find files" },
|
|
||||||
{ "<leader>g", "<cmd>FzfLua git_files<CR>", desc = "Git files" },
|
|
||||||
{ "<leader>w", "<cmd>FzfLua grep_cword<CR>", desc = "Grep word under cursor" },
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("fzf-lua").setup({
|
|
||||||
files = {
|
|
||||||
cmd = "rg --files --hidden --glob '!**/.git/*'",
|
|
||||||
},
|
|
||||||
grep = {
|
|
||||||
rg_opts = "--hidden --glob '!**/.git/*' --column --line-number --no-heading --color=always --smart-case",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Statusline
|
|
||||||
{
|
|
||||||
"nvim-lualine/lualine.nvim",
|
|
||||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
|
||||||
config = function()
|
|
||||||
require("lualine").setup({
|
|
||||||
options = { theme = "gruvbox" },
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Autopairs
|
|
||||||
{
|
|
||||||
"windwp/nvim-autopairs",
|
|
||||||
event = "InsertEnter",
|
|
||||||
opts = {},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Surround
|
|
||||||
{ "4ree/viml-surround", event = "VeryLazy" },
|
|
||||||
|
|
||||||
-- LSP
|
|
||||||
{
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
config = function()
|
|
||||||
vim.lsp.config("clangd", {})
|
|
||||||
vim.lsp.config("pyright", {})
|
|
||||||
vim.lsp.config("rust_analyzer", {})
|
|
||||||
vim.lsp.config("julials", {})
|
|
||||||
vim.lsp.enable({ "clangd", "pyright", "rust_analyzer", "julials" })
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
|
||||||
callback = function(args)
|
|
||||||
local opts = { buffer = args.buf }
|
|
||||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
|
||||||
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
|
|
||||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
|
||||||
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
|
|
||||||
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Completion (coq_nvim)
|
|
||||||
{
|
|
||||||
"ms-jpq/coq_nvim",
|
|
||||||
branch = "coq",
|
|
||||||
dependencies = {
|
|
||||||
{ "ms-jpq/coq.artifacts", branch = "artifacts" },
|
|
||||||
{ "ms-jpq/coq.thirdparty", branch = "3p" },
|
|
||||||
},
|
|
||||||
init = function()
|
|
||||||
vim.g.coq_settings = { auto_start = "shut-up" }
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Quickfix enhancements
|
|
||||||
{ "kevinhwang91/nvim-bqf", ft = "qf" },
|
|
||||||
|
|
||||||
-- Git
|
|
||||||
{ "tpope/vim-fugitive" },
|
|
||||||
|
|
||||||
-- IME support
|
|
||||||
{
|
|
||||||
"4ree/vim-ime",
|
|
||||||
event = "VeryLazy",
|
|
||||||
opts = {},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- LaTeX
|
|
||||||
{
|
|
||||||
"lervag/vimtex",
|
|
||||||
config = function()
|
|
||||||
vim.g.vimtex_view_method = "zathura"
|
|
||||||
vim.g.vimtex_compiler_latexmk = {
|
|
||||||
options = {
|
|
||||||
"-verbose",
|
|
||||||
"-file-line-error",
|
|
||||||
"-synctex=1",
|
|
||||||
"-interaction=nonstopmode",
|
|
||||||
"-shell-escape",
|
|
||||||
"-output-directory=./output",
|
|
||||||
"-aux-directory=./",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Julia
|
|
||||||
{ "JuliaEditorSupport/julia-vim" },
|
|
||||||
{
|
|
||||||
dir = "/home/nnduc/git/vim-uk",
|
|
||||||
event = "VeryLazy",
|
|
||||||
build = "cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build -j",
|
|
||||||
opts = {
|
|
||||||
input_method = "vni",
|
|
||||||
toggle_key = "<leader>v",
|
|
||||||
},
|
|
||||||
config = function(_, opts)
|
|
||||||
require("uknvim").setup(opts)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
})
|
|
||||||
+132
@@ -0,0 +1,132 @@
|
|||||||
|
syntax on
|
||||||
|
set number
|
||||||
|
set cursorline
|
||||||
|
set expandtab tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
|
set autoindent
|
||||||
|
set spelllang=vi,en
|
||||||
|
|
||||||
|
|
||||||
|
" Fold
|
||||||
|
set foldmethod=syntax
|
||||||
|
set foldlevel=1
|
||||||
|
set foldnestmax=1
|
||||||
|
set encoding=utf8
|
||||||
|
|
||||||
|
" Search
|
||||||
|
set hlsearch
|
||||||
|
nnoremap i :nohls<CR>i
|
||||||
|
|
||||||
|
" Plugin
|
||||||
|
call plug#begin()
|
||||||
|
Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
||||||
|
Plug 'dense-analysis/ale'
|
||||||
|
Plug 'preservim/nerdtree'
|
||||||
|
Plug 'preservim/nerdcommenter'
|
||||||
|
Plug 'lervag/vimtex'
|
||||||
|
Plug 'JuliaEditorSupport/julia-vim'
|
||||||
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
||||||
|
Plug 'junegunn/fzf.vim'
|
||||||
|
Plug 'honza/vim-snippets'
|
||||||
|
Plug 'vim-airline/vim-airline'
|
||||||
|
Plug 'vim-airline/vim-airline-themes'
|
||||||
|
Plug 'kevinhwang91/nvim-bqf'
|
||||||
|
Plug 'morhetz/gruvbox'
|
||||||
|
Plug 'tpope/vim-fugitive'
|
||||||
|
Plug 'ynkdir/vim-diff'
|
||||||
|
Plug '4ree/vim-ime'
|
||||||
|
call plug#end()
|
||||||
|
|
||||||
|
"Color scheme
|
||||||
|
"colorscheme iceberg
|
||||||
|
"set background=light
|
||||||
|
colorscheme gruvbox
|
||||||
|
let g:gruvbox_contrast_light = 'hard'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
"Open NERDTree
|
||||||
|
map <F2> :NERDTreeToggle<CR>
|
||||||
|
|
||||||
|
|
||||||
|
"Coc.nvim
|
||||||
|
inoremap <silent><expr> <TAB>
|
||||||
|
\ coc#pum#visible() ? coc#_select_confirm() :
|
||||||
|
\ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
|
||||||
|
\ CheckBackSpace() ? "\<TAB>" :
|
||||||
|
\ coc#refresh()
|
||||||
|
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
|
||||||
|
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
|
||||||
|
|
||||||
|
function! CheckBackSpace() abort
|
||||||
|
let col = col('.') - 1
|
||||||
|
return !col || getline('.')[col - 1] =~# '\s'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
let g:coc_snippet_next = '<tab>'
|
||||||
|
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
|
||||||
|
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
|
||||||
|
|
||||||
|
" Comments
|
||||||
|
let mapleader = ","
|
||||||
|
|
||||||
|
" remap save
|
||||||
|
nnoremap <space> :w<CR>
|
||||||
|
|
||||||
|
" moving between windows
|
||||||
|
nnoremap <C-h> <C-W>h
|
||||||
|
nnoremap <C-j> <C-W>j
|
||||||
|
nnoremap <C-k> <C-W>k
|
||||||
|
nnoremap <C-l> <C-W>l
|
||||||
|
nnoremap <C-Left> <C-W>h
|
||||||
|
nnoremap <C-Down> <C-W>j
|
||||||
|
nnoremap <C-Up> <C-W>k
|
||||||
|
nnoremap <C-Right> <C-W>l
|
||||||
|
nnoremap <leader>to :tabonly<CR>
|
||||||
|
nnoremap <leader>o :only<CR>
|
||||||
|
nnoremap <leader><tab> :tabn<CR>
|
||||||
|
nnoremap <S-tab> :tabp<CR>
|
||||||
|
|
||||||
|
"set clipboard+=unnamedplus
|
||||||
|
" " Copy to clipboard
|
||||||
|
vnoremap <leader>y "+y
|
||||||
|
nnoremap <leader>Y "+yg_
|
||||||
|
nnoremap <leader>y "+y
|
||||||
|
nnoremap <leader>yy "+yy
|
||||||
|
|
||||||
|
" " Paste from clipboard
|
||||||
|
nnoremap <leader>p "+p
|
||||||
|
nnoremap <leader>P "+P
|
||||||
|
|
||||||
|
|
||||||
|
" FZF key mapping
|
||||||
|
nnoremap <silent> <Leader>b :Buffers<CR>
|
||||||
|
nnoremap <silent> <Leader>r :Rg<CR>
|
||||||
|
nnoremap <silent> <Leader>f :Files<CR>
|
||||||
|
nnoremap <silent> <Leader>g :GFiles<CR>
|
||||||
|
nnoremap <silent> <Leader>w :Rg <C-R><C-W><CR>
|
||||||
|
|
||||||
|
filetype plugin on
|
||||||
|
set splitright
|
||||||
|
set splitbelow
|
||||||
|
|
||||||
|
let g:vimtex_view_method= 'zathura'
|
||||||
|
|
||||||
|
"Language tool
|
||||||
|
map <F3> :ALEToggle<CR>
|
||||||
|
|
||||||
|
|
||||||
|
"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
|
||||||
|
"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
|
||||||
|
"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
|
||||||
|
if (empty($TMUX))
|
||||||
|
if (has("nvim"))
|
||||||
|
"For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
|
||||||
|
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
|
||||||
|
endif
|
||||||
|
"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
|
||||||
|
"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
|
||||||
|
" < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
|
||||||
|
if (has("termguicolors"))
|
||||||
|
set termguicolors
|
||||||
|
endif
|
||||||
|
endif
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
syntax on
|
||||||
|
set number
|
||||||
|
set cursorline
|
||||||
|
set expandtab tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
|
set autoindent
|
||||||
|
set spelllang=vi,en
|
||||||
|
|
||||||
|
" Fold
|
||||||
|
set foldmethod=syntax
|
||||||
|
set foldlevel=1
|
||||||
|
set foldnestmax=1
|
||||||
|
set encoding=utf8
|
||||||
|
|
||||||
|
" Search
|
||||||
|
set hlsearch
|
||||||
|
nnoremap i :nohls<CR>i
|
||||||
|
|
||||||
|
" Plugin
|
||||||
|
call plug#begin()
|
||||||
|
Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
||||||
|
Plug 'preservim/nerdtree'
|
||||||
|
Plug 'preservim/nerdcommenter'
|
||||||
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
||||||
|
Plug 'junegunn/fzf.vim'
|
||||||
|
Plug 'vim-airline/vim-airline'
|
||||||
|
Plug 'vim-airline/vim-airline-themes'
|
||||||
|
Plug 'kevinhwang91/nvim-bqf'
|
||||||
|
Plug 'morhetz/gruvbox'
|
||||||
|
Plug 'tpope/vim-fugitive'
|
||||||
|
Plug 'ynkdir/vim-diff'
|
||||||
|
call plug#end()
|
||||||
|
|
||||||
|
"Color scheme
|
||||||
|
|
||||||
|
colorscheme gruvbox
|
||||||
|
let g:gruvbox_contrast_light = 'hard'
|
||||||
|
|
||||||
|
set background=dark
|
||||||
|
|
||||||
|
" Comments
|
||||||
|
let mapleader = ","
|
||||||
|
|
||||||
|
"Open NERDTree
|
||||||
|
:nnoremap <silent> <expr> <F2> g:NERDTree.IsOpen() ? "\:NERDTreeClose<CR>" : bufexists(expand('%')) ? "\:NERDTreeFind<CR>" : "\:NERDTree<CR>"
|
||||||
|
|
||||||
|
|
||||||
|
"Coc.nvim
|
||||||
|
inoremap <silent><expr> <TAB>
|
||||||
|
\ coc#pum#visible() ? coc#_select_confirm() :
|
||||||
|
\ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
|
||||||
|
\ CheckBackSpace() ? "\<TAB>" :
|
||||||
|
\ coc#refresh()
|
||||||
|
|
||||||
|
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#_select_confirm() : coc#refresh()
|
||||||
|
|
||||||
|
function! CheckBackSpace() abort
|
||||||
|
let col = col('.') - 1
|
||||||
|
return !col || getline('.')[col - 1] =~# '\s'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
let g:coc_snippet_next = '<tab>'
|
||||||
|
" remap save
|
||||||
|
nnoremap <space> :w<CR>
|
||||||
|
|
||||||
|
" moving between windows
|
||||||
|
nnoremap <C-h> <C-W>h
|
||||||
|
nnoremap <C-j> <C-W>j
|
||||||
|
nnoremap <C-k> <C-W>k
|
||||||
|
nnoremap <C-l> <C-W>l
|
||||||
|
nnoremap <C-Left> <C-W>h
|
||||||
|
nnoremap <C-Down> <C-W>j
|
||||||
|
nnoremap <C-Up> <C-W>k
|
||||||
|
nnoremap <C-Right> <C-W>l
|
||||||
|
nnoremap <leader>to :tabonly<CR>
|
||||||
|
nnoremap <leader>o :only<CR>
|
||||||
|
nnoremap <leader><tab> :tabn<CR>
|
||||||
|
nnoremap <S-tab> :tabp<CR>
|
||||||
|
|
||||||
|
"set clipboard+=unnamedplus
|
||||||
|
" " Copy to clipboard
|
||||||
|
vnoremap <leader>y "+y
|
||||||
|
nnoremap <leader>Y "+yg_
|
||||||
|
nnoremap <leader>y "+y
|
||||||
|
nnoremap <leader>yy "+yy
|
||||||
|
|
||||||
|
" " Paste from clipboard
|
||||||
|
nnoremap <leader>p "+p
|
||||||
|
nnoremap <leader>P "+P
|
||||||
|
|
||||||
|
|
||||||
|
" FZF key mapping
|
||||||
|
nnoremap <silent> <Leader>b :Buffers<CR>
|
||||||
|
nnoremap <silent> <Leader>r :Rg<CR>
|
||||||
|
nnoremap <silent> <Leader>f :Files<CR>
|
||||||
|
nnoremap <silent> <Leader>g :GFiles<CR>
|
||||||
|
nnoremap <silent> <Leader>w :Rg <C-R><C-W><CR>
|
||||||
|
|
||||||
|
filetype plugin on
|
||||||
|
set splitright
|
||||||
|
set splitbelow
|
||||||
|
|
||||||
|
"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
|
||||||
|
"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
|
||||||
|
"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
|
||||||
|
if (empty($TMUX))
|
||||||
|
if (has("nvim"))
|
||||||
|
"For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
|
||||||
|
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
|
||||||
|
endif
|
||||||
|
"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
|
||||||
|
"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
|
||||||
|
" < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
|
||||||
|
if (has("termguicolors"))
|
||||||
|
set termguicolors
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if &term =~ 'xterm' || &term == 'win32'
|
||||||
|
" Use DECSCUSR escape sequences
|
||||||
|
let &t_SI = "\e[5 q" " blink bar
|
||||||
|
let &t_SR = "\e[3 q" " blink underline
|
||||||
|
let &t_EI = "\e[1 q" " blink block
|
||||||
|
let &t_ti ..= "\e[1 q" " blink block
|
||||||
|
let &t_te ..= "\e[0 q" " default (depends on terminal, normally blink
|
||||||
|
" block)
|
||||||
|
endif
|
||||||
|
|
||||||
@@ -0,0 +1,227 @@
|
|||||||
|
" VimTeX - LaTeX plugin for Vim
|
||||||
|
"
|
||||||
|
" Maintainer: Karl Yngve Lervåg
|
||||||
|
" Email: karl.yngve@gmail.com
|
||||||
|
"
|
||||||
|
|
||||||
|
function! vimtex#compiler#latexmk#init(options) abort " {{{1
|
||||||
|
return s:compiler.new(a:options)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" }}}1
|
||||||
|
|
||||||
|
function! vimtex#compiler#latexmk#get_rc_opt(root, opt, type, default) abort " {{{1
|
||||||
|
"
|
||||||
|
" Parse option from .latexmkrc.
|
||||||
|
"
|
||||||
|
" Arguments:
|
||||||
|
" root Root of LaTeX project
|
||||||
|
" opt Name of options
|
||||||
|
" type 0 if string, 1 if integer, 2 if list
|
||||||
|
" default Value to return if option not found in latexmkrc file
|
||||||
|
"
|
||||||
|
" Output:
|
||||||
|
" [value, location]
|
||||||
|
"
|
||||||
|
" value Option value (integer or string)
|
||||||
|
" location An integer that indicates where option was found
|
||||||
|
" -1: not found (default value returned)
|
||||||
|
" 0: global latexmkrc file
|
||||||
|
" 1: local latexmkrc file
|
||||||
|
"
|
||||||
|
|
||||||
|
if a:type == 0
|
||||||
|
let l:pattern = '^\s*\$' . a:opt . '\s*=\s*[''"]\(.\+\)[''"]'
|
||||||
|
elseif a:type == 1
|
||||||
|
let l:pattern = '^\s*\$' . a:opt . '\s*=\s*\(\d\+\)'
|
||||||
|
elseif a:type == 2
|
||||||
|
let l:pattern = '^\s*@' . a:opt . '\s*=\s*(\(.*\))'
|
||||||
|
else
|
||||||
|
throw 'VimTeX: Argument error'
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Candidate files
|
||||||
|
" - each element is a pair [path_to_file, is_local_rc_file].
|
||||||
|
let l:files = [
|
||||||
|
\ [a:root . '/latexmkrc', 1],
|
||||||
|
\ [a:root . '/.latexmkrc', 1],
|
||||||
|
\ [fnamemodify('~/.latexmkrc', ':p'), 0],
|
||||||
|
\ [fnamemodify(
|
||||||
|
\ !empty($XDG_CONFIG_HOME) ? $XDG_CONFIG_HOME : '~/.config', ':p')
|
||||||
|
\ . '/latexmk/latexmkrc', 0]
|
||||||
|
\]
|
||||||
|
|
||||||
|
let l:result = [a:default, -1]
|
||||||
|
|
||||||
|
for [l:file, l:is_local] in l:files
|
||||||
|
if filereadable(l:file)
|
||||||
|
let l:match = matchlist(readfile(l:file), l:pattern)
|
||||||
|
if len(l:match) > 1
|
||||||
|
let l:result = [l:match[1], l:is_local]
|
||||||
|
break
|
||||||
|
end
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
" Parse the list
|
||||||
|
if a:type == 2 && l:result[1] > -1
|
||||||
|
let l:array = split(l:result[0], ',')
|
||||||
|
let l:result[0] = []
|
||||||
|
for l:x in l:array
|
||||||
|
let l:x = substitute(l:x, "^'", '', '')
|
||||||
|
let l:x = substitute(l:x, "'$", '', '')
|
||||||
|
let l:result[0] += [l:x]
|
||||||
|
endfor
|
||||||
|
endif
|
||||||
|
|
||||||
|
return l:result
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" }}}1
|
||||||
|
|
||||||
|
|
||||||
|
let s:compiler = vimtex#compiler#_template#new({
|
||||||
|
\ 'name' : 'latexmk',
|
||||||
|
\ 'callback' : 1,
|
||||||
|
\ 'continuous': 1,
|
||||||
|
\ 'executable' : 'latexmk',
|
||||||
|
\ 'options' : [
|
||||||
|
\ '-verbose',
|
||||||
|
\ '-file-line-error',
|
||||||
|
\ '-synctex=1',
|
||||||
|
\ '-interaction=nonstopmode',
|
||||||
|
\ '-shell-escape',
|
||||||
|
\ '-output-directory=./output',
|
||||||
|
\ '-aux-directory=./',
|
||||||
|
\ ],
|
||||||
|
\})
|
||||||
|
|
||||||
|
function! s:compiler.__check_requirements() abort dict " {{{1
|
||||||
|
if !executable(self.executable)
|
||||||
|
call vimtex#log#warning(self.executable . ' is not executable')
|
||||||
|
throw 'VimTeX: Requirements not met'
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" }}}1
|
||||||
|
function! s:compiler.__init() abort dict " {{{1
|
||||||
|
" Check if .latexmkrc sets the build_dir - if so this should be respected
|
||||||
|
let l:out_dir =
|
||||||
|
\ vimtex#compiler#latexmk#get_rc_opt(self.state.root, 'out_dir', 0, '')[0]
|
||||||
|
if !empty(l:out_dir)
|
||||||
|
if !empty(self.build_dir) && (self.build_dir !=# l:out_dir)
|
||||||
|
call vimtex#log#warning(
|
||||||
|
\ 'Setting out_dir from latexmkrc overrides build_dir!',
|
||||||
|
\ 'Changed build_dir from: ' . self.build_dir,
|
||||||
|
\ 'Changed build_dir to: ' . l:out_dir)
|
||||||
|
endif
|
||||||
|
let self.build_dir = l:out_dir
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" }}}1
|
||||||
|
function! s:compiler.__build_cmd() abort dict " {{{1
|
||||||
|
let l:cmd = (has('win32')
|
||||||
|
\ ? 'set max_print_line=2000 & '
|
||||||
|
\ : 'max_print_line=2000 ') . self.executable
|
||||||
|
|
||||||
|
let l:cmd .= ' ' . join(self.options)
|
||||||
|
let l:cmd .= ' ' . self.get_engine()
|
||||||
|
|
||||||
|
if !empty(self.build_dir)
|
||||||
|
let l:cmd .= ' -outdir=' . fnameescape(self.build_dir)
|
||||||
|
endif
|
||||||
|
|
||||||
|
if self.continuous
|
||||||
|
let l:cmd .= ' -pvc -view=none'
|
||||||
|
|
||||||
|
if self.callback
|
||||||
|
for [l:opt, l:val] in [
|
||||||
|
\ ['compiling_cmd', 'vimtex_compiler_callback_compiling'],
|
||||||
|
\ ['success_cmd', 'vimtex_compiler_callback_success'],
|
||||||
|
\ ['failure_cmd', 'vimtex_compiler_callback_failure'],
|
||||||
|
\]
|
||||||
|
let l:cmd .= s:wrap_option_appendcmd(l:opt, 'echo ' . l:val)
|
||||||
|
endfor
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
return l:cmd . ' ' . vimtex#util#shellescape(self.state.base)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" }}}1
|
||||||
|
function! s:compiler.__pprint_append() abort dict " {{{1
|
||||||
|
return [
|
||||||
|
\ ['callback', self.callback],
|
||||||
|
\ ['continuous', self.continuous],
|
||||||
|
\ ['executable', self.executable],
|
||||||
|
\]
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" }}}1
|
||||||
|
|
||||||
|
function! s:compiler.clean(full) abort dict " {{{1
|
||||||
|
let l:cmd = self.executable . ' ' . (a:full ? '-C ' : '-c ')
|
||||||
|
if !empty(self.build_dir)
|
||||||
|
let l:cmd .= printf(' -outdir=%s ', fnameescape(self.build_dir))
|
||||||
|
endif
|
||||||
|
let l:cmd .= vimtex#util#shellescape(self.state.base)
|
||||||
|
|
||||||
|
call vimtex#jobs#run(l:cmd, {'cwd': self.state.root})
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" }}}1
|
||||||
|
function! s:compiler.get_engine() abort dict " {{{1
|
||||||
|
" Parse tex_program from TeX directive
|
||||||
|
let l:tex_program_directive = self.state.get_tex_program()
|
||||||
|
let l:tex_program = l:tex_program_directive
|
||||||
|
|
||||||
|
|
||||||
|
" Parse tex_program from from pdf_mode option in .latexmkrc
|
||||||
|
let [l:pdf_mode, l:is_local] =
|
||||||
|
\ vimtex#compiler#latexmk#get_rc_opt(self.state.root, 'pdf_mode', 1, -1)
|
||||||
|
|
||||||
|
if l:pdf_mode >= 1 && l:pdf_mode <= 5
|
||||||
|
let l:tex_program_pdfmode = [
|
||||||
|
\ 'pdflatex',
|
||||||
|
\ 'pdfps',
|
||||||
|
\ 'pdfdvi',
|
||||||
|
\ 'lualatex',
|
||||||
|
\ 'xelatex',
|
||||||
|
\][l:pdf_mode-1]
|
||||||
|
|
||||||
|
" Use pdf_mode if there is no TeX directive
|
||||||
|
if l:tex_program_directive ==# '_'
|
||||||
|
let l:tex_program = l:tex_program_pdfmode
|
||||||
|
elseif l:is_local && l:tex_program_directive !=# l:tex_program_pdfmode
|
||||||
|
" Give warning when there may be a confusing conflict
|
||||||
|
call vimtex#log#warning(
|
||||||
|
\ 'Value of pdf_mode from latexmkrc is inconsistent with ' .
|
||||||
|
\ 'TeX program directive!',
|
||||||
|
\ 'TeX program: ' . l:tex_program_directive,
|
||||||
|
\ 'pdf_mode: ' . l:tex_program_pdfmode,
|
||||||
|
\ 'The value of pdf_mode will be ignored.')
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
return get(g:vimtex_compiler_latexmk_engines,
|
||||||
|
\ l:tex_program,
|
||||||
|
\ g:vimtex_compiler_latexmk_engines._)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" }}}1
|
||||||
|
|
||||||
|
|
||||||
|
function! s:wrap_option_appendcmd(name, value) abort " {{{1
|
||||||
|
" Note: On Linux, we use double quoted perl strings; these interpolate
|
||||||
|
" variables. One should therefore NOT pass values that contain `$`.
|
||||||
|
let l:win_cmd_sep = has('nvim') ? '^&' : '&'
|
||||||
|
let l:common = printf('$%s = ($%s ? $%s', a:name, a:name, a:name)
|
||||||
|
return has('win32')
|
||||||
|
\ ? printf(' -e "%s . '' %s '' : '''') . ''%s''"',
|
||||||
|
\ l:common, l:win_cmd_sep, a:value)
|
||||||
|
\ : printf(' -e ''%s . " ; " : "") . "%s"''',
|
||||||
|
\ l:common, a:value)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
"}}}1
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
|
||||||
"coq.artifacts": { "branch": "artifacts", "commit": "d545035d06408f2d68cd03bc401425e42c298fc4" },
|
|
||||||
"coq.thirdparty": { "branch": "3p", "commit": "a021e24f1ff538d339aece0de80d621b68862701" },
|
|
||||||
"coq_nvim": { "branch": "coq", "commit": "0cdbf99893729c5ffa74064382efc53364d7045d" },
|
|
||||||
"fzf-lua": { "branch": "main", "commit": "78b85d2a522b1e6a2d154216b3e532a1df1ad6d7" },
|
|
||||||
"gruvbox.nvim": { "branch": "main", "commit": "154eb5ff5b96d0641307113fa385eaf0d36d9796" },
|
|
||||||
"julia-vim": { "branch": "master", "commit": "52b30547346b21bc93acda28d626795667f9e087" },
|
|
||||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
|
||||||
"lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" },
|
|
||||||
"nvim-autopairs": { "branch": "master", "commit": "430522f95fe4fb7c511ec64f8c1a90cc6a66c05c" },
|
|
||||||
"nvim-bqf": { "branch": "main", "commit": "c282a62bec6c0621a1ef5132aa3f4c9fc4dcc2c7" },
|
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "a9bb4d5f4276aa5cddc015faa3ecc5a7b5a26b14" },
|
|
||||||
"nvim-tree.lua": { "branch": "master", "commit": "478c69c0fe253caea88de9c5e138bfa77395a59a" },
|
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "58447c1fca354bbf184425e4a8d01deecbd6f3c4" },
|
|
||||||
"vim-fugitive": { "branch": "master", "commit": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0" },
|
|
||||||
"vim-ime": { "branch": "master", "commit": "79e3b02eb50a57305113550be7ca163b267b5e30" },
|
|
||||||
"viml-surround": { "branch": "master", "commit": "98358bad347aa2b8a180c2edde84c3bd8a51fdd1" },
|
|
||||||
"vimtex": { "branch": "master", "commit": "16a5609d17a436db7f48046d91747fd6a9d75c74" }
|
|
||||||
}
|
|
||||||
Binary file not shown.
Executable → Regular
Executable → Regular
Executable → Regular
@@ -0,0 +1,476 @@
|
|||||||
|
# Simple daemon config file for PipeWire version "1.2.3" #
|
||||||
|
#
|
||||||
|
# Copy and edit this file in /etc/pipewire for system-wide changes
|
||||||
|
# or in ~/.config/pipewire for local changes.
|
||||||
|
#
|
||||||
|
# It is also possible to place a file with an updated section in
|
||||||
|
# /etc/pipewire/minimal.conf.d/ for system-wide changes or in
|
||||||
|
# ~/.config/pipewire/minimal.conf.d/ for local changes.
|
||||||
|
#
|
||||||
|
|
||||||
|
context.properties = {
|
||||||
|
## Configure properties in the system.
|
||||||
|
#library.name.system = support/libspa-support
|
||||||
|
#context.data-loop.library.name.system = support/libspa-support
|
||||||
|
#support.dbus = true
|
||||||
|
#link.max-buffers = 64
|
||||||
|
link.max-buffers = 16 # version < 3 clients can't handle more
|
||||||
|
#mem.warn-mlock = false
|
||||||
|
#mem.allow-mlock = true
|
||||||
|
#mem.mlock-all = false
|
||||||
|
#clock.power-of-two-quantum = true
|
||||||
|
#log.level = 2
|
||||||
|
#cpu.zero.denormals = false
|
||||||
|
|
||||||
|
core.daemon = true # listening for socket connections
|
||||||
|
core.name = pipewire-0 # core name and socket name
|
||||||
|
|
||||||
|
## Properties for the DSP configuration.
|
||||||
|
#default.clock.rate = 48000
|
||||||
|
#default.clock.allowed-rates = [ 48000 ]
|
||||||
|
#default.clock.quantum = 1024
|
||||||
|
#default.clock.min-quantum = 32
|
||||||
|
#default.clock.max-quantum = 2048
|
||||||
|
#default.clock.quantum-limit = 8192
|
||||||
|
#default.clock.quantum-floor = 4
|
||||||
|
#default.video.width = 640
|
||||||
|
#default.video.height = 480
|
||||||
|
#default.video.rate.num = 25
|
||||||
|
#default.video.rate.denom = 1
|
||||||
|
#
|
||||||
|
settings.check-quantum = true
|
||||||
|
settings.check-rate = true
|
||||||
|
|
||||||
|
# This config can use udev or hardcoded ALSA devices. Make sure to
|
||||||
|
# change the alsa device below when disabling udev
|
||||||
|
minimal.use-udev = true
|
||||||
|
|
||||||
|
# Load the pulseaudio emulation daemon
|
||||||
|
minimal.use-pulse = true
|
||||||
|
}
|
||||||
|
|
||||||
|
context.properties.rules = [
|
||||||
|
{ matches = [ { cpu.vm.name = !null } ]
|
||||||
|
actions = {
|
||||||
|
update-props = {
|
||||||
|
# These overrides are only applied when running in a vm.
|
||||||
|
default.clock.min-quantum = 1024
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
context.spa-libs = {
|
||||||
|
#<factory-name regex> = <library-name>
|
||||||
|
#
|
||||||
|
# Used to find spa factory names. It maps an spa factory name
|
||||||
|
# regular expression to a library name that should contain
|
||||||
|
# that factory.
|
||||||
|
#
|
||||||
|
audio.convert.* = audioconvert/libspa-audioconvert
|
||||||
|
audio.adapt = audioconvert/libspa-audioconvert
|
||||||
|
api.alsa.* = alsa/libspa-alsa
|
||||||
|
support.* = support/libspa-support
|
||||||
|
}
|
||||||
|
|
||||||
|
context.modules = [
|
||||||
|
#{ name = <module-name>
|
||||||
|
# ( args = { <key> = <value> ... } )
|
||||||
|
# ( flags = [ ( ifexists ) ( nofail ) ] )
|
||||||
|
# ( condition = [ { <key> = <value> ... } ... ] )
|
||||||
|
#}
|
||||||
|
#
|
||||||
|
# Loads a module with the given parameters.
|
||||||
|
# If ifexists is given, the module is ignored when it is not found.
|
||||||
|
# If nofail is given, module initialization failures are ignored.
|
||||||
|
#
|
||||||
|
|
||||||
|
# Uses realtime scheduling to boost the audio thread priorities. This uses
|
||||||
|
# RTKit if the user doesn't have permission to use regular realtime
|
||||||
|
# scheduling.
|
||||||
|
{ name = libpipewire-module-rt
|
||||||
|
args = {
|
||||||
|
nice.level = -11
|
||||||
|
rt.prio = 88
|
||||||
|
#rt.time.soft = -1
|
||||||
|
#rt.time.hard = -1
|
||||||
|
}
|
||||||
|
flags = [ ifexists nofail ]
|
||||||
|
}
|
||||||
|
|
||||||
|
# The native communication protocol.
|
||||||
|
{ name = libpipewire-module-protocol-native }
|
||||||
|
|
||||||
|
# The profile module. Allows application to access profiler
|
||||||
|
# and performance data. It provides an interface that is used
|
||||||
|
# by pw-top and pw-profiler.
|
||||||
|
{ name = libpipewire-module-profiler }
|
||||||
|
|
||||||
|
# Allows applications to create metadata objects. It creates
|
||||||
|
# a factory for Metadata objects.
|
||||||
|
{ name = libpipewire-module-metadata }
|
||||||
|
|
||||||
|
# Creates a factory for making nodes that run in the
|
||||||
|
# context of the PipeWire server.
|
||||||
|
{ name = libpipewire-module-spa-node-factory }
|
||||||
|
|
||||||
|
{ name = libpipewire-module-spa-device-factory }
|
||||||
|
|
||||||
|
# Allows creating nodes that run in the context of the
|
||||||
|
# client. Is used by all clients that want to provide
|
||||||
|
# data to PipeWire.
|
||||||
|
{ name = libpipewire-module-client-node }
|
||||||
|
|
||||||
|
# The access module can perform access checks and block
|
||||||
|
# new clients.
|
||||||
|
{ name = libpipewire-module-access
|
||||||
|
args = {
|
||||||
|
# access.allowed to list an array of paths of allowed
|
||||||
|
# apps.
|
||||||
|
#access.allowed = [
|
||||||
|
# /usr/bin/pipewire-media-session
|
||||||
|
#]
|
||||||
|
|
||||||
|
# An array of rejected paths.
|
||||||
|
#access.rejected = [ ]
|
||||||
|
|
||||||
|
# An array of paths with restricted access.
|
||||||
|
#access.restricted = [ ]
|
||||||
|
|
||||||
|
# Anything not in the above lists gets assigned the
|
||||||
|
# access.force permission.
|
||||||
|
#access.force = flatpak
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Makes a factory for wrapping nodes in an adapter with a
|
||||||
|
# converter and resampler.
|
||||||
|
{ name = libpipewire-module-adapter }
|
||||||
|
|
||||||
|
# Makes a factory for creating links between ports.
|
||||||
|
{ name = libpipewire-module-link-factory }
|
||||||
|
|
||||||
|
{ name = libpipewire-module-protocol-pulse
|
||||||
|
condition = [ { minimal.use-pulse = true } ]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
pulse.properties = {
|
||||||
|
# the addresses this server listens on
|
||||||
|
server.address = [
|
||||||
|
"unix:native"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
stream.properties = {
|
||||||
|
adapter.auto-port-config = { mode = dsp }
|
||||||
|
}
|
||||||
|
|
||||||
|
context.objects = [
|
||||||
|
#{ factory = <factory-name>
|
||||||
|
# ( args = { <key> = <value> ... } )
|
||||||
|
# ( flags = [ ( nofail ) ] )
|
||||||
|
# ( condition = [ { <key> = <value> ... } ... ] )
|
||||||
|
#}
|
||||||
|
#
|
||||||
|
# Creates an object from a PipeWire factory with the given parameters.
|
||||||
|
# If nofail is given, errors are ignored (and no object is created).
|
||||||
|
#
|
||||||
|
#{ factory = spa-node-factory args = { factory.name = videotestsrc node.name = videotestsrc node.description = videotestsrc "Spa:Pod:Object:Param:Props:patternType" = 1 } }
|
||||||
|
#{ factory = spa-device-factory args = { factory.name = api.jack.device foo=bar } flags = [ nofail ] }
|
||||||
|
#{ factory = spa-device-factory args = { factory.name = api.alsa.enum.udev } }
|
||||||
|
#{ factory = spa-node-factory args = { factory.name = api.alsa.seq.bridge node.name = Internal-MIDI-Bridge } }
|
||||||
|
#{ factory = adapter args = { factory.name = audiotestsrc node.name = my-test node.description = audiotestsrc } }
|
||||||
|
#{ factory = spa-node-factory args = { factory.name = api.vulkan.compute.source node.name = my-compute-source } }
|
||||||
|
|
||||||
|
# Make a default metadata store
|
||||||
|
{ factory = metadata
|
||||||
|
args = {
|
||||||
|
metadata.name = default
|
||||||
|
# metadata.values = [
|
||||||
|
# { key = default.audio.sink value = { name = somesink } }
|
||||||
|
# { key = default.audio.source value = { name = somesource } }
|
||||||
|
# ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# A default dummy driver. This handles nodes marked with the "node.always-process"
|
||||||
|
# property when no other driver is currently active. JACK clients need this.
|
||||||
|
{ factory = spa-node-factory
|
||||||
|
args = {
|
||||||
|
factory.name = support.node.driver
|
||||||
|
node.name = Dummy-Driver
|
||||||
|
node.group = pipewire.dummy
|
||||||
|
priority.driver = 20000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{ factory = spa-node-factory
|
||||||
|
args = {
|
||||||
|
factory.name = support.node.driver
|
||||||
|
node.name = Freewheel-Driver
|
||||||
|
priority.driver = 19000
|
||||||
|
node.group = pipewire.freewheel
|
||||||
|
node.freewheel = true
|
||||||
|
#freewheel.wait = 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# This creates a ALSA udev device that will enumerate all
|
||||||
|
# ALSA devices. Because it is using ACP and has the auto-profile
|
||||||
|
# property set, this will enable a profile and create associated
|
||||||
|
# nodes, which will be automatically configured to their best
|
||||||
|
# configuration with the auto-port-config settings.
|
||||||
|
# Extra node and device params can be given with node.param and
|
||||||
|
# device.param prefixes.
|
||||||
|
{ factory = spa-device-factory
|
||||||
|
args = {
|
||||||
|
factory.name = api.alsa.enum.udev
|
||||||
|
alsa.use-acp = true
|
||||||
|
device.object.properties = {
|
||||||
|
api.acp.auto-profile = true
|
||||||
|
api.acp.auto-port = true
|
||||||
|
device.object.properties = {
|
||||||
|
node.adapter = audio.adapt
|
||||||
|
resample.disable = false
|
||||||
|
adapter.auto-port-config = {
|
||||||
|
mode = dsp
|
||||||
|
monitor = false
|
||||||
|
control = false
|
||||||
|
position = preserve # unknown, aux
|
||||||
|
}
|
||||||
|
#node.param.Props = {
|
||||||
|
# channelVolumes = [ 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.6 ]
|
||||||
|
#}
|
||||||
|
}
|
||||||
|
#device.param.Profile = {
|
||||||
|
# #idx = 0
|
||||||
|
# name = pro-audio
|
||||||
|
#}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
condition = [ { minimal.use-udev = true } ]
|
||||||
|
}
|
||||||
|
|
||||||
|
# This creates a single PCM source device for the given
|
||||||
|
# alsa device path hw:0. You can change source to sink
|
||||||
|
# to make a sink in the same way.
|
||||||
|
{ factory = adapter
|
||||||
|
args = {
|
||||||
|
factory.name = api.alsa.pcm.source
|
||||||
|
node.name = "system"
|
||||||
|
node.description = "system"
|
||||||
|
media.class = "Audio/Source"
|
||||||
|
api.alsa.path = "hw:4"
|
||||||
|
#api.alsa.period-size = 0
|
||||||
|
#api.alsa.period-num = 0
|
||||||
|
#api.alsa.headroom = 0
|
||||||
|
#api.alsa.start-delay = 0
|
||||||
|
#api.alsa.disable-mmap = false
|
||||||
|
#api.alsa.disable-batch = false
|
||||||
|
#api.alsa.use-chmap = false
|
||||||
|
#api.alsa.multirate = true
|
||||||
|
#latency.internal.rate = 0
|
||||||
|
#latency.internal.ns = 0
|
||||||
|
#clock.name = api.alsa.0
|
||||||
|
node.suspend-on-idle = false
|
||||||
|
#audio.format = "S32"
|
||||||
|
#audio.rate = 48000
|
||||||
|
#audio.allowed-rates = [ ]
|
||||||
|
#audio.channels = 4
|
||||||
|
#audio.position = [ FL FR RL RR ]
|
||||||
|
#resample.quality = 4
|
||||||
|
resample.disable = true
|
||||||
|
#monitor.channel-volumes = false
|
||||||
|
#channelmix.normalize = false
|
||||||
|
#channelmix.mix-lfe = true
|
||||||
|
#channelmix.upmix = true
|
||||||
|
#channelmix.upmix-method = psd # none, simple
|
||||||
|
#channelmix.lfe-cutoff = 150
|
||||||
|
#channelmix.fc-cutoff = 12000
|
||||||
|
#channelmix.rear-delay = 12.0
|
||||||
|
#channelmix.stereo-widen = 0.0
|
||||||
|
#channelmix.hilbert-taps = 0
|
||||||
|
#channelmix.disable = false
|
||||||
|
#dither.noise = 0
|
||||||
|
#node.param.Props = {
|
||||||
|
# params = [
|
||||||
|
# audio.channels 6
|
||||||
|
# ]
|
||||||
|
#}
|
||||||
|
adapter.auto-port-config = {
|
||||||
|
mode = dsp
|
||||||
|
monitor = false
|
||||||
|
control = false
|
||||||
|
position = unknown # aux, preserve
|
||||||
|
}
|
||||||
|
#node.param.PortConfig = {
|
||||||
|
# direction = Output
|
||||||
|
# mode = dsp
|
||||||
|
# format = {
|
||||||
|
# mediaType = audio
|
||||||
|
# mediaSubtype = raw
|
||||||
|
# format = F32
|
||||||
|
# rate = 48000
|
||||||
|
# channels = 4
|
||||||
|
# position = [ FL FR RL RR ]
|
||||||
|
# }
|
||||||
|
#}
|
||||||
|
#node.param.Props = {
|
||||||
|
# channelVolumes = [ 0.5 0.4 0.3 0.5 ]
|
||||||
|
#}
|
||||||
|
}
|
||||||
|
condition = [ { minimal.use-udev = false } ]
|
||||||
|
}
|
||||||
|
{ factory = adapter
|
||||||
|
args = {
|
||||||
|
factory.name = api.alsa.pcm.sink
|
||||||
|
node.name = "system"
|
||||||
|
node.description = "system"
|
||||||
|
media.class = "Audio/Sink"
|
||||||
|
api.alsa.path = "hw:4"
|
||||||
|
#api.alsa.period-size = 0
|
||||||
|
#api.alsa.period-num = 0
|
||||||
|
#api.alsa.headroom = 0
|
||||||
|
#api.alsa.start-delay = 0
|
||||||
|
#api.alsa.disable-mmap = false
|
||||||
|
#api.alsa.disable-batch = false
|
||||||
|
#api.alsa.use-chmap = false
|
||||||
|
#api.alsa.multirate = true
|
||||||
|
#latency.internal.rate = 0
|
||||||
|
#latency.internal.ns = 0
|
||||||
|
#clock.name = api.alsa.0
|
||||||
|
node.suspend-on-idle = false
|
||||||
|
#audio.format = "S32"
|
||||||
|
#audio.rate = 48000
|
||||||
|
#audio.allowed-rates = [ ]
|
||||||
|
#audio.channels = 2
|
||||||
|
#audio.position = "FL,FR"
|
||||||
|
#resample.quality = 4
|
||||||
|
resample.disable = true
|
||||||
|
#channelmix.normalize = false
|
||||||
|
#channelmix.mix-lfe = true
|
||||||
|
#channelmix.upmix = true
|
||||||
|
#channelmix.upmix-method = psd # none, simple
|
||||||
|
#channelmix.lfe-cutoff = 150
|
||||||
|
#channelmix.fc-cutoff = 12000
|
||||||
|
#channelmix.rear-delay = 12.0
|
||||||
|
#channelmix.stereo-widen = 0.0
|
||||||
|
#channelmix.hilbert-taps = 0
|
||||||
|
#channelmix.disable = false
|
||||||
|
#dither.noise = 0
|
||||||
|
#node.param.Props = {
|
||||||
|
# params = [
|
||||||
|
# audio.format S16
|
||||||
|
# ]
|
||||||
|
#}
|
||||||
|
adapter.auto-port-config = {
|
||||||
|
mode = dsp
|
||||||
|
monitor = false
|
||||||
|
control = false
|
||||||
|
position = unknown # aux, preserve
|
||||||
|
}
|
||||||
|
#node.param.PortConfig = {
|
||||||
|
# direction = Input
|
||||||
|
# mode = dsp
|
||||||
|
# monitor = true
|
||||||
|
# format = {
|
||||||
|
# mediaType = audio
|
||||||
|
# mediaSubtype = raw
|
||||||
|
# format = F32
|
||||||
|
# rate = 48000
|
||||||
|
# channels = 4
|
||||||
|
# }
|
||||||
|
#}
|
||||||
|
#node.param.Props = {
|
||||||
|
# channelVolumes = [ 0.5 0.4 0.3 0.5 ]
|
||||||
|
#}
|
||||||
|
}
|
||||||
|
condition = [ { minimal.use-udev = false } ]
|
||||||
|
}
|
||||||
|
# This creates a new Source node. It will have input ports
|
||||||
|
# that you can link, to provide audio for this source.
|
||||||
|
#{ factory = adapter
|
||||||
|
# args = {
|
||||||
|
# factory.name = support.null-audio-sink
|
||||||
|
# node.name = "my-mic"
|
||||||
|
# node.description = "Microphone"
|
||||||
|
# media.class = "Audio/Source/Virtual"
|
||||||
|
# audio.position = "FL,FR"
|
||||||
|
# monitor.passthrough = true
|
||||||
|
# adapter.auto-port-config = {
|
||||||
|
# mode = dsp
|
||||||
|
# monitor = true
|
||||||
|
# position = preserve # unknown, aux, preserve
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
#}
|
||||||
|
# This creates a new link between the source and the virtual
|
||||||
|
# source ports.
|
||||||
|
#{ factory = link-factory
|
||||||
|
# args = {
|
||||||
|
# link.output.node = system
|
||||||
|
# link.output.port = capture_1
|
||||||
|
# link.input.node = my-mic
|
||||||
|
# link.input.port = input_FL
|
||||||
|
# }
|
||||||
|
#}
|
||||||
|
#{ factory = link-factory
|
||||||
|
# args = {
|
||||||
|
# link.output.node = system
|
||||||
|
# link.output.port = capture_2
|
||||||
|
# link.input.node = my-mic
|
||||||
|
# link.input.port = input_FR
|
||||||
|
# }
|
||||||
|
#}
|
||||||
|
]
|
||||||
|
|
||||||
|
context.exec = [
|
||||||
|
#{ path = <program-name>
|
||||||
|
# ( args = "<arguments>" | [ <arg1> <arg2> ... ] )
|
||||||
|
# ( condition = [ { <key> = <value> ... } ... ] )
|
||||||
|
#}
|
||||||
|
#
|
||||||
|
# Execute the given program with arguments.
|
||||||
|
#
|
||||||
|
# You can optionally start the pulseaudio-server here as well
|
||||||
|
# but it is better to start it as a systemd service.
|
||||||
|
# It can be interesting to start another daemon here that listens
|
||||||
|
# on another address with the -a option (eg. -a tcp:4713).
|
||||||
|
#
|
||||||
|
##{ path = "/usr/bin/pipewire" args = "-c pipewire-pulse.conf" }
|
||||||
|
]
|
||||||
|
|
||||||
|
node.rules = [
|
||||||
|
{ matches = [
|
||||||
|
{
|
||||||
|
# all keys must match the value. ! negates. ~ starts regex.
|
||||||
|
#alsa.card_name = "ICUSBAUDIO7D"
|
||||||
|
#api.alsa.pcm.stream = "playback"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
actions = {
|
||||||
|
update-props = {
|
||||||
|
#node.name = "alsa_playback.ICUSBAUDIO7D"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
device.rules = [
|
||||||
|
{ matches = [
|
||||||
|
{
|
||||||
|
#alsa.card_name = "ICUSBAUDIO7D"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
actions = {
|
||||||
|
update-props = {
|
||||||
|
#device.name = "alsa_card.ICUSBAUDIO7D"
|
||||||
|
#api.acp.auto-profile = false
|
||||||
|
#api.acp.auto-port = false
|
||||||
|
#device.param.Profile = {
|
||||||
|
# #idx = 0
|
||||||
|
# name = off
|
||||||
|
#}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -0,0 +1,345 @@
|
|||||||
|
# Daemon config file for PipeWire version "1.2.3" #
|
||||||
|
#
|
||||||
|
# Copy and edit this file in /etc/pipewire for system-wide changes
|
||||||
|
# or in ~/.config/pipewire for local changes.
|
||||||
|
#
|
||||||
|
# It is also possible to place a file with an updated section in
|
||||||
|
# /etc/pipewire/pipewire.conf.d/ for system-wide changes or in
|
||||||
|
# ~/.config/pipewire/pipewire.conf.d/ for local changes.
|
||||||
|
#
|
||||||
|
|
||||||
|
context.properties = {
|
||||||
|
## Configure properties in the system.
|
||||||
|
#library.name.system = support/libspa-support
|
||||||
|
#context.data-loop.library.name.system = support/libspa-support
|
||||||
|
#support.dbus = true
|
||||||
|
#link.max-buffers = 64
|
||||||
|
link.max-buffers = 16 # version < 3 clients can't handle more
|
||||||
|
mem.warn-mlock = true # Gentoo should have good RLIMITs now
|
||||||
|
#mem.allow-mlock = true
|
||||||
|
#mem.mlock-all = false
|
||||||
|
#clock.power-of-two-quantum = true
|
||||||
|
#log.level = 2
|
||||||
|
#cpu.zero.denormals = false
|
||||||
|
|
||||||
|
#loop.rt-prio = -1 # -1 = use module-rt prio, 0 disable rt
|
||||||
|
#loop.class = data.rt
|
||||||
|
#thread.affinity = [ 0 1 ] # optional array of CPUs
|
||||||
|
#context.num-data-loops = 1 # -1 = num-cpus, 0 = no data loops
|
||||||
|
#
|
||||||
|
#context.data-loops = [
|
||||||
|
# { loop.rt-prio = -1
|
||||||
|
# loop.class = [ data.rt audio.rt ]
|
||||||
|
# #library.name.system = support/libspa-support
|
||||||
|
# thread.name = data-loop.0
|
||||||
|
# #thread.affinity = [ 0 1 ] # optional array of CPUs
|
||||||
|
# }
|
||||||
|
#]
|
||||||
|
|
||||||
|
core.daemon = true # listening for socket connections
|
||||||
|
core.name = pipewire-0 # core name and socket name
|
||||||
|
|
||||||
|
## Properties for the DSP configuration.
|
||||||
|
default.clock.rate = 44100
|
||||||
|
default.clock.rates = [ 44100 96000 192000 384000]
|
||||||
|
default.clock.allowed-rates = [ 44100 96000 192000 384000]
|
||||||
|
#default.clock.quantum = 1024
|
||||||
|
#default.clock.min-quantum = 32
|
||||||
|
#default.clock.max-quantum = 2048
|
||||||
|
#default.clock.quantum-limit = 8192
|
||||||
|
#default.clock.quantum-floor = 4
|
||||||
|
#default.video.width = 640
|
||||||
|
#default.video.height = 480
|
||||||
|
#default.video.rate.num = 25
|
||||||
|
#default.video.rate.denom = 1
|
||||||
|
#
|
||||||
|
#settings.check-quantum = false
|
||||||
|
#settings.check-rate = false
|
||||||
|
|
||||||
|
# keys checked below to disable module loading
|
||||||
|
module.x11.bell = true
|
||||||
|
# enables autoloading of access module, when disabled an alternative
|
||||||
|
# access module needs to be loaded.
|
||||||
|
module.access = true
|
||||||
|
# enables autoloading of module-jackdbus-detect
|
||||||
|
module.jackdbus-detect = true
|
||||||
|
}
|
||||||
|
|
||||||
|
context.properties.rules = [
|
||||||
|
{ matches = [ { cpu.vm.name = !null } ]
|
||||||
|
actions = {
|
||||||
|
update-props = {
|
||||||
|
# These overrides are only applied when running in a vm.
|
||||||
|
default.clock.min-quantum = 1024
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
context.spa-libs = {
|
||||||
|
#<factory-name regex> = <library-name>
|
||||||
|
#
|
||||||
|
# Used to find spa factory names. It maps an spa factory name
|
||||||
|
# regular expression to a library name that should contain
|
||||||
|
# that factory.
|
||||||
|
#
|
||||||
|
audio.convert.* = audioconvert/libspa-audioconvert
|
||||||
|
avb.* = avb/libspa-avb
|
||||||
|
api.alsa.* = alsa/libspa-alsa
|
||||||
|
api.v4l2.* = v4l2/libspa-v4l2
|
||||||
|
api.libcamera.* = libcamera/libspa-libcamera
|
||||||
|
api.bluez5.* = bluez5/libspa-bluez5
|
||||||
|
api.vulkan.* = vulkan/libspa-vulkan
|
||||||
|
api.jack.* = jack/libspa-jack
|
||||||
|
support.* = support/libspa-support
|
||||||
|
video.convert.* = videoconvert/libspa-videoconvert
|
||||||
|
#videotestsrc = videotestsrc/libspa-videotestsrc
|
||||||
|
#audiotestsrc = audiotestsrc/libspa-audiotestsrc
|
||||||
|
}
|
||||||
|
|
||||||
|
context.modules = [
|
||||||
|
#{ name = <module-name>
|
||||||
|
# ( args = { <key> = <value> ... } )
|
||||||
|
# ( flags = [ ( ifexists ) ( nofail ) ] )
|
||||||
|
# ( condition = [ { <key> = <value> ... } ... ] )
|
||||||
|
#}
|
||||||
|
#
|
||||||
|
# Loads a module with the given parameters.
|
||||||
|
# If ifexists is given, the module is ignored when it is not found.
|
||||||
|
# If nofail is given, module initialization failures are ignored.
|
||||||
|
# If condition is given, the module is loaded only when the context
|
||||||
|
# properties all match the match rules.
|
||||||
|
#
|
||||||
|
|
||||||
|
# Uses realtime scheduling to boost the audio thread priorities. This uses
|
||||||
|
# RTKit if the user doesn't have permission to use regular realtime
|
||||||
|
# scheduling. You can also clamp utilisation values to improve scheduling
|
||||||
|
# on embedded and heterogeneous systems, e.g. Arm big.LITTLE devices.
|
||||||
|
{ name = libpipewire-module-rt
|
||||||
|
args = {
|
||||||
|
nice.level = -11
|
||||||
|
rt.prio = 88
|
||||||
|
#rt.time.soft = -1
|
||||||
|
#rt.time.hard = -1
|
||||||
|
#uclamp.min = 0
|
||||||
|
#uclamp.max = 1024
|
||||||
|
}
|
||||||
|
flags = [ ifexists nofail ]
|
||||||
|
}
|
||||||
|
|
||||||
|
# The native communication protocol.
|
||||||
|
{ name = libpipewire-module-protocol-native
|
||||||
|
args = {
|
||||||
|
# List of server Unix sockets, and optionally permissions
|
||||||
|
#sockets = [ { name = "pipewire-0" }, { name = "pipewire-0-manager" } ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# The profile module. Allows application to access profiler
|
||||||
|
# and performance data. It provides an interface that is used
|
||||||
|
# by pw-top and pw-profiler.
|
||||||
|
{ name = libpipewire-module-profiler }
|
||||||
|
|
||||||
|
# Allows applications to create metadata objects. It creates
|
||||||
|
# a factory for Metadata objects.
|
||||||
|
{ name = libpipewire-module-metadata }
|
||||||
|
|
||||||
|
# Creates a factory for making devices that run in the
|
||||||
|
# context of the PipeWire server.
|
||||||
|
{ name = libpipewire-module-spa-device-factory }
|
||||||
|
|
||||||
|
# Creates a factory for making nodes that run in the
|
||||||
|
# context of the PipeWire server.
|
||||||
|
{ name = libpipewire-module-spa-node-factory }
|
||||||
|
|
||||||
|
# Allows creating nodes that run in the context of the
|
||||||
|
# client. Is used by all clients that want to provide
|
||||||
|
# data to PipeWire.
|
||||||
|
{ name = libpipewire-module-client-node }
|
||||||
|
|
||||||
|
# Allows creating devices that run in the context of the
|
||||||
|
# client. Is used by the session manager.
|
||||||
|
{ name = libpipewire-module-client-device }
|
||||||
|
|
||||||
|
# The portal module monitors the PID of the portal process
|
||||||
|
# and tags connections with the same PID as portal
|
||||||
|
# connections.
|
||||||
|
{ name = libpipewire-module-portal
|
||||||
|
flags = [ ifexists nofail ]
|
||||||
|
}
|
||||||
|
|
||||||
|
# The access module can perform access checks and block
|
||||||
|
# new clients.
|
||||||
|
{ name = libpipewire-module-access
|
||||||
|
args = {
|
||||||
|
# Socket-specific access permissions
|
||||||
|
#access.socket = { pipewire-0 = "default", pipewire-0-manager = "unrestricted" }
|
||||||
|
|
||||||
|
# Deprecated legacy mode (not socket-based),
|
||||||
|
# for now enabled by default if access.socket is not specified
|
||||||
|
#access.legacy = true
|
||||||
|
}
|
||||||
|
condition = [ { module.access = true } ]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Makes a factory for wrapping nodes in an adapter with a
|
||||||
|
# converter and resampler.
|
||||||
|
{ name = libpipewire-module-adapter }
|
||||||
|
|
||||||
|
# Makes a factory for creating links between ports.
|
||||||
|
{ name = libpipewire-module-link-factory }
|
||||||
|
|
||||||
|
# Provides factories to make session manager objects.
|
||||||
|
{ name = libpipewire-module-session-manager }
|
||||||
|
|
||||||
|
# Use libcanberra to play X11 Bell
|
||||||
|
{ name = libpipewire-module-x11-bell
|
||||||
|
args = {
|
||||||
|
#sink.name = "@DEFAULT_SINK@"
|
||||||
|
#sample.name = "bell-window-system"
|
||||||
|
#x11.display = null
|
||||||
|
#x11.xauthority = null
|
||||||
|
}
|
||||||
|
flags = [ ifexists nofail ]
|
||||||
|
condition = [ { module.x11.bell = true } ]
|
||||||
|
}
|
||||||
|
{ name = libpipewire-module-jackdbus-detect
|
||||||
|
args = {
|
||||||
|
#jack.library = libjack.so.0
|
||||||
|
#jack.server = null
|
||||||
|
#jack.client-name = PipeWire
|
||||||
|
#jack.connect = true
|
||||||
|
#tunnel.mode = duplex # source|sink|duplex
|
||||||
|
source.props = {
|
||||||
|
#audio.channels = 2
|
||||||
|
#midi.ports = 1
|
||||||
|
#audio.position = [ FL FR ]
|
||||||
|
# extra sink properties
|
||||||
|
}
|
||||||
|
sink.props = {
|
||||||
|
#audio.channels = 2
|
||||||
|
#midi.ports = 1
|
||||||
|
#audio.position = [ FL FR ]
|
||||||
|
# extra sink properties
|
||||||
|
}
|
||||||
|
}
|
||||||
|
flags = [ ifexists nofail ]
|
||||||
|
condition = [ { module.jackdbus-detect = true } ]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
context.objects = [
|
||||||
|
#{ factory = <factory-name>
|
||||||
|
# ( args = { <key> = <value> ... } )
|
||||||
|
# ( flags = [ ( nofail ) ] )
|
||||||
|
# ( condition = [ { <key> = <value> ... } ... ] )
|
||||||
|
#}
|
||||||
|
#
|
||||||
|
# Creates an object from a PipeWire factory with the given parameters.
|
||||||
|
# If nofail is given, errors are ignored (and no object is created).
|
||||||
|
# If condition is given, the object is created only when the context properties
|
||||||
|
# all match the match rules.
|
||||||
|
#
|
||||||
|
#{ factory = spa-node-factory args = { factory.name = videotestsrc node.name = videotestsrc node.description = videotestsrc "Spa:Pod:Object:Param:Props:patternType" = 1 } }
|
||||||
|
#{ factory = spa-device-factory args = { factory.name = api.jack.device foo=bar } flags = [ nofail ] }
|
||||||
|
#{ factory = spa-device-factory args = { factory.name = api.alsa.enum.udev } }
|
||||||
|
#{ factory = spa-node-factory args = { factory.name = api.alsa.seq.bridge node.name = Internal-MIDI-Bridge } }
|
||||||
|
#{ factory = adapter args = { factory.name = audiotestsrc node.name = my-test node.description = audiotestsrc } }
|
||||||
|
#{ factory = spa-node-factory args = { factory.name = api.vulkan.compute.source node.name = my-compute-source } }
|
||||||
|
|
||||||
|
# A default dummy driver. This handles nodes marked with the "node.always-process"
|
||||||
|
# property when no other driver is currently active. JACK clients need this.
|
||||||
|
{ factory = spa-node-factory
|
||||||
|
args = {
|
||||||
|
factory.name = support.node.driver
|
||||||
|
node.name = Dummy-Driver
|
||||||
|
node.group = pipewire.dummy
|
||||||
|
node.sync-group = sync.dummy
|
||||||
|
priority.driver = 200000
|
||||||
|
#clock.id = monotonic # realtime | tai | monotonic-raw | boottime
|
||||||
|
#clock.name = "clock.system.monotonic"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{ factory = spa-node-factory
|
||||||
|
args = {
|
||||||
|
factory.name = support.node.driver
|
||||||
|
node.name = Freewheel-Driver
|
||||||
|
priority.driver = 190000
|
||||||
|
node.group = pipewire.freewheel
|
||||||
|
node.sync-group = sync.dummy
|
||||||
|
node.freewheel = true
|
||||||
|
#freewheel.wait = 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# This creates a new Source node. It will have input ports
|
||||||
|
# that you can link, to provide audio for this source.
|
||||||
|
#{ factory = adapter
|
||||||
|
# args = {
|
||||||
|
# factory.name = support.null-audio-sink
|
||||||
|
# node.name = "my-mic"
|
||||||
|
# node.description = "Microphone"
|
||||||
|
# media.class = "Audio/Source/Virtual"
|
||||||
|
# audio.position = "FL,FR"
|
||||||
|
# monitor.passthrough = true
|
||||||
|
# }
|
||||||
|
#}
|
||||||
|
|
||||||
|
# This creates a single PCM source device for the given
|
||||||
|
# alsa device path hw:0. You can change source to sink
|
||||||
|
# to make a sink in the same way.
|
||||||
|
#{ factory = adapter
|
||||||
|
# args = {
|
||||||
|
# factory.name = api.alsa.pcm.source
|
||||||
|
# node.name = "alsa-source"
|
||||||
|
# node.description = "PCM Source"
|
||||||
|
# media.class = "Audio/Source"
|
||||||
|
# api.alsa.path = "hw:0"
|
||||||
|
# api.alsa.period-size = 1024
|
||||||
|
# api.alsa.headroom = 0
|
||||||
|
# api.alsa.disable-mmap = false
|
||||||
|
# api.alsa.disable-batch = false
|
||||||
|
# audio.format = "S16LE"
|
||||||
|
# audio.rate = 48000
|
||||||
|
# audio.channels = 2
|
||||||
|
# audio.position = "FL,FR"
|
||||||
|
# }
|
||||||
|
#}
|
||||||
|
|
||||||
|
# Use the metadata factory to create metadata and some default values.
|
||||||
|
#{ factory = metadata
|
||||||
|
# args = {
|
||||||
|
# metadata.name = my-metadata
|
||||||
|
# metadata.values = [
|
||||||
|
# { key = default.audio.sink value = { name = somesink } }
|
||||||
|
# { key = default.audio.source value = { name = somesource } }
|
||||||
|
# ]
|
||||||
|
# }
|
||||||
|
#}
|
||||||
|
]
|
||||||
|
|
||||||
|
context.exec = [
|
||||||
|
#{ path = <program-name>
|
||||||
|
# ( args = "<arguments>" | [ <arg1> <arg2> ... ] )
|
||||||
|
# ( condition = [ { <key> = <value> ... } ... ] )
|
||||||
|
#}
|
||||||
|
#
|
||||||
|
# Execute the given program with arguments.
|
||||||
|
# If condition is given, the program is executed only when the context
|
||||||
|
# properties all match the match rules.
|
||||||
|
#
|
||||||
|
# You can optionally start the session manager here,
|
||||||
|
# but it is better to start it as a systemd service.
|
||||||
|
# Run the session manager with -h for options.
|
||||||
|
#
|
||||||
|
#{ path = "/usr/bin/pipewire-media-session" args = ""
|
||||||
|
# condition = [ { exec.session-manager = null } { exec.session-manager = true } ] }
|
||||||
|
#
|
||||||
|
# You can optionally start the pulseaudio-server here as well
|
||||||
|
# but it is better to start it as a systemd service.
|
||||||
|
# It can be interesting to start another daemon here that listens
|
||||||
|
# on another address with the -a option (eg. -a tcp:4713).
|
||||||
|
#
|
||||||
|
#{ path = "/usr/bin/pipewire" args = [ "-c" "pipewire-pulse.conf" ]
|
||||||
|
# condition = [ { exec.pipewire-pulse = null } { exec.pipewire-pulse = true } ] }
|
||||||
|
]
|
||||||
Executable → Regular
+17
-27
@@ -17,62 +17,57 @@
|
|||||||
;==========================================================
|
;==========================================================
|
||||||
|
|
||||||
[colors]
|
[colors]
|
||||||
background = #BB111111
|
background-alt = #00000000
|
||||||
background-alt = #BB111111
|
foreground = A3D1C6
|
||||||
foreground = #D0D0D0
|
primary = #B3D8A8
|
||||||
primary = #5294E2
|
altprime = #B3D8A8
|
||||||
altprime = #6AAFE6
|
secondary = #FBFFE4
|
||||||
secondary = #1A1A1A
|
altsecondary = #BEABA7EF
|
||||||
altsecondary = #5294E2EF
|
alert = #A54242
|
||||||
alert = #CC3333
|
disabled = FBFFE4
|
||||||
disabled = #707070
|
|
||||||
|
|
||||||
[bar/example]
|
[bar/example]
|
||||||
bottom = false
|
bottom = false
|
||||||
width = 100%
|
width = 100%
|
||||||
height = 20pt
|
height = 20pt
|
||||||
radius = 0
|
radius = 8
|
||||||
|
|
||||||
; dpi = 96
|
; dpi = 96
|
||||||
|
|
||||||
background = ${colors.background}
|
background = #1B4D3E
|
||||||
foreground = ${colors.foreground}
|
foreground = ${colors.foreground}
|
||||||
|
|
||||||
|
tray-position = right
|
||||||
line-size = 2pt
|
line-size = 2pt
|
||||||
|
|
||||||
border-size = 0
|
border-size = 2.5pt
|
||||||
border-color = #00000000
|
border-color = #00000000
|
||||||
|
|
||||||
padding-left = 1
|
padding-left = 1
|
||||||
padding-right = 1
|
padding-right = 1
|
||||||
|
|
||||||
;module-margin = 1
|
module-margin = 1
|
||||||
|
|
||||||
separator = |
|
separator = |
|
||||||
separator-foreground = ${colors.disabled}
|
separator-foreground = ${colors.disabled}
|
||||||
|
|
||||||
font-0 = JetBrainsMono Nerd Font:size=14;3
|
font-0 = 0xProto Nerd Font:pixelsize=14;3
|
||||||
#font-0 = 0xProto Nerd Font:pixelsize=14;3
|
|
||||||
|
|
||||||
modules-left = xworkspaces xwindow
|
modules-left = xworkspaces xwindow
|
||||||
modules-right = polytiramisu date memory cpu battery xkeyboard tray
|
modules-right = polytiramisu memory cpu date battery
|
||||||
|
|
||||||
cursor-click = pointer
|
cursor-click = pointer
|
||||||
cursor-scroll = ns-resize
|
cursor-scroll = ns-resize
|
||||||
|
|
||||||
enable-ipc = true
|
enable-ipc = true
|
||||||
|
|
||||||
|
; tray-position = right
|
||||||
|
|
||||||
; wm-restack = generic
|
; wm-restack = generic
|
||||||
; wm-restack = bspwm
|
; wm-restack = bspwm
|
||||||
; wm-restack = i3
|
; wm-restack = i3
|
||||||
|
|
||||||
; override-redirect = true
|
; override-redirect = true
|
||||||
[module/xkeyboard]
|
|
||||||
type = internal/xkeyboard
|
|
||||||
|
|
||||||
; List of indicators to ignore
|
|
||||||
blacklist-0 = num lock
|
|
||||||
blacklist-1 = scroll lock
|
|
||||||
|
|
||||||
[module/xworkspaces]
|
[module/xworkspaces]
|
||||||
type = internal/xworkspaces
|
type = internal/xworkspaces
|
||||||
@@ -181,11 +176,6 @@ exec = ~/.config/polybar/scripts/polytiramisu.sh
|
|||||||
format = <label>
|
format = <label>
|
||||||
tail = true
|
tail = true
|
||||||
|
|
||||||
[module/tray]
|
|
||||||
type = internal/tray
|
|
||||||
tray-background = ${colors.background}
|
|
||||||
tray-spacing = 4pt
|
|
||||||
|
|
||||||
[settings]
|
[settings]
|
||||||
screenchange-reload = true
|
screenchange-reload = true
|
||||||
pseudo-transparency = true
|
pseudo-transparency = true
|
||||||
|
|||||||
Executable → Regular
|
Before Width: | Height: | Size: 3.1 MiB After Width: | Height: | Size: 3.1 MiB |
Executable → Regular
|
Before Width: | Height: | Size: 3.0 MiB After Width: | Height: | Size: 3.0 MiB |
Executable → Regular
|
Before Width: | Height: | Size: 3.1 MiB After Width: | Height: | Size: 3.1 MiB |
Executable → Regular
+28
-57
@@ -21,49 +21,33 @@ set $term alacritty
|
|||||||
#set $menu wofi --show drun
|
#set $menu wofi --show drun
|
||||||
set $menu rofi -show drun
|
set $menu rofi -show drun
|
||||||
|
|
||||||
# Font for window titles.
|
|
||||||
|
|
||||||
font pango:DejaVu Sans Mono 8
|
|
||||||
### Output configuration
|
### Output configuration
|
||||||
#
|
#
|
||||||
set $wallpaper_dir /media/sync/images/wallpapers
|
# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
|
||||||
set $screenlock '~/.config/sway/scripts/lock-now $wallpaper_dir'
|
set $bg /data/sync/images/wallpapers/0002.jpg
|
||||||
|
set $screenlock 'swaylock -i $bg'
|
||||||
|
set $images $(xdg-user-dir PICTURES)/$(date +'%s_grim.png')
|
||||||
#
|
#
|
||||||
|
|
||||||
exec --no-startup-id ~/.config/sway/scripts/wallpaper-rotate $wallpaper_dir
|
exec --no-startup-id swaybg -m fill -i $bg
|
||||||
# Example configuration:
|
# Example configuration:
|
||||||
#
|
#
|
||||||
#output HDMI-A-1 resolution 1920x1080@120hz position 1920,0
|
#output HDMI-A-1 resolution 1920x1080@120hz position 1920,0
|
||||||
#
|
#
|
||||||
# You can get the names of your outputs by running: swaymsg -t get_outputs
|
# You can get the names of your outputs by running: swaymsg -t get_outputs
|
||||||
# adaptive_sync on the desktop makes sway stutter/flicker; 120Hz avoids AMD
|
|
||||||
# VRAM clock flicker at high refresh (see README).
|
|
||||||
output DP-1 mode 1920x1080@240Hz adaptive_sync off allow_tearing yes
|
|
||||||
#output DP-1 mode 1920x1080@240Hz adaptive_sync on allow_tearing yes
|
|
||||||
|
|
||||||
### Idle configuration
|
### Idle configuration
|
||||||
#
|
#
|
||||||
# Import the compositor socket into the systemd --user environment. Without
|
|
||||||
# this, systemd-managed services (and dbus-activated apps like portals) can't
|
|
||||||
# reach the compositor at all - this is why swayidle silently failed to run
|
|
||||||
# after being restarted via systemd earlier.
|
|
||||||
exec --no-startup-id systemctl --user import-environment WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP DISPLAY
|
|
||||||
exec --no-startup-id hash dbus-update-activation-environment 2>/dev/null && dbus-update-activation-environment --systemd WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP DISPLAY
|
|
||||||
# gamemoded keeps the env it started with (e.g. from an i3 session); restart it
|
|
||||||
# so its swaymsg hooks (~/.config/gamemode.ini) can reach this sway.
|
|
||||||
exec --no-startup-id systemctl --user import-environment SWAYSOCK && systemctl --user try-restart gamemoded
|
|
||||||
#
|
|
||||||
# Example configuration:
|
# Example configuration:
|
||||||
#
|
#
|
||||||
exec swayidle -w \
|
exec swayidle -w \
|
||||||
timeout 300 $screenlock \
|
timeout 900 $screenlock \
|
||||||
timeout 900 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
|
timeout 1800 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
|
||||||
before-sleep $screenlock
|
before-sleep $screenlock
|
||||||
#
|
#
|
||||||
# This will lock your screen after 300 seconds (5 min) of inactivity, then
|
# This will lock your screen after 300 seconds of inactivity, then turn off
|
||||||
# turn off your displays after 900 seconds (15 min), and turn your screens
|
# your displays after another 300 seconds, and turn your screens back on when
|
||||||
# back on when resumed. It will also lock your screen before your computer
|
# resumed. It will also lock your screen before your computer goes to sleep.
|
||||||
# goes to sleep.
|
|
||||||
|
|
||||||
### Input configuration
|
### Input configuration
|
||||||
input "type:touchpad" {
|
input "type:touchpad" {
|
||||||
@@ -86,18 +70,14 @@ exec swayidle -w \
|
|||||||
input "2:7:SynPS/2_Synaptics_TouchPad" {
|
input "2:7:SynPS/2_Synaptics_TouchPad" {
|
||||||
events disabled_on_external_mouse
|
events disabled_on_external_mouse
|
||||||
}
|
}
|
||||||
input "type:pointer" {
|
input "5426:156:Razer_Razer_DeathAdder_V2_X_HyperSpeed" {
|
||||||
accel_profile "flat" # no mouse acceleration for all pointers
|
|
||||||
}
|
|
||||||
input "5426:156:Razer_Razer_DeathAdder_V2_X_HyperSpeed_Mouse" {
|
|
||||||
accel_profile "flat" # disable mouse acceleration (enabled by default; to set it manually, use "adaptive" instead of "flat")
|
accel_profile "flat" # disable mouse acceleration (enabled by default; to set it manually, use "adaptive" instead of "flat")
|
||||||
pointer_accel 0.5 # set mouse sensitivity (between -1 and 1)
|
pointer_accel 0.5 # set mouse sensitivity (between -1 and 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
#exec --no-startup-id /usr/bin/gnome-keyring-daemon --start --components=gpg,pkcs11,secrets,ssh
|
#exec --no-startup-id /usr/bin/gnome-keyring-daemon --start --components=gpg,pkcs11,secrets,ssh
|
||||||
exec --no-startup-id source ~/.config/fcitx.sh
|
|
||||||
exec --no-startup-id fcitx5
|
|
||||||
exec --no-startup-id kwalletd6
|
exec --no-startup-id kwalletd6
|
||||||
|
exec --no-startup-id fcitx5
|
||||||
#exec --no-startup-id blueman-applet
|
#exec --no-startup-id blueman-applet
|
||||||
exec --no-startup-id owncloud
|
exec --no-startup-id owncloud
|
||||||
exec --no-startup-id waybar
|
exec --no-startup-id waybar
|
||||||
@@ -117,7 +97,7 @@ bindsym XF86AudioRaiseVolume exec --no-startup-id $raise-volume
|
|||||||
bindsym XF86AudioLowerVolume exec --no-startup-id $lower-volume
|
bindsym XF86AudioLowerVolume exec --no-startup-id $lower-volume
|
||||||
bindsym XF86AudioMute exec --no-startup-id $mute-sink
|
bindsym XF86AudioMute exec --no-startup-id $mute-sink
|
||||||
bindsym XF86AudioMicMute exec --no-startup-id $mute-source
|
bindsym XF86AudioMicMute exec --no-startup-id $mute-source
|
||||||
bindsym $mod+slash exec --no-startup-id $mute-sink
|
bindsym $mod+slash exec --no-startup-id wpctl $mute-sink
|
||||||
bindsym $mod+period exec --no-startup-id $raise-volume
|
bindsym $mod+period exec --no-startup-id $raise-volume
|
||||||
bindsym $mod+comma exec --no-startup-id $lower-volume
|
bindsym $mod+comma exec --no-startup-id $lower-volume
|
||||||
|
|
||||||
@@ -136,8 +116,8 @@ bindsym $mod+Shift+comma exec playerctl previous
|
|||||||
bindsym $mod+Shift+period exec playerctl next
|
bindsym $mod+Shift+period exec playerctl next
|
||||||
bindsym $mod+Shift+slash exec playerctl play-pause
|
bindsym $mod+Shift+slash exec playerctl play-pause
|
||||||
|
|
||||||
bindsym Print exec --no-startup-id bash -c 'f="$(xdg-user-dir PICTURES)/$(date +%s_grim.png)" && grim -g "$(slurp)" "$f" && wl-copy < "$f" && notify-send "Screenshot saved" "$f"'
|
bindsym Print exec grim -g "$(slurp)" - | wl-copy
|
||||||
bindsym $mod+Print exec --no-startup-id bash -c 'f="$(xdg-user-dir PICTURES)/$(date +%s_grim.png)" && grim "$f" && wl-copy < "$f" && notify-send "Screenshot saved" "$f"'
|
bindsym $mod+Print exec grim -o $images
|
||||||
### Key bindings
|
### Key bindings
|
||||||
#
|
#
|
||||||
# Basics:
|
# Basics:
|
||||||
@@ -151,23 +131,20 @@ bindsym $mod+Shift+q kill
|
|||||||
# Start your launcher
|
# Start your launcher
|
||||||
bindsym $mod+d exec $menu
|
bindsym $mod+d exec $menu
|
||||||
#
|
#
|
||||||
bindsym $mod+l exec ~/.config/sway/scripts/lock-now $wallpaper_dir
|
bindsym $mod+l exec $screenlock
|
||||||
bindsym $mod+Shift+o exec ~/.config/sway/scripts/lock-now $wallpaper_dir && systemctl suspend
|
|
||||||
# Drag floating windows by holding down $mod and left mouse button.
|
# Drag floating windows by holding down $mod and left mouse button.
|
||||||
# Resize them with right mouse button + $mod.
|
# Resize them with right mouse button + $mod.
|
||||||
# Despite the name, also works for non-floating windows.
|
# Despite the name, also works for non-floating windows.
|
||||||
# Change normal to inverse to use left mouse button for resizing and right
|
# Change normal to inverse to use left mouse button for resizing and right
|
||||||
# mouse button for dragging.
|
# mouse button for dragging.
|
||||||
floating_modifier $mod
|
floating_modifier $mod normal
|
||||||
|
|
||||||
# Reload the configuration file
|
# Reload the configuration file
|
||||||
bindsym $mod+Shift+c reload
|
bindsym $mod+Shift+c reload
|
||||||
# restart sway in place (preserves your layout/session, can be used to upgrade sway)
|
|
||||||
bindsym $mod+Shift+r restart
|
|
||||||
|
|
||||||
# Exit sway (logs you out of your Wayland session)
|
# Exit sway (logs you out of your Wayland session)
|
||||||
#bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
|
#bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
|
||||||
bindsym $mod+Shift+p exec systemctl poweroff
|
bindsym $mod+Shift+p exec loginctl poweroff
|
||||||
bindsym $mod+Shift+l exec swaymsg exit
|
bindsym $mod+Shift+l exec swaymsg exit
|
||||||
#
|
#
|
||||||
# Moving around:
|
# Moving around:
|
||||||
@@ -219,10 +196,10 @@ bindsym $mod+Shift+0 move container to workspace number 10
|
|||||||
# Layout stuff:
|
# Layout stuff:
|
||||||
#
|
#
|
||||||
# You can "split" the current object of your focus with
|
# You can "split" the current object of your focus with
|
||||||
# $mod+h or $mod+v, for horizontal and vertical splits
|
# $mod+b or $mod+v, for horizontal and vertical splits
|
||||||
# respectively.
|
# respectively.
|
||||||
bindsym $mod+h split h
|
bindsym $mod+b splith
|
||||||
bindsym $mod+v split v
|
bindsym $mod+v splitv
|
||||||
|
|
||||||
# Switch the current container between different layout styles
|
# Switch the current container between different layout styles
|
||||||
bindsym $mod+s layout stacking
|
bindsym $mod+s layout stacking
|
||||||
@@ -230,7 +207,7 @@ bindsym $mod+w layout tabbed
|
|||||||
bindsym $mod+e layout toggle split
|
bindsym $mod+e layout toggle split
|
||||||
|
|
||||||
# Make the current focus fullscreen
|
# Make the current focus fullscreen
|
||||||
bindsym $mod+Shift+space fullscreen toggle
|
bindsym $mod+Shift+space fullscreen
|
||||||
|
|
||||||
# Toggle the current focus between tiling and floating mode
|
# Toggle the current focus between tiling and floating mode
|
||||||
bindsym $mod+f floating toggle
|
bindsym $mod+f floating toggle
|
||||||
@@ -281,21 +258,15 @@ mode "resize" {
|
|||||||
}
|
}
|
||||||
bindsym $mod+r mode "resize"
|
bindsym $mod+r mode "resize"
|
||||||
|
|
||||||
# Status bar is provided by waybar (started above); no built-in sway bar.
|
#
|
||||||
|
# Status Bar:
|
||||||
# class border bground text indicator child_border
|
#
|
||||||
client.focused #3A7CA5 #3A7CA5 #E2EBF0 #0D1B27 #3A7CA5
|
# Read `man 5 sway-bar` for more information about this section.
|
||||||
client.placeholder #0D1B27 #0D1B27 #BDD5E4 #0D1B27 #0D1B27
|
bar {
|
||||||
client.unfocused #0D1B27 #152535 #6A8DA0 #0D1B27 #152535
|
}
|
||||||
client.focused_inactive #1A3347 #1A3347 #6A8DA0 #1A3347 #1A3347
|
|
||||||
|
|
||||||
for_window [class="^.*"] border pixel 1
|
for_window [class="^.*"] border pixel 1
|
||||||
|
|
||||||
# Don't lock or blank the screen while a fullscreen window (game, video,
|
|
||||||
# presentation) is focused - ties into the same idle protocol swayidle uses.
|
|
||||||
for_window [app_id="^.*"] inhibit_idle fullscreen
|
|
||||||
for_window [class="^.*"] inhibit_idle fullscreen
|
|
||||||
|
|
||||||
#floating
|
#floating
|
||||||
for_window [app_id="signal"] floating enable
|
for_window [app_id="signal"] floating enable
|
||||||
for_window [app_id="fluffychat"] floating enable
|
for_window [app_id="fluffychat"] floating enable
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
wall_dir="${1:?wallpaper directory required}"
|
|
||||||
img=$(find "$wall_dir" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) | shuf -n1)
|
|
||||||
swaymsg -q output DP-1 adaptive_sync off # lock screen redraws rarely: fixed 240 Hz
|
|
||||||
swaylock -f ${img:+-i "$img"}
|
|
||||||
# once unlocked, turn VRR back on if a game (gamemode) is still running
|
|
||||||
( while pgrep -x swaylock >/dev/null; do sleep 1; done
|
|
||||||
gamemoded -s | grep -q 'is active' && swaymsg -q output DP-1 adaptive_sync on ) &
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
#!/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" ] || return
|
|
||||||
pkill -x swaybg
|
|
||||||
swaybg -m fill -i "$1" &
|
|
||||||
}
|
|
||||||
|
|
||||||
has_fullscreen() {
|
|
||||||
python3 - <<'EOF'
|
|
||||||
import json, subprocess, sys
|
|
||||||
|
|
||||||
def is_fullscreen(node):
|
|
||||||
if node.get('window') and 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(['swaymsg', '-t', 'get_workspaces'], stderr=subprocess.DEVNULL))
|
|
||||||
tree = json.loads(subprocess.check_output(['swaymsg', '-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
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
# Background image is picked at lock time by scripts/lock-now (-i flag)
|
|
||||||
|
|
||||||
# Set the scaling mode for the image
|
|
||||||
scaling=fill
|
|
||||||
Executable → Regular
+6
-8
@@ -4,7 +4,7 @@
|
|||||||
// Choose the order of the modules
|
// Choose the order of the modules
|
||||||
"modules-left": ["sway/workspaces", "sway/window"],
|
"modules-left": ["sway/workspaces", "sway/window"],
|
||||||
"modules-center": ["clock"],
|
"modules-center": ["clock"],
|
||||||
"modules-right": ["custom/tiramisu","battery", "network", "bluetooth", "wireplumber", "tray"],
|
"modules-right": ["custom/tiramisu","battery", "bluetooth", "network", "wireplumber", "tray"],
|
||||||
//"modules-right": ["custom/tiramisu", "bluetooth",network", "wireplumber", "tray"],
|
//"modules-right": ["custom/tiramisu", "bluetooth",network", "wireplumber", "tray"],
|
||||||
// Modules configuration
|
// Modules configuration
|
||||||
// "hyprland/workspaces": {
|
// "hyprland/workspaces": {
|
||||||
@@ -23,27 +23,25 @@
|
|||||||
"clock": {
|
"clock": {
|
||||||
// "timezone": "America/New_York",
|
// "timezone": "America/New_York",
|
||||||
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
|
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
|
||||||
"format": "{:%Y-%m-%d %H:%M}",
|
|
||||||
"format-alt": "{:%Y-%m-%d %H:%M}"
|
"format-alt": "{:%Y-%m-%d %H:%M}"
|
||||||
},
|
},
|
||||||
"bluetooth": {
|
"bluetooth": {
|
||||||
//"format": "{status} ",
|
//"format": "{status} ",
|
||||||
"format-on": "",
|
"format-on": "",
|
||||||
"format-off": "",
|
"format-off": "",
|
||||||
//"format-connected": "{device_alias} ",
|
"format-connected": "{device_alias} ",
|
||||||
"format-connected": "",
|
|
||||||
// "format-device-preference": [ "device1", "device2" ], // preference list deciding the displayed device
|
// "format-device-preference": [ "device1", "device2" ], // preference list deciding the displayed device
|
||||||
"tooltip-format": "{controller_alias}\t{controller_address}\n\n{num_connections} connected",
|
"tooltip-format": "{controller_alias}\t{controller_address}\n\n{num_connections} connected",
|
||||||
"tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}",
|
"tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}",
|
||||||
"tooltip-format-enumerate-connected": "{device_alias}\t{device_address}",
|
"tooltip-format-enumerate-connected": "{device_alias}\t{device_address}",
|
||||||
"tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t{device_battery_percentage}%",
|
"tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t{device_battery_percentage}%",
|
||||||
"on-click": "dbus-launch --exit-with-session blueman-manager"
|
"on-click": "~/.local/bin/rofi-bluetooth"
|
||||||
|
//"on-click": "blueman-manager"
|
||||||
},
|
},
|
||||||
"network": {
|
"network": {
|
||||||
"interface": "wlp0s20f3",
|
"interface": "wls2",
|
||||||
"format": "{ifname}",
|
"format": "{ifname}",
|
||||||
//"format-wifi": "{essid} {icon}",
|
"format-wifi": "{essid} {icon}",
|
||||||
"format-wifi": "{icon}",
|
|
||||||
"format-ethernet": "{ipaddr}/{cidr} ",
|
"format-ethernet": "{ipaddr}/{cidr} ",
|
||||||
"format-disconnected": "", //An empty format will hide the module.
|
"format-disconnected": "", //An empty format will hide the module.
|
||||||
"tooltip-format": "{ifname} via {gwaddr} ",
|
"tooltip-format": "{ifname} via {gwaddr} ",
|
||||||
|
|||||||
Executable → Regular
+9
@@ -83,6 +83,15 @@ tooltip label{
|
|||||||
background: @bg_hover;
|
background: @bg_hover;
|
||||||
color: @content_main;
|
color: @content_main;
|
||||||
}
|
}
|
||||||
|
button {
|
||||||
|
border: none;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
button:hover {
|
||||||
|
box-shadow: inherit;
|
||||||
|
text-shadow: inherit;
|
||||||
|
background: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
#taskbar {
|
#taskbar {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
Section "Device"
|
|
||||||
Identifier "AMD"
|
|
||||||
Driver "amdgpu"
|
|
||||||
Option "VariableRefresh" "true"
|
|
||||||
EndSection
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
set selection-clipboard clipboard
|
|
||||||
set guioptions "sh"
|
|
||||||
Reference in New Issue
Block a user