Compare commits
13 Commits
918c52f6f3
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| dae66e3608 | |||
| 2fb95b16e8 | |||
| 89ce9ab548 | |||
| 146429f594 | |||
| 13bc86f713 | |||
| e8ef6712af | |||
| d7c1b0e733 | |||
| 20ea9cc4d1 | |||
| bc9e2b7c19 | |||
| 85feb977a1 | |||
| 5356157750 | |||
| 2f31b86e65 | |||
| 6acb9b9aaa |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -6,6 +6,7 @@
|
||||
!alacritty/
|
||||
!dunst/
|
||||
!hypr/
|
||||
!hyprpanel/
|
||||
!nvim/
|
||||
!waybar/
|
||||
!zathura/
|
||||
@@ -23,3 +24,4 @@
|
||||
!wireplumber/
|
||||
!systemd/
|
||||
fish/fish_variables
|
||||
waybar/fluxo-rs
|
||||
|
||||
@@ -26,8 +26,8 @@ lines = 24
|
||||
|
||||
## Blank space added around the window in pixels.
|
||||
[window.padding]
|
||||
x = 30
|
||||
y = 30
|
||||
x = 3
|
||||
y = 0
|
||||
|
||||
## SCROLLING ------------------------------------------------------
|
||||
[scrolling]
|
||||
|
||||
113
btop/btop.conf
113
btop/btop.conf
@@ -1,18 +1,18 @@
|
||||
#? Config file for btop v. 1.4.5
|
||||
#? Config file for btop v.1.4.6
|
||||
|
||||
#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes.
|
||||
#* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes"
|
||||
color_theme = "/home/narl/.config/btop/themes/catppuccin_mocha.theme"
|
||||
|
||||
#* If the theme set background should be shown, set to False if you want terminal background transparency.
|
||||
theme_background = False
|
||||
theme_background = false
|
||||
|
||||
#* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false.
|
||||
truecolor = True
|
||||
truecolor = true
|
||||
|
||||
#* Set to true to force tty mode regardless if a real tty has been detected or not.
|
||||
#* Will force 16-color mode and TTY theme, set all graph symbols to "tty" and swap out other non tty friendly symbols.
|
||||
force_tty = False
|
||||
force_tty = false
|
||||
|
||||
#* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets.
|
||||
#* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positions, G=graph symbol to use for box.
|
||||
@@ -22,10 +22,13 @@ presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:defaul
|
||||
|
||||
#* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists.
|
||||
#* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift.
|
||||
vim_keys = True
|
||||
vim_keys = true
|
||||
|
||||
#* Rounded corners on boxes, is ignored if TTY mode is ON.
|
||||
rounded_corners = True
|
||||
rounded_corners = true
|
||||
|
||||
#* Use terminal synchronized output sequences to reduce flickering on supported terminals.
|
||||
terminal_sync = true
|
||||
|
||||
#* Default symbols to use for graph creation, "braille", "block" or "tty".
|
||||
#* "braille" offers the highest resolution but might not be included in all fonts.
|
||||
@@ -53,44 +56,47 @@ graph_symbol_proc = "default"
|
||||
shown_boxes = "cpu mem net proc"
|
||||
|
||||
#* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs.
|
||||
update_ms = 2000
|
||||
update_ms = 1000
|
||||
|
||||
#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct",
|
||||
#* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly.
|
||||
proc_sorting = "cpu lazy"
|
||||
|
||||
#* Reverse sorting order, True or False.
|
||||
proc_reversed = False
|
||||
proc_reversed = false
|
||||
|
||||
#* Show processes as a tree.
|
||||
proc_tree = True
|
||||
proc_tree = true
|
||||
|
||||
#* Use the cpu graph colors in the process list.
|
||||
proc_colors = True
|
||||
proc_colors = true
|
||||
|
||||
#* Use a darkening gradient in the process list.
|
||||
proc_gradient = True
|
||||
proc_gradient = true
|
||||
|
||||
#* If process cpu usage should be of the core it's running on or usage of the total available cpu power.
|
||||
proc_per_core = False
|
||||
proc_per_core = false
|
||||
|
||||
#* Show process memory as bytes instead of percent.
|
||||
proc_mem_bytes = True
|
||||
proc_mem_bytes = true
|
||||
|
||||
#* Show cpu graph for each process.
|
||||
proc_cpu_graphs = True
|
||||
proc_cpu_graphs = true
|
||||
|
||||
#* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate)
|
||||
proc_info_smaps = False
|
||||
proc_info_smaps = false
|
||||
|
||||
#* Show proc box on left side of screen instead of right.
|
||||
proc_left = False
|
||||
proc_left = false
|
||||
|
||||
#* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop).
|
||||
proc_filter_kernel = False
|
||||
proc_filter_kernel = false
|
||||
|
||||
#* In tree-view, always accumulate child process resources in the parent process.
|
||||
proc_aggregate = False
|
||||
proc_aggregate = false
|
||||
|
||||
#* Should cpu and memory usage display be preserved for dead processes when paused.
|
||||
keep_dead_proc_usage = false
|
||||
|
||||
#* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available.
|
||||
#* Select from a list of detected attributes from the options menu.
|
||||
@@ -104,28 +110,28 @@ cpu_graph_lower = "Auto"
|
||||
show_gpu_info = "Auto"
|
||||
|
||||
#* Toggles if the lower CPU graph should be inverted.
|
||||
cpu_invert_lower = True
|
||||
cpu_invert_lower = true
|
||||
|
||||
#* Set to True to completely disable the lower CPU graph.
|
||||
cpu_single_graph = False
|
||||
cpu_single_graph = false
|
||||
|
||||
#* Show cpu box at bottom of screen instead of top.
|
||||
cpu_bottom = False
|
||||
cpu_bottom = false
|
||||
|
||||
#* Shows the system uptime in the CPU box.
|
||||
show_uptime = True
|
||||
show_uptime = true
|
||||
|
||||
#* Shows the CPU package current power consumption in watts. Requires running `make setcap` or `make setuid` or running with sudo.
|
||||
show_cpu_watts = True
|
||||
show_cpu_watts = true
|
||||
|
||||
#* Show cpu temperature.
|
||||
check_temp = True
|
||||
check_temp = true
|
||||
|
||||
#* Which sensor to use for cpu temperature, use options menu to select from list of available sensors.
|
||||
cpu_sensor = "Auto"
|
||||
|
||||
#* Show temperatures for cpu cores also if check_temp is True and sensors has been found.
|
||||
show_coretemp = True
|
||||
show_coretemp = true
|
||||
|
||||
#* Set a custom mapping between core and coretemp, can be needed on certain cpus to get correct temperature for correct core.
|
||||
#* Use lm-sensors or similar to see which cores are reporting temperatures on your machine.
|
||||
@@ -137,17 +143,20 @@ cpu_core_map = ""
|
||||
temp_scale = "celsius"
|
||||
|
||||
#* Use base 10 for bits/bytes sizes, KB = 1000 instead of KiB = 1024.
|
||||
base_10_sizes = False
|
||||
base_10_sizes = false
|
||||
|
||||
#* Show CPU frequency.
|
||||
show_cpu_freq = True
|
||||
show_cpu_freq = true
|
||||
|
||||
#* How to calculate CPU frequency, available values: "first", "range", "lowest", "highest" and "average".
|
||||
freq_mode = "first"
|
||||
|
||||
#* Draw a clock at top of screen, formatting according to strftime, empty string to disable.
|
||||
#* Special formatting: /host = hostname | /user = username | /uptime = system uptime
|
||||
clock_format = "%X"
|
||||
|
||||
#* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort.
|
||||
background_update = True
|
||||
background_update = true
|
||||
|
||||
#* Custom cpu model name, empty string to disable.
|
||||
custom_cpu_name = ""
|
||||
@@ -157,43 +166,43 @@ custom_cpu_name = ""
|
||||
disks_filter = ""
|
||||
|
||||
#* Show graphs instead of meters for memory values.
|
||||
mem_graphs = True
|
||||
mem_graphs = true
|
||||
|
||||
#* Show mem box below net box instead of above.
|
||||
mem_below_net = False
|
||||
mem_below_net = false
|
||||
|
||||
#* Count ZFS ARC in cached and available memory.
|
||||
zfs_arc_cached = True
|
||||
zfs_arc_cached = true
|
||||
|
||||
#* If swap memory should be shown in memory box.
|
||||
show_swap = True
|
||||
show_swap = true
|
||||
|
||||
#* Show swap as a disk, ignores show_swap value above, inserts itself after first disk.
|
||||
swap_disk = True
|
||||
swap_disk = true
|
||||
|
||||
#* If mem box should be split to also show disks info.
|
||||
show_disks = True
|
||||
show_disks = true
|
||||
|
||||
#* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar.
|
||||
only_physical = True
|
||||
only_physical = true
|
||||
|
||||
#* Read disks list from /etc/fstab. This also disables only_physical.
|
||||
use_fstab = True
|
||||
use_fstab = true
|
||||
|
||||
#* Setting this to True will hide all datasets, and only show ZFS pools. (IO stats will be calculated per-pool)
|
||||
zfs_hide_datasets = False
|
||||
zfs_hide_datasets = false
|
||||
|
||||
#* Set to true to show available disk space for privileged users.
|
||||
disk_free_priv = False
|
||||
disk_free_priv = false
|
||||
|
||||
#* Toggles if io activity % (disk busy time) should be shown in regular disk usage view.
|
||||
show_io_stat = True
|
||||
show_io_stat = true
|
||||
|
||||
#* Toggles io mode for disks, showing big graphs for disk read/write speeds.
|
||||
io_mode = False
|
||||
io_mode = false
|
||||
|
||||
#* Set to True to show combined read/write io graphs in io mode.
|
||||
io_graph_combined = False
|
||||
io_graph_combined = false
|
||||
|
||||
#* Set the top speed for the io graphs in MiB/s (100 by default), use format "mountpoint:speed" separate disks with whitespace " ".
|
||||
#* Example: "/mnt/media:100 /:20 /boot:1".
|
||||
@@ -205,10 +214,10 @@ net_download = 100
|
||||
net_upload = 100
|
||||
|
||||
#* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest.
|
||||
net_auto = True
|
||||
net_auto = true
|
||||
|
||||
#* Sync the auto scaling for download and upload to whichever currently has the highest scale.
|
||||
net_sync = True
|
||||
net_sync = true
|
||||
|
||||
#* Starts with the Network Interface specified here.
|
||||
net_iface = ""
|
||||
@@ -217,26 +226,32 @@ net_iface = ""
|
||||
base_10_bitrate = "Auto"
|
||||
|
||||
#* Show battery stats in top right if battery is present.
|
||||
show_battery = True
|
||||
show_battery = true
|
||||
|
||||
#* Which battery to use if multiple are present. "Auto" for auto detection.
|
||||
selected_battery = "Auto"
|
||||
|
||||
#* Show power stats of battery next to charge indicator.
|
||||
show_battery_watts = True
|
||||
show_battery_watts = true
|
||||
|
||||
#* Set loglevel for "~/.config/btop/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG".
|
||||
#* Set loglevel for "~/.local/state/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG".
|
||||
#* The level set includes all lower levels, i.e. "DEBUG" will show all logging info.
|
||||
log_level = "WARNING"
|
||||
|
||||
#* Automatically save current settings to config file on exit.
|
||||
save_config_on_exit = true
|
||||
|
||||
#* Measure PCIe throughput on NVIDIA cards, may impact performance on certain cards.
|
||||
nvml_measure_pcie_speeds = True
|
||||
nvml_measure_pcie_speeds = true
|
||||
|
||||
#* Measure PCIe throughput on AMD cards, may impact performance on certain cards.
|
||||
rsmi_measure_pcie_speeds = True
|
||||
rsmi_measure_pcie_speeds = true
|
||||
|
||||
#* Horizontally mirror the GPU graph.
|
||||
gpu_mirror_graph = True
|
||||
gpu_mirror_graph = true
|
||||
|
||||
#* Set which GPU vendors to show. Available values are "nvidia amd intel"
|
||||
shown_gpus = "nvidia amd intel"
|
||||
|
||||
#* Custom gpu0 model name, empty string to disable.
|
||||
custom_gpu_name0 = ""
|
||||
|
||||
@@ -32,6 +32,8 @@ set -l GCR_SSH_SOCK $XDG_RUNTIME_DIR/gcr/ssh
|
||||
if test -S "$GCR_SSH_SOCK"
|
||||
set -gx SSH_AUTH_SOCK "$GCR_SSH_SOCK"
|
||||
end
|
||||
if uwsm check may-start && uwsm select
|
||||
if status is-login && test -z "$DISPLAY" -a -z "$WAYLAND_DISPLAY"
|
||||
if uwsm check may-start && uwsm select
|
||||
exec uwsm start default
|
||||
end
|
||||
end
|
||||
|
||||
@@ -12,7 +12,7 @@ general {
|
||||
# BACKGROUND
|
||||
background {
|
||||
monitor =
|
||||
path = $HOME/Pictures/exp33/exp33-oled.jpeg
|
||||
path = $HOME/Pictures/mandelbrot.png
|
||||
blur_passes = 0
|
||||
color = $base
|
||||
}
|
||||
|
||||
1
hypr/lid_state.conf
Normal file
1
hypr/lid_state.conf
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
# Or execute your favorite apps at launch like this:
|
||||
|
||||
# exec-once = uwsm app -- waybar
|
||||
# exec-once = uwsm app -- hyprpanel
|
||||
# exec-once = uwsm app -- nextcloud --background
|
||||
exec-once = uwsm app -- nm-applet --indicator
|
||||
# exec-once = uwsm app -- rclone mount google_drive: ~/gdrive
|
||||
@@ -13,3 +14,4 @@ exec-once = uwsm app -- hyprpaper
|
||||
# exec-once = uwsm app -- /usr/lib/xdg-desktop-portal-hyprland
|
||||
exec-once = wl-paste --type text --watch cliphist store # Stores only text data
|
||||
exec-once = wl-paste --type image --watch cliphist store # Stores only image data
|
||||
exec-once = uwsm app -- ~/.cargo/bin/fluxo-rs daemon
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Environment-variables/
|
||||
|
||||
# env = INTEL_DEBUG,noccs
|
||||
# env = WLR_DRM_NO_ATOMIC,1
|
||||
env = HYPRCURSOR_THEME,Bibata-Modern-Classic
|
||||
env = HYPRCURSOR_SIZE,24
|
||||
env = XCURSOR_SIZE,24
|
||||
@@ -12,3 +14,4 @@ env = QT_QPA_PLATFORMTHEME,qt6ct
|
||||
# env = VDPAU_DRIVER,radeonsi
|
||||
env = MOZ_ENABLE_WAYLAND,1
|
||||
env = ELECTRON_OZONE_PLATFORM_HINT,wayland
|
||||
env = EDITOR,nvim
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#input
|
||||
input {
|
||||
kb_layout = us
|
||||
kb_layout = us,us
|
||||
kb_variant = dvorak-intl, intl
|
||||
# kb_variant = intl
|
||||
kb_model =
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
|
||||
# monitor = desc:Samsung Electric Company LC27G7xT H4ZRA00734, 2560x1440@90, 0x-1440, 1
|
||||
# monitor = desc:Samsung Electric Company LC27G7xT H4ZRA00734, 2560x1440@90, 0x-1440, 1, bitdepth, 10
|
||||
monitor = desc:Samsung Electric Company LC27G7xT H4ZRA00734, 1920x1080@90, 0x-1080, 1
|
||||
# laptop screen
|
||||
monitor = eDP-1, 1920x1080@60, 0x0, 1
|
||||
# samsung home monitor
|
||||
monitor = desc:Samsung Electric Company LC27G7xT H4ZRA00734, 2560x1440@144, 0x-1440, 1
|
||||
|
||||
|
||||
# lid_state fallback
|
||||
source = ~/.config/hypr/lid_state.conf
|
||||
|
||||
@@ -20,7 +20,7 @@ general {
|
||||
resize_on_border = false
|
||||
|
||||
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
|
||||
allow_tearing = true
|
||||
allow_tearing = false
|
||||
|
||||
layout = dwindle
|
||||
}
|
||||
@@ -96,7 +96,7 @@ master {
|
||||
misc {
|
||||
force_default_wallpaper = 0 # Set to 0 or 1 to disable the anime mascot wallpapers
|
||||
disable_hyprland_logo = true # If true disables the random hyprland logo / anime girl background. :(
|
||||
vrr = 0
|
||||
vrr = 1
|
||||
font_family = FiraCode Nerd Font
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,21 @@
|
||||
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
|
||||
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules
|
||||
|
||||
# ==========================================
|
||||
# VARIABLES
|
||||
# ==========================================
|
||||
# Dialogs and utility apps that should float in the center
|
||||
$dialog_titles = ^(Open Form|Open File|Select a File|Choose a file|Open Workspace|Choose Directory|Save As|Save File|branchdialog|pinentry-gtk-2|Confirm to replace files|File Operation Progress|Open Files|Anmelden – Google Konten — Zen Browser)$
|
||||
$dialog_classes = ^(pavucontrol|blueman-manager|nm-connection-editor|org.pulseaudio.pavucontrol)$
|
||||
|
||||
# App classes
|
||||
$steam = ^(steam)$
|
||||
$gamescope = ^(gamescope)$
|
||||
|
||||
|
||||
# ==========================================
|
||||
# GENERAL & FIXES
|
||||
# ==========================================
|
||||
# Ignore maximize requests from apps. You'll probably like this.
|
||||
# windowrule = suppress_event maximize, match:class .*
|
||||
|
||||
@@ -9,45 +24,54 @@
|
||||
windowrule = no_blur 1, match:class ^$, match:title ^$
|
||||
|
||||
|
||||
# games for tearing add the immediate rule
|
||||
# ==========================================
|
||||
# FLOATING & CENTERED DIALOGS
|
||||
# ==========================================
|
||||
# Make them float
|
||||
windowrule = float 1, match:title $dialog_titles
|
||||
windowrule = float 1, match:class $dialog_classes
|
||||
|
||||
# Float Windows
|
||||
windowrule = float 1, match:title ^(Open File|Select a File|Select Folder|Choose a file|Open Form|Open Workspace|Choose Directory|Save As|Save File|branchdialog|pinentry-gtk-2|Confirm to replace files|File Operation Progress)$
|
||||
windowrule = float 1, match:class ^(pavucontrol|blueman-manager|nm-connection-editor)$
|
||||
# Set to 800x600
|
||||
windowrule = size 800 600, match:title $dialog_titles
|
||||
windowrule = size 800 600, match:class $dialog_classes
|
||||
|
||||
# Center and Resize Windows
|
||||
windowrule = size 800 600, match:title ^(Open Form|Open File|Select a File|Choose a file|Open Workspace|Choose Directory|Save As|Save File|branchdialog|pinentry-gtk-2|Confirm to replace files|File Operation Progress)$
|
||||
windowrule = size 800 600, match:class ^(pavucontrol|blueman-manager|nm-connection-editor)$
|
||||
# Center them on the screen
|
||||
windowrule = center 1, match:title $dialog_titles
|
||||
windowrule = center 1, match:class $dialog_classes
|
||||
|
||||
windowrule = center 1, match:title ^(Open Form|Open File|Select a File|Choose a file|Open Workspace|Choose Directory|Save As|Save File|branchdialog|pinentry-gtk-2|Confirm to replace files|File Operation Progress)$
|
||||
windowrule = center 1, match:class ^(pavucontrol|blueman-manager|nm-connection-editor)$
|
||||
# Disable blur
|
||||
windowrule = no_blur 1, match:title $dialog_titles
|
||||
windowrule = no_blur 1, match:class $dialog_classes
|
||||
|
||||
windowrule = no_blur 1, match:title ^(Open Form|Open File|Select a File|Choose a file|Open Workspace|Choose Directory|Save As|Save File|branchdialog|pinentry-gtk-2|Confirm to replace files|File Operation Progress)$
|
||||
windowrule = no_blur 1, match:class ^(pavucontrol|blueman-manager|nm-connection-editor)$
|
||||
|
||||
# Workspace Rules
|
||||
# ==========================================
|
||||
# WORKSPACE ASSIGNMENTS
|
||||
# ==========================================
|
||||
# Normal Workspaces
|
||||
# windowrule = workspace 1, match:class ^(firefox)$
|
||||
# windowrule = workspace 2, match:class ^(kitty)$
|
||||
# windowrule = workspace 3, match:class ^(Code)$
|
||||
windowrule = workspace 1, match:class $gamescope
|
||||
|
||||
|
||||
# Special Workspaces
|
||||
windowrule = workspace special:virtual, match:class ^(Spotify|spotify)$
|
||||
windowrule = workspace special:discord, match:class ^(discord|vesktop)$
|
||||
|
||||
# steam rules
|
||||
|
||||
windowrule = workspace 3 silent, match:class ^(steam)$, match:title ^(Steam)$
|
||||
windowrule = workspace 4, match:class ^(gamescope)$
|
||||
# ==========================================
|
||||
# APP-SPECIFIC RULES: STEAM & GAMING
|
||||
# ==========================================
|
||||
# windowrule = workspace 3 silent, match:class $steam, match:title ^(Steam)$
|
||||
|
||||
# fixed sizes for different windows
|
||||
windowrule = size 400 800, match:title ^(Friends List)$, match:class ^(steam)$
|
||||
windowrule = size 1000 800, match:title ^(Steam Settings)$, match:class ^(steam)$
|
||||
windowrule = size 1000 800, match:title ^(Add Non-Steam Game)$, match:class ^(steam)$
|
||||
# Fixed sizes for specific Steam windows
|
||||
windowrule = size 400 800, match:title ^(Friends List)$, match:class $steam
|
||||
windowrule = size 1000 800, match:title ^(Steam Settings)$, match:class $steam
|
||||
windowrule = size 1000 800, match:title ^(Add Non-Steam Game)$, match:class $steam
|
||||
|
||||
# float windows that arent the main steam window
|
||||
windowrule = float 1, match:class ^(steam)$, match:title negative:^(Steam)$
|
||||
windowrule = no_blur 1, match:class ^(steam)$, match:title negative:^(Steam)$
|
||||
# windowrule = center 1, match:class ^(steam)$, match:title negative:^(Steam)$
|
||||
# Float and disable blur for Steam windows that aren't the main window
|
||||
windowrule = float 1, match:class $steam, match:title negative:^(Steam)$
|
||||
windowrule = no_blur 1, match:class $steam, match:title negative:^(Steam)$
|
||||
# windowrule = center 1, match:class $steam, match:title negative:^(Steam)$
|
||||
|
||||
# allow tearing for games started with gamescope
|
||||
windowrule = immediate 1, match:class ^(gamescope)$
|
||||
# Allow tearing for games started with Gamescope
|
||||
windowrule = immediate 1, match:class $gamescope
|
||||
|
||||
@@ -1,18 +1,53 @@
|
||||
#!/bin/bash
|
||||
# ~/.config/hypr/scripts/lid_handler.sh
|
||||
|
||||
if [[ "$1" == "close" ]]; then
|
||||
# Lid closed: disable laptop screen if any DP-* monitor is present
|
||||
# Using 'all' to detect monitors even if they are currently disabled
|
||||
if hyprctl monitors all | grep -q "Monitor DP-"; then
|
||||
hyprctl keyword monitor "eDP-1, disable" # Disable laptop display
|
||||
# The file that tells Hyprland to keep the lid off during reloads
|
||||
LID_STATE_FILE="$HOME/.config/hypr/lid_state.conf"
|
||||
|
||||
# Enable all detected DP-* monitors
|
||||
for monitor in $(hyprctl monitors all | grep "Monitor DP-" | awk '{print $2}'); do
|
||||
hyprctl keyword monitor "$monitor, enable"
|
||||
restart_ui() {
|
||||
# Spawn in background and detach
|
||||
systemctl restart --user waybar hyprpaper
|
||||
}
|
||||
|
||||
if [[ "$1" == "close" ]]; then
|
||||
# Check if ANY external monitor is connected and active
|
||||
if hyprctl monitors all | grep -qE "Monitor (DP|HDMI|Type-C)-"; then
|
||||
|
||||
# Prevent laptop screen from turning on during manual config reloads
|
||||
echo "monitor=eDP-1, disable" > "$LID_STATE_FILE"
|
||||
|
||||
# Extract the CURRENT live settings of all external monitors using jq
|
||||
# This grabs the active resolution, refresh rate, position, and scale.
|
||||
LIVE_MONITORS=$(hyprctl -j monitors | jq -c '.[] | select(.name != "eDP-1")')
|
||||
|
||||
# 3. Disable the laptop screen
|
||||
hyprctl keyword monitor "eDP-1, disable"
|
||||
|
||||
# 4. Re-apply the live settings to external monitors so they don't reset
|
||||
echo "$LIVE_MONITORS" | while read -r mon_json; do
|
||||
NAME=$(echo "$mon_json" | jq -r '.name')
|
||||
WIDTH=$(echo "$mon_json" | jq -r '.width')
|
||||
HEIGHT=$(echo "$mon_json" | jq -r '.height')
|
||||
REFRESH=$(echo "$mon_json" | jq -r '.refreshRate')
|
||||
X=$(echo "$mon_json" | jq -r '.x')
|
||||
Y=$(echo "$mon_json" | jq -r '.y')
|
||||
SCALE=$(echo "$mon_json" | jq -r '.scale')
|
||||
|
||||
# Formats it exactly as Hyprland expects: DP-1, 1920x1080@240, 0x0, 1
|
||||
hyprctl keyword monitor "$NAME, ${WIDTH}x${HEIGHT}@${REFRESH}, ${X}x${Y}, $SCALE"
|
||||
done
|
||||
|
||||
# restart ui
|
||||
restart_ui
|
||||
fi
|
||||
|
||||
elif [[ "$1" == "open" ]]; then
|
||||
# Lid opened: re-enable laptop screen
|
||||
hyprctl keyword monitor "eDP-1, enable"
|
||||
# Clear the override file so the laptop screen is allowed to turn on again
|
||||
echo "" > "$LID_STATE_FILE"
|
||||
|
||||
# Let Hyprland reload itself.
|
||||
# This automatically re-enables eDP-1 based on your hardcoded hyprland.conf!
|
||||
hyprctl reload
|
||||
|
||||
restart_ui
|
||||
fi
|
||||
166
hyprpanel/config.json
Normal file
166
hyprpanel/config.json
Normal file
@@ -0,0 +1,166 @@
|
||||
{
|
||||
"log_level": "LOG_LEVEL_INFO",
|
||||
"log_subprocesses_to_journal": false,
|
||||
"dbus": {
|
||||
"enabled": true,
|
||||
"connect_timeout": "20s",
|
||||
"connect_interval": "0.200s",
|
||||
"notifications": {
|
||||
"enabled": true
|
||||
},
|
||||
"systray": {
|
||||
"enabled": true
|
||||
},
|
||||
"shortcuts": {
|
||||
"enabled": true
|
||||
},
|
||||
"brightness": {
|
||||
"enabled": true,
|
||||
"adjust_step_percent": 5,
|
||||
"min_brightness": 1,
|
||||
"enable_logind": true,
|
||||
"hud_notifications": true
|
||||
},
|
||||
"power": {
|
||||
"enabled": true,
|
||||
"low_percent": 10,
|
||||
"critical_percent": 5,
|
||||
"hud_notifications": true
|
||||
}
|
||||
},
|
||||
"audio": {
|
||||
"enabled": true,
|
||||
"volume_step_percent": 5,
|
||||
"volume_exceed_maximum": false,
|
||||
"hud_notifications": true
|
||||
},
|
||||
"panels": [
|
||||
{
|
||||
"id": "panel0",
|
||||
"edge": "EDGE_TOP",
|
||||
"size": 34,
|
||||
"monitor": "",
|
||||
"modules": [
|
||||
{
|
||||
"pager": {
|
||||
"icon_size": 14,
|
||||
"active_monitor_only": false,
|
||||
"scroll_wrap_workspaces": true,
|
||||
"scroll_include_inactive": true,
|
||||
"enable_workspace_names": false,
|
||||
"pinned": [1, 2, 3, 4, 5, 6],
|
||||
"preview_width": 256
|
||||
}
|
||||
},
|
||||
{
|
||||
"spacer": {
|
||||
"size": 8,
|
||||
"expand": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"taskbar": {
|
||||
"icon_size": 24,
|
||||
"active_workspace_only": true,
|
||||
"active_monitor_only": true,
|
||||
"group_tasks": true,
|
||||
"expand": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"spacer": {
|
||||
"expand": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"clock": {
|
||||
"time_format": "15:04",
|
||||
"date_format": "%a %d %b",
|
||||
"tooltip_time_format": "15:04",
|
||||
"tooltip_date_format": "Monday, 02 January 2006"
|
||||
}
|
||||
},
|
||||
{
|
||||
"spacer": {
|
||||
"expand": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"systray": {
|
||||
"icon_size": 18,
|
||||
"menu_icon_size": 18,
|
||||
"pinned": [
|
||||
"nm-applet"
|
||||
],
|
||||
"modules": [
|
||||
{
|
||||
"power": {
|
||||
"icon_size": 18,
|
||||
"icon_symbolic": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"spacer": {
|
||||
"size": 8,
|
||||
"expand": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"notifications": {
|
||||
"icon_size": 18,
|
||||
"notification_icon_size": 48,
|
||||
"default_timeout": "7s",
|
||||
"position": "POSITION_TOP_RIGHT",
|
||||
"margin": 24
|
||||
}
|
||||
},
|
||||
{
|
||||
"spacer": {
|
||||
"size": 8,
|
||||
"expand": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"audio": {
|
||||
"icon_size": 18,
|
||||
"icon_symbolic": true,
|
||||
"command_mixer": "pavucontrol",
|
||||
"enable_source": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"spacer": {
|
||||
"size": 8,
|
||||
"expand": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"session": {
|
||||
"icon_size": 18,
|
||||
"icon_symbolic": true,
|
||||
"overlay_icon_size": 64,
|
||||
"overlay_icon_symbolic": true,
|
||||
"command_logout": "uwsm stop",
|
||||
"command_reboot": "systemctl reboot",
|
||||
"command_suspend": "systemctl suspend",
|
||||
"command_shutdown": "systemctl poweroff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"spacer": {
|
||||
"size": 8,
|
||||
"expand": false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"launch_wrapper": [
|
||||
"uwsm",
|
||||
"app",
|
||||
"--"
|
||||
]
|
||||
}
|
||||
127
hyprpanel/style.css
Normal file
127
hyprpanel/style.css
Normal file
@@ -0,0 +1,127 @@
|
||||
/* Catppuccin Mocha Palette */
|
||||
@define-color base #1e1e2e;
|
||||
@define-color mantle #181825;
|
||||
@define-color crust #11111b;
|
||||
@define-color surface0 #313244;
|
||||
@define-color surface1 #45475a;
|
||||
@define-color surface2 #585b70;
|
||||
@define-color text #cdd6f4;
|
||||
@define-color subtext0 #a6adc8;
|
||||
@define-color subtext1 #bac2de;
|
||||
@define-color overlay0 #6c7086;
|
||||
@define-color overlay1 #7f849c;
|
||||
@define-color overlay2 #9399b2;
|
||||
@define-color blue #89b4fa;
|
||||
@define-color lavender #b4befe;
|
||||
@define-color sapphire #74c7ec;
|
||||
@define-color sky #89dceb;
|
||||
@define-color teal #94e2d5;
|
||||
@define-color green #a6e3a1;
|
||||
@define-color yellow #f9e2af;
|
||||
@define-color peach #fab387;
|
||||
@define-color maroon #eba0ac;
|
||||
@define-color red #f38ba8;
|
||||
@define-color mauve #cba6f7;
|
||||
@define-color flamingo #f2cdcd;
|
||||
@define-color rosewater #f5e0dc;
|
||||
|
||||
* {
|
||||
font-family: "JetBrainsMono Nerd Font";
|
||||
font-size: 13px;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
window#panel0 {
|
||||
background-color: alpha(@base, 0.7);
|
||||
color: @text;
|
||||
}
|
||||
|
||||
#pager {
|
||||
margin: 4px;
|
||||
}
|
||||
|
||||
#pager button {
|
||||
background-color: @surface0;
|
||||
color: @subtext0;
|
||||
border-radius: 12px;
|
||||
margin: 0 2px;
|
||||
padding: 0 12px;
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
#pager button.active {
|
||||
background-color: @mauve;
|
||||
color: @base;
|
||||
}
|
||||
|
||||
#pager button:hover {
|
||||
background-color: @surface1;
|
||||
color: @text;
|
||||
}
|
||||
|
||||
#taskbar button {
|
||||
background-color: transparent;
|
||||
color: @subtext1;
|
||||
border-radius: 12px;
|
||||
margin: 0 2px;
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
#taskbar button.active {
|
||||
background-color: @surface0;
|
||||
border-bottom: 2px solid @mauve;
|
||||
}
|
||||
|
||||
#clock, #systray, #audio, #session, #notifications {
|
||||
background-color: @surface0;
|
||||
color: @text;
|
||||
border-radius: 15px;
|
||||
margin: 4px 3px;
|
||||
padding: 0 12px;
|
||||
}
|
||||
|
||||
#notifications {
|
||||
color: @yellow;
|
||||
}
|
||||
|
||||
#clock {
|
||||
color: @mauve;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#audio {
|
||||
color: @sapphire;
|
||||
}
|
||||
|
||||
#audio.muted {
|
||||
color: @subtext0;
|
||||
}
|
||||
|
||||
#session {
|
||||
color: @red;
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
/* Notifications and HUD */
|
||||
#notifications {
|
||||
background-color: @base;
|
||||
color: @text;
|
||||
border: 1px solid @surface1;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
#hud {
|
||||
background-color: alpha(@base, 0.8);
|
||||
color: @text;
|
||||
border-radius: 20px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#hud .progress-bar {
|
||||
background-color: @surface1;
|
||||
}
|
||||
|
||||
#hud .progress-bar-fill {
|
||||
background-color: @mauve;
|
||||
}
|
||||
@@ -15,6 +15,8 @@ application/x-extension-xht=zen.desktop
|
||||
x-scheme-handler/about=google-chrome.desktop
|
||||
x-scheme-handler/unknown=google-chrome.desktop
|
||||
application/vnd.openxmlformats-officedocument.wordprocessingml.document=libreoffice-writer.desktop
|
||||
x-scheme-handler/ror2mm=r2modman.desktop
|
||||
image/webp=feh.desktop
|
||||
|
||||
[Added Associations]
|
||||
application/pdf=org.pwmt.zathura-pdf-poppler.desktop;
|
||||
@@ -25,3 +27,4 @@ x-scheme-handler/https=zen.desktop;
|
||||
text/html=zen.desktop;
|
||||
x-scheme-handler/chrome=zen.desktop;
|
||||
application/vnd.openxmlformats-officedocument.wordprocessingml.document=libreoffice-writer.desktop;
|
||||
image/webp=feh.desktop;
|
||||
|
||||
88
nvim/README.md
Normal file
88
nvim/README.md
Normal file
@@ -0,0 +1,88 @@
|
||||
# My Neovim Configuration
|
||||
|
||||
A fast, modern, and highly capable Neovim setup tailored for full-stack and systems development. It uses `mini.deps` for blazingly fast plugin management and heavily leverages the `mini.nvim` ecosystem to keep bloat to an absolute minimum.
|
||||
|
||||
## Core Capabilities
|
||||
|
||||
* **Modern Autocompletion:** Powered by the Rust-based `blink.cmp` for zero-latency, out-of-the-box completion with built-in snippet support.
|
||||
* **Intelligent Formatting (`conform.nvim`):** Seamless asynchronous formatting for a massive array of languages.
|
||||
* *Special Rule:* Rust files automatically format on save via `rustfmt`.
|
||||
* **Real-time Linting (`nvim-lint`):** Automatically lints Python files with `flake8` every time the file is saved.
|
||||
* **Robust Language Server Protocol (LSP):** Fully automated LSP installation and configuration via `mason.nvim` and `mason-lspconfig`. Includes specialized C# support via Roslyn.
|
||||
* **Aesthetic & UI:** * Beautiful `Catppuccin` (Mocha/Latte) color scheme.
|
||||
* Informative status lines and tab lines via `mini.statusline` and `mini.tabline`.
|
||||
* Customized floating diagnostic windows and rounded borders.
|
||||
* **Typst Integration:** Live Typst previewing with `typst-preview.nvim` and compilation via `tinymist`.
|
||||
* **Integrated Terminal:** Floating terminal toggle via `toggleterm.nvim`.
|
||||
|
||||
---
|
||||
|
||||
## Supported Languages & Tools
|
||||
|
||||
Through `nvim-treesitter`, `mason`, and our custom handlers, this config provides full highlighting, formatting, and LSP support for:
|
||||
|
||||
* **Systems & Backend:** Rust (`rust-analyzer`, `rustfmt`), C/C++ (`clangd`, `clang-format`), Go (`gopls`, `gofmt`)
|
||||
* **.NET:** C# (`roslyn`, `rzls`, `csharpier`)
|
||||
* **Scripting & Data:** Python (`pyright`, `isort`, `black`, `flake8`), Lua (`lua_ls`, `stylua`), Bash (`bashls`, `shfmt`)
|
||||
* **Web Ecosystem:** HTML, CSS, JSON, YAML, JavaScript, TypeScript, React (`prettier`, various LSPs)
|
||||
* **Other:** Typst (`tinymist`, `typstyle`), Robot Framework (`robotcode`), XML (`xmlformatter`)
|
||||
|
||||
---
|
||||
|
||||
## Keybindings
|
||||
|
||||
**Leader Key:** `,` (Comma)
|
||||
|
||||
### General
|
||||
| Keybind | Action |
|
||||
| :--- | :--- |
|
||||
| `<leader>w` | Save current file |
|
||||
| `<leader>q` | Quit all buffers / Exit Neovim |
|
||||
|
||||
### File Exploration & Searching (`mini.pick` & `mini.files`)
|
||||
| Keybind | Action |
|
||||
| :--- | :--- |
|
||||
| `<leader>e` | Open File Explorer (`mini.files`) |
|
||||
| `<leader><space>` | Search open buffers |
|
||||
| `<leader>ff` | Search all files in current directory |
|
||||
| `<leader>fh` | Search Neovim help tags |
|
||||
|
||||
### Window Management
|
||||
| Keybind | Action |
|
||||
| :--- | :--- |
|
||||
| `<leader>h` | Move to the left window |
|
||||
| `<leader>j` | Move to the window below |
|
||||
| `<leader>k` | Move to the window above |
|
||||
| `<leader>l` | Move to the right window |
|
||||
|
||||
### Code Formatting & LSP
|
||||
| Keybind | Action |
|
||||
| :--- | :--- |
|
||||
| `<leader>f` | Format current file or selected range |
|
||||
| `<leader>K` | Hover: Show documentation for item under cursor |
|
||||
| `<leader>gd` | Go to Definition |
|
||||
| `<leader>gr` | Find all references |
|
||||
| `<leader>rn` | Rename variable/function across the project |
|
||||
| `<leader>ca` | View available Code Actions (Quick fixes) |
|
||||
|
||||
### Terminal (`toggleterm`)
|
||||
| Keybind | Action |
|
||||
| :--- | :--- |
|
||||
| `<C-\>` | Toggle floating terminal |
|
||||
|
||||
### Autocompletion (`blink.cmp`)
|
||||
| Keybind | Action |
|
||||
| :--- | :--- |
|
||||
| `<C-Space>` | Manually trigger autocomplete menu |
|
||||
| `<C-n>` / `<Tab>` | Select next item in the completion menu |
|
||||
| `<C-p>` / `<S-Tab>`| Select previous item in the completion menu |
|
||||
| `<CR>` | Confirm selection |
|
||||
|
||||
---
|
||||
|
||||
## Core Editor Settings
|
||||
* **Indentation:** 4 spaces (Tabs are expanded to spaces).
|
||||
* **Line Numbers:** Enabled.
|
||||
* **Line Wrapping:** Disabled.
|
||||
* **Clipboard:** Synced with the system clipboard (`unnamedplus`).
|
||||
* **Undo History:** Persistent (saved to `~/.cache/nvim-undodir`), meaning you can undo changes even after closing and reopening a file.
|
||||
663
nvim/init.lua
663
nvim/init.lua
@@ -1,111 +1,175 @@
|
||||
vim.o.number = true
|
||||
vim.o.wrap = false
|
||||
vim.o.tabstop = 4
|
||||
vim.o.shiftwidth = 4
|
||||
vim.o.smartcase = true
|
||||
vim.o.ignorecase = true
|
||||
vim.o.hlsearch = false
|
||||
vim.o.signcolumn = 'yes'
|
||||
vim.o.clipboard = 'unnamedplus'
|
||||
vim.o.undofile = true
|
||||
vim.o.undodir = '/home/narl/.cache/nvim-undodir'
|
||||
-- ============================================================================
|
||||
-- === NEOVIM CONFIGURATION ===================================================
|
||||
-- ============================================================================
|
||||
|
||||
vim.g.mapleader = ','
|
||||
-- ============================================================================
|
||||
-- 1. CORE SETTINGS
|
||||
-- ============================================================================
|
||||
vim.g.mapleader = "," -- Set leader key to comma
|
||||
|
||||
-- Set up 'mini.deps' (customize to your liking)
|
||||
require('mini.deps').setup()
|
||||
vim.o.number = true -- Show absolute line numbers
|
||||
vim.o.wrap = false -- Disable line wrapping globally
|
||||
vim.o.tabstop = 4 -- Width of a raw <Tab> character
|
||||
vim.o.shiftwidth = 4 -- Number of spaces used for autoindent
|
||||
vim.o.expandtab = true -- Use spaces instead of tabs
|
||||
vim.o.smartcase = true -- Override ignorecase if search contains uppercase
|
||||
vim.o.ignorecase = true -- Case-insensitive searching
|
||||
vim.o.hlsearch = false -- Disable persistent search highlighting
|
||||
vim.o.signcolumn = "yes" -- Always show the sign column (prevents text shifting)
|
||||
vim.o.clipboard = "unnamedplus" -- Sync Neovim with the system clipboard
|
||||
vim.o.undofile = true -- Enable persistent undo history between sessions
|
||||
vim.o.undodir = vim.fn.expand("~/.cache/nvim-undodir") -- Path to store undo history
|
||||
|
||||
-- ============================================================================
|
||||
-- 2. PLUGIN MANAGER (mini.deps)
|
||||
-- ============================================================================
|
||||
require("mini.deps").setup()
|
||||
local add = MiniDeps.add
|
||||
|
||||
add({
|
||||
source = 'williamboman/mason.nvim'
|
||||
})
|
||||
|
||||
add({
|
||||
source = 'stevearc/conform.nvim'
|
||||
})
|
||||
|
||||
add({
|
||||
source = 'williamboman/mason-lspconfig.nvim'
|
||||
})
|
||||
|
||||
add({
|
||||
source = 'mfussenegger/nvim-lint'
|
||||
})
|
||||
|
||||
add({
|
||||
source = 'akinsho/toggleterm.nvim'
|
||||
})
|
||||
|
||||
-- Add to current session (install if absent)
|
||||
add({
|
||||
source = 'neovim/nvim-lspconfig',
|
||||
-- Supply dependencies near target plugin
|
||||
depends = { 'williamboman/mason.nvim' },
|
||||
})
|
||||
|
||||
add({
|
||||
source = 'seblyng/roslyn.nvim',
|
||||
})
|
||||
|
||||
add({
|
||||
source = 'tris203/rzls.nvim',
|
||||
})
|
||||
|
||||
add({
|
||||
source = 'nvim-treesitter/nvim-treesitter',
|
||||
-- Use 'master' while monitoring updates in 'main'
|
||||
checkout = 'master',
|
||||
monitor = 'main',
|
||||
-- Perform action after every checkout
|
||||
hooks = { post_checkout = function() vim.cmd('TSUpdate') end },
|
||||
})
|
||||
|
||||
add({
|
||||
-- Completion framework:
|
||||
source = 'hrsh7th/nvim-cmp',
|
||||
|
||||
-- LSP completion source:
|
||||
depends = {'hrsh7th/cmp-nvim-lsp',
|
||||
'hrsh7th/cmp-nvim-lua',
|
||||
'hrsh7th/cmp-nvim-lsp-signature-help',
|
||||
'hrsh7th/cmp-vsnip',
|
||||
'hrsh7th/cmp-path',
|
||||
'hrsh7th/cmp-buffer',
|
||||
'hrsh7th/vim-vsnip',
|
||||
},
|
||||
})
|
||||
|
||||
-- UI & Theming
|
||||
add({ source = "catppuccin/nvim", name = "catppuccin" })
|
||||
add({ source = "nvim-lualine/lualine.nvim" })
|
||||
add({ source = "lewis6991/gitsigns.nvim" })
|
||||
add({ source = "folke/which-key.nvim" })
|
||||
|
||||
require('mini.files').setup({
|
||||
mappings = {
|
||||
show_help = 'gh',
|
||||
-- Utility & Editing
|
||||
add({ source = "akinsho/toggleterm.nvim" })
|
||||
add({ source = "chomosuke/typst-preview.nvim" })
|
||||
add({
|
||||
source = "MeanderingProgrammer/render-markdown.nvim",
|
||||
depends = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.icons" },
|
||||
})
|
||||
|
||||
-- LSP, Formatting & Linting
|
||||
add({ source = "williamboman/mason.nvim" })
|
||||
add({ source = "williamboman/mason-lspconfig.nvim" })
|
||||
add({ source = "neovim/nvim-lspconfig", depends = { "williamboman/mason.nvim" } })
|
||||
add({ source = "stevearc/conform.nvim" })
|
||||
add({ source = "mfussenegger/nvim-lint" })
|
||||
add({ source = "seblyng/roslyn.nvim" })
|
||||
add({ source = "tris203/rzls.nvim" })
|
||||
add({ source = "https://git.narl.io/nvrl/mould-rs", checkout = "main" })
|
||||
|
||||
-- Autocompletion
|
||||
add({
|
||||
source = "Saghen/blink.cmp",
|
||||
depends = { "rafamadriz/friendly-snippets" },
|
||||
hooks = {
|
||||
post_install = function(ctx)
|
||||
vim.cmd("!cd " .. ctx.path .. " && cargo build --release")
|
||||
end,
|
||||
post_checkout = function(ctx)
|
||||
vim.cmd("!cd " .. ctx.path .. " && cargo build --release")
|
||||
end,
|
||||
},
|
||||
})
|
||||
require('mini.icons').setup({style = 'ascii'})
|
||||
require('mini.pick').setup({})
|
||||
require('mini.snippets').setup({})
|
||||
require('mini.notify').setup({})
|
||||
require('mini.statusline').setup({})
|
||||
require('mini.tabline').setup({})
|
||||
require('mini.git').setup({})
|
||||
local imap_expr = function(lhs, rhs)
|
||||
vim.keymap.set('i', lhs, rhs, { expr = true })
|
||||
end
|
||||
imap_expr('<Tab>', [[pumvisible() ? "\<C-n>" : "\<Tab>"]])
|
||||
imap_expr('<S-Tab>', [[pumvisible() ? "\<C-p>" : "\<S-Tab>"]])
|
||||
_G.cr_action = function()
|
||||
-- If there is selected item in popup, accept it with <C-y>
|
||||
if vim.fn.complete_info()['selected'] ~= -1 then return '\25' end
|
||||
-- Fall back to plain `<CR>`. You might want to customize this
|
||||
-- according to other plugins. For example if 'mini.pairs' is set up, replace
|
||||
-- next line with `return MiniPairs.cr()`
|
||||
return '\r'
|
||||
|
||||
-- Treesitter
|
||||
add({
|
||||
source = "nvim-treesitter/nvim-treesitter",
|
||||
checkout = "master",
|
||||
monitor = "main",
|
||||
hooks = {
|
||||
post_checkout = function()
|
||||
vim.cmd("TSUpdate")
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
-- ============================================================================
|
||||
-- 3. MINI MODULES SETUP
|
||||
-- ============================================================================
|
||||
require("mini.extra").setup()
|
||||
require("mini.icons").setup({ style = "ascii" })
|
||||
require("mini.files").setup({ mappings = { show_help = "gh" } })
|
||||
require("mini.pick").setup()
|
||||
require("mini.snippets").setup()
|
||||
require("mini.notify").setup()
|
||||
require("mini.tabline").setup()
|
||||
require("mini.git").setup()
|
||||
require("mini.indentscope").setup()
|
||||
require("mini.pairs").setup()
|
||||
require("mini.surround").setup()
|
||||
|
||||
-- ============================================================================
|
||||
-- 4. UI & THEMING
|
||||
-- ============================================================================
|
||||
|
||||
-- Catppuccin Theme
|
||||
require("catppuccin").setup({
|
||||
flavour = "auto",
|
||||
background = { light = "latte", dark = "mocha" },
|
||||
transparent_background = false,
|
||||
show_end_of_buffer = false,
|
||||
integrations = {
|
||||
cmp = true,
|
||||
gitsigns = true,
|
||||
nvimtree = true,
|
||||
treesitter = true,
|
||||
mini = { enabled = true },
|
||||
},
|
||||
})
|
||||
vim.cmd.colorscheme("catppuccin")
|
||||
|
||||
-- Git Signs
|
||||
require("gitsigns").setup()
|
||||
|
||||
-- Which-Key (Keybind discoverability)
|
||||
require("which-key").setup()
|
||||
|
||||
-- Lualine (Statusline)
|
||||
local function active_lsp()
|
||||
local clients = vim.lsp.get_clients({ bufnr = 0 })
|
||||
if next(clients) == nil then
|
||||
return "No LSP"
|
||||
end
|
||||
local client_names = {}
|
||||
for _, client in ipairs(clients) do
|
||||
table.insert(client_names, client.name)
|
||||
end
|
||||
return "{ " .. table.concat(client_names, " | ") .. " }"
|
||||
end
|
||||
|
||||
vim.keymap.set('i', '<CR>', 'v:lua.cr_action()', { expr = true })
|
||||
require("toggleterm").setup{
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
theme = require("catppuccin.utils.lualine")(),
|
||||
component_separators = { left = "|", right = "|" },
|
||||
section_separators = { left = "", right = "" },
|
||||
globalstatus = true,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch", "diff" },
|
||||
lualine_c = { { "filename", path = 1 }, "diagnostics" },
|
||||
lualine_x = { active_lsp },
|
||||
lualine_y = { "encoding", "fileformat", "filetype" },
|
||||
lualine_z = { "location", "progress" },
|
||||
},
|
||||
})
|
||||
|
||||
-- Render Markdown
|
||||
require("render-markdown").setup({
|
||||
enabled = true,
|
||||
anti_conceal = { enabled = true },
|
||||
heading = {
|
||||
icons = { "1. ", "2. ", "3. ", "4. ", "5. ", "6. " },
|
||||
backgrounds = {
|
||||
"RenderMarkdownH1Bg",
|
||||
"RenderMarkdownH2Bg",
|
||||
"RenderMarkdownH3Bg",
|
||||
"RenderMarkdownH4Bg",
|
||||
"RenderMarkdownH5Bg",
|
||||
"RenderMarkdownH6Bg",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- ============================================================================
|
||||
-- 5. TOOLS & INTEGRATIONS
|
||||
-- ============================================================================
|
||||
|
||||
-- Toggleterm
|
||||
require("toggleterm").setup({
|
||||
size = function(term)
|
||||
if term.direction == "horizontal" then
|
||||
return 30
|
||||
@@ -117,133 +181,137 @@ require("toggleterm").setup{
|
||||
hide_numbers = true,
|
||||
shade_terminals = true,
|
||||
persist_size = true,
|
||||
direction = 'float',
|
||||
direction = "float",
|
||||
close_on_exit = true,
|
||||
shell = vim.o.shell,
|
||||
}
|
||||
})
|
||||
|
||||
require('nvim-treesitter.configs').setup {
|
||||
ensure_installed = { "lua", "rust", "toml", "c_sharp" },
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting=false,
|
||||
-- Typst Preview
|
||||
require("typst-preview").setup({
|
||||
debug = false,
|
||||
port = 0,
|
||||
host = "127.0.0.1",
|
||||
invert_colors = "never",
|
||||
follow_cursor = true,
|
||||
dependencies_bin = {
|
||||
["tinymist"] = "/home/narl/.local/share/nvim/mason/bin/tinymist",
|
||||
["websocat"] = "/usr/bin/websocat",
|
||||
},
|
||||
get_root = function(path_of_main_file)
|
||||
local root = os.getenv("TYPST_ROOT")
|
||||
if root then
|
||||
return root
|
||||
end
|
||||
local main_dir = vim.fs.dirname(vim.fn.fnamemodify(path_of_main_file, ":p"))
|
||||
local found = vim.fs.find({ "typst.toml", ".git" }, { path = main_dir, upward = true })
|
||||
if #found > 0 then
|
||||
return vim.fs.dirname(found[1])
|
||||
end
|
||||
return main_dir
|
||||
end,
|
||||
})
|
||||
|
||||
-- ============================================================================
|
||||
-- 6. TREESITTER, LSP, & AUTOCOMPLETION
|
||||
-- ============================================================================
|
||||
|
||||
-- Treesitter
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = { "lua", "rust", "toml", "c_sharp", "python", "typst", "markdown", "markdown_inline" },
|
||||
auto_install = true,
|
||||
highlight = { enable = true },
|
||||
ident = { enable = true },
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true,
|
||||
max_file_lines = nil,
|
||||
}
|
||||
}
|
||||
rainbow = { enable = true, extended_mode = true },
|
||||
})
|
||||
|
||||
-- Mason (Package Installer)
|
||||
require("mason").setup({
|
||||
registries = {
|
||||
"github:mason-org/mason-registry",
|
||||
"github:Crashdummyy/mason-registry",
|
||||
},
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗"
|
||||
}
|
||||
}
|
||||
})
|
||||
require("mason-lspconfig").setup()
|
||||
vim.lsp.config('rust_analyzer', {
|
||||
-- Server-specific settings. See `:help lsp-quickstart`
|
||||
settings = {
|
||||
['rust-analyzer'] = {},
|
||||
|
||||
-- Mason LSPConfig
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"gopls",
|
||||
"clangd",
|
||||
"html",
|
||||
"cssls",
|
||||
"jsonls",
|
||||
"yamlls",
|
||||
"bashls",
|
||||
"pyright",
|
||||
"ts_ls",
|
||||
"rust_analyzer",
|
||||
"robotcode",
|
||||
"tinymist",
|
||||
},
|
||||
})
|
||||
|
||||
require('roslyn').setup({
|
||||
config = {
|
||||
-- the rest of your Roslyn configuration
|
||||
handlers = require("rzls.roslyn_handlers"),
|
||||
-- Blink.cmp (Autocompletion)
|
||||
require("blink.cmp").setup({
|
||||
keymap = {
|
||||
preset = "none",
|
||||
["<CR>"] = { "accept", "fallback" },
|
||||
["<Tab>"] = { "select_next", "snippet_forward", "fallback" },
|
||||
["<S-Tab>"] = { "select_prev", "snippet_backward", "fallback" },
|
||||
["<Up>"] = { "select_prev", "fallback" },
|
||||
["<Down>"] = { "select_next", "fallback" },
|
||||
["<C-Space>"] = { "show", "show_documentation", "hide_documentation" },
|
||||
},
|
||||
completion = {
|
||||
list = { selection = { preselect = false, auto_insert = true } },
|
||||
},
|
||||
appearance = {
|
||||
use_nvim_cmp_as_default = true,
|
||||
nerd_font_variant = "mono",
|
||||
},
|
||||
sources = { default = { "lsp", "path", "snippets", "buffer" } },
|
||||
signature = { enabled = true },
|
||||
})
|
||||
|
||||
require("catppuccin").setup({
|
||||
flavour = "auto", -- latte, frappe, macchiato, mocha
|
||||
background = { -- :h background
|
||||
light = "latte",
|
||||
dark = "mocha",
|
||||
},
|
||||
transparent_background = false, -- disables setting the background color.
|
||||
show_end_of_buffer = false, -- shows the '~' characters after the end of buffers
|
||||
term_colors = false, -- sets terminal colors (e.g. `g:terminal_color_0`)
|
||||
dim_inactive = {
|
||||
enabled = false, -- dims the background color of inactive window
|
||||
shade = "dark",
|
||||
percentage = 0.15, -- percentage of the shade to apply to the inactive window
|
||||
},
|
||||
no_italic = false, -- Force no italic
|
||||
no_bold = false, -- Force no bold
|
||||
no_underline = false, -- Force no underline
|
||||
styles = { -- Handles the styles of general hi groups (see `:h highlight-args`):
|
||||
comments = { "italic" }, -- Change the style of comments
|
||||
conditionals = { "italic" },
|
||||
loops = {},
|
||||
functions = {},
|
||||
keywords = {},
|
||||
strings = {},
|
||||
variables = {},
|
||||
numbers = {},
|
||||
booleans = {},
|
||||
properties = {},
|
||||
types = {},
|
||||
operators = {},
|
||||
-- miscs = {}, -- Uncomment to turn off hard-coded styles
|
||||
},
|
||||
color_overrides = {},
|
||||
custom_highlights = {},
|
||||
default_integrations = true,
|
||||
integrations = {
|
||||
cmp = true,
|
||||
gitsigns = true,
|
||||
nvimtree = true,
|
||||
treesitter = true,
|
||||
notify = false,
|
||||
mini = {
|
||||
enabled = true,
|
||||
indentscope_color = "",
|
||||
},
|
||||
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
|
||||
},
|
||||
})
|
||||
-- Global LSP Setup (Using Blink capabilities)
|
||||
local capabilities = require("blink.cmp").get_lsp_capabilities()
|
||||
local servers = {
|
||||
"lua_ls",
|
||||
"gopls",
|
||||
"clangd",
|
||||
"html",
|
||||
"cssls",
|
||||
"jsonls",
|
||||
"yamlls",
|
||||
"bashls",
|
||||
"pyright",
|
||||
"ts_ls",
|
||||
"rust_analyzer",
|
||||
"robotcode",
|
||||
"tinymist",
|
||||
"marksman",
|
||||
}
|
||||
|
||||
local sign = function(opts)
|
||||
vim.fn.sign_define(opts.name, {
|
||||
texthl = opts.name,
|
||||
text = opts.text,
|
||||
numhl = ''
|
||||
})
|
||||
for _, server in ipairs(servers) do
|
||||
vim.lsp.config(server, { capabilities = capabilities })
|
||||
end
|
||||
|
||||
sign({name = 'DiagnosticSignError', text = ''})
|
||||
sign({name = 'DiagnosticSignWarn', text = ''})
|
||||
sign({name = 'DiagnosticSignHint', text = ''})
|
||||
sign({name = 'DiagnosticSignInfo', text = ''})
|
||||
--Set completeopt to have a better completion experience
|
||||
-- :help completeopt
|
||||
-- menuone: popup even when there's only one match
|
||||
-- noinsert: Do not insert text until a selection is made
|
||||
-- noselect: Do not select, force to select one from the menu
|
||||
-- shortness: avoid showing extra messages when using completion
|
||||
-- updatetime: set updatetime for CursorHold
|
||||
vim.opt.completeopt = {'menuone', 'noselect', 'noinsert'}
|
||||
vim.opt.shortmess = vim.opt.shortmess + { c = true}
|
||||
vim.api.nvim_set_option('updatetime', 300)
|
||||
-- Dedicated C# Setup
|
||||
require("roslyn").setup({
|
||||
config = { handlers = require("rzls.roslyn_handlers") },
|
||||
})
|
||||
|
||||
-- Fixed column for diagnostics to appear
|
||||
-- Show autodiagnostic popup on cursor hover_range
|
||||
-- Goto previous / next diagnostic warning / error
|
||||
-- Show inlay_hints more frequently
|
||||
vim.cmd([[
|
||||
set signcolumn=yes
|
||||
autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false })
|
||||
]])
|
||||
-- ============================================================================
|
||||
-- 7. DIAGNOSTICS, FORMATTING, & LINTING
|
||||
-- ============================================================================
|
||||
|
||||
-- Diagnostics Configuration
|
||||
local sign = function(opts)
|
||||
vim.fn.sign_define(opts.name, { texthl = opts.name, text = opts.text, numhl = "" })
|
||||
end
|
||||
sign({ name = "DiagnosticSignError", text = "" })
|
||||
sign({ name = "DiagnosticSignWarn", text = "" })
|
||||
sign({ name = "DiagnosticSignHint", text = "" })
|
||||
sign({ name = "DiagnosticSignInfo", text = "" })
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
@@ -251,84 +319,117 @@ vim.diagnostic.config({
|
||||
update_in_insert = true,
|
||||
underline = true,
|
||||
severity_sort = false,
|
||||
float = {
|
||||
border = 'rounded',
|
||||
source = 'always',
|
||||
header = '',
|
||||
prefix = '',
|
||||
},
|
||||
float = { border = "rounded", source = "always", header = "", prefix = "" },
|
||||
})
|
||||
|
||||
-- setup must be called before loading
|
||||
vim.cmd.colorscheme "catppuccin"
|
||||
|
||||
vim.keymap.set('n', '<leader>w', '<cmd>write<cr>', {desc = 'Save file'})
|
||||
vim.keymap.set('n', '<leader>q', '<cmd>quitall<cr>', {desc = 'Exit vim'})
|
||||
|
||||
-- Simplified clipboard mappings
|
||||
-- vim.keymap.set({'n', 'x', 'o'}, '<leader>y', '"+y', {desc = 'Copy to clipboard'})
|
||||
-- vim.keymap.set({'n', 'x'}, '<leader>p', '"+p', {desc = 'Paste from clipboard'})
|
||||
|
||||
vim.keymap.set('n', '<leader>e', '<cmd>lua MiniFiles.open()<cr>', {desc = 'File explorer'})
|
||||
vim.keymap.set('n', '<leader><space>', '<cmd>Pick buffers<cr>', {desc = 'Search open files'})
|
||||
vim.keymap.set('n', '<leader>ff', '<cmd>Pick files<cr>', {desc = 'Search all files'})
|
||||
vim.keymap.set('n', '<leader>fh', '<cmd>Pick help<cr>', {desc = 'Search help tags'})
|
||||
|
||||
vim.keymap.set('n', '<leader>h', '<cmd>wincmd h<cr>')
|
||||
vim.keymap.set('n', '<leader>l', '<cmd>wincmd l<cr>')
|
||||
vim.keymap.set('n', '<leader>j', '<cmd>wincmd j<cr>')
|
||||
vim.keymap.set('n', '<leader>k', '<cmd>wincmd k<cr>')
|
||||
|
||||
-- Rust
|
||||
|
||||
local cmp = require'cmp'
|
||||
cmp.setup({
|
||||
-- Enable LSP snippets
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
-- Formatting (Conform)
|
||||
require("conform").setup({
|
||||
formatters_by_ft = {
|
||||
cs = { "csharpier" },
|
||||
rust = { "rustfmt" },
|
||||
lua = { "stylua" },
|
||||
go = { "gofmt" },
|
||||
c = { "clang-format" },
|
||||
cpp = { "clang-format" },
|
||||
html = { "prettier" },
|
||||
css = { "prettier" },
|
||||
json = { "prettier" },
|
||||
yaml = { "prettier" },
|
||||
sh = { "shfmt" },
|
||||
bash = { "shfmt" },
|
||||
python = { "isort", "black" },
|
||||
javascript = { "prettier" },
|
||||
typescript = { "prettier" },
|
||||
javascriptreact = { "prettier" },
|
||||
typescriptreact = { "prettier" },
|
||||
typst = { "typstyle" },
|
||||
xml = { "xmlformatter" },
|
||||
markdown = { "prettier", "injected" },
|
||||
},
|
||||
format_on_save = function(bufnr)
|
||||
if vim.bo[bufnr].filetype ~= "rust" then
|
||||
return
|
||||
end
|
||||
return { timeout_ms = 3000, lsp_fallback = true }
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||
-- Add tab support
|
||||
['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
||||
['<Tab>'] = cmp.mapping.select_next_item(),
|
||||
['<C-S-f>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.close(),
|
||||
['<CR>'] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Insert,
|
||||
select = true,
|
||||
})
|
||||
},
|
||||
-- Installed sources:
|
||||
sources = {
|
||||
{ name = 'path' }, -- file paths
|
||||
{ name = 'nvim_lsp', keyword_length = 3 }, -- from language server
|
||||
{ name = 'nvim_lsp_signature_help'}, -- display function signatures with current parameter emphasized
|
||||
{ name = 'nvim_lua', keyword_length = 2}, -- complete neovim's Lua runtime API such vim.lsp.*
|
||||
{ name = 'buffer', keyword_length = 2 }, -- source current buffer
|
||||
{ name = 'vsnip', keyword_length = 2 }, -- nvim-cmp source for vim-vsnip
|
||||
{ name = 'calc'}, -- source for math calculation
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
formatting = {
|
||||
fields = {'menu', 'abbr', 'kind'},
|
||||
format = function(entry, item)
|
||||
local menu_icon ={
|
||||
nvim_lsp = 'λ',
|
||||
vsnip = '⋗',
|
||||
buffer = 'Ω',
|
||||
path = '🖫',
|
||||
}
|
||||
item.menu = menu_icon[entry.source.name]
|
||||
return item
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
-- Linting (Nvim-Lint)
|
||||
require("lint").linters_by_ft = {
|
||||
python = { "flake8" },
|
||||
}
|
||||
|
||||
-- ============================================================================
|
||||
-- 8. AUTOCOMMANDS
|
||||
-- ============================================================================
|
||||
|
||||
-- Show floating diagnostic on cursor hold
|
||||
vim.cmd([[
|
||||
set signcolumn=yes
|
||||
autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false })
|
||||
]])
|
||||
|
||||
-- Trigger linting on file save
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
callback = function()
|
||||
require("lint").try_lint()
|
||||
end,
|
||||
})
|
||||
|
||||
-- Markdown specific settings
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "markdown",
|
||||
callback = function()
|
||||
vim.opt_local.wrap = true
|
||||
vim.keymap.set("n", "j", "gj", { buffer = true, desc = "Move down visual line" })
|
||||
vim.keymap.set("n", "k", "gk", { buffer = true, desc = "Move up visual line" })
|
||||
end,
|
||||
})
|
||||
|
||||
-- Dynamic LSP Keymaps (Loaded only when LSP attaches to a buffer)
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
callback = function(event)
|
||||
local opts = { buffer = event.buf }
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
||||
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
|
||||
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
|
||||
end,
|
||||
})
|
||||
|
||||
-- ============================================================================
|
||||
-- 9. GLOBAL KEYMAPS
|
||||
-- ============================================================================
|
||||
|
||||
-- General Operations
|
||||
vim.keymap.set("n", "<leader>w", "<cmd>write<cr>", { desc = "Save file" })
|
||||
vim.keymap.set("n", "<leader>q", "<cmd>quitall<cr>", { desc = "Exit Neovim" })
|
||||
|
||||
-- Window Navigation
|
||||
vim.keymap.set("n", "<leader>h", "<cmd>wincmd h<cr>", { desc = "Move to left split" })
|
||||
vim.keymap.set("n", "<leader>l", "<cmd>wincmd l<cr>", { desc = "Move to right split" })
|
||||
vim.keymap.set("n", "<leader>j", "<cmd>wincmd j<cr>", { desc = "Move to lower split" })
|
||||
vim.keymap.set("n", "<leader>k", "<cmd>wincmd k<cr>", { desc = "Move to upper split" })
|
||||
|
||||
-- Search & Navigation (Mini Pick & Files)
|
||||
vim.keymap.set("n", "<leader>e", "<cmd>lua MiniFiles.open()<cr>", { desc = "Open File Explorer" })
|
||||
vim.keymap.set("n", "<leader><space>", "<cmd>Pick buffers<cr>", { desc = "Search open buffers" })
|
||||
vim.keymap.set("n", "<leader>ff", "<cmd>Pick files<cr>", { desc = "Search all files" })
|
||||
vim.keymap.set("n", "<leader>fh", "<cmd>Pick help<cr>", { desc = "Search help tags" })
|
||||
|
||||
-- Formatting Trigger
|
||||
vim.keymap.set({ "n", "v" }, "<leader>f", function()
|
||||
require("conform").format({ lsp_fallback = true, async = false, timeout_ms = 3000 })
|
||||
end, { desc = "Format file or range" })
|
||||
|
||||
-- Diagnostics Navigation
|
||||
vim.keymap.set("n", "<leader>fd", "<cmd>Pick diagnostic<cr>", { desc = "Search all diagnostics" })
|
||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Next diagnostic" })
|
||||
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Previous diagnostic" })
|
||||
vim.keymap.set("n", "]e", function()
|
||||
vim.diagnostic.goto_next({ severity = vim.diagnostic.severity.ERROR })
|
||||
end, { desc = "Next error" })
|
||||
vim.keymap.set("n", "[e", function()
|
||||
vim.diagnostic.goto_prev({ severity = vim.diagnostic.severity.ERROR })
|
||||
end, { desc = "Previous error" })
|
||||
|
||||
1
systemd/user/default.target.wants/narl_io_mount.service
Symbolic link
1
systemd/user/default.target.wants/narl_io_mount.service
Symbolic link
@@ -0,0 +1 @@
|
||||
/home/narl/.config/systemd/user/narl_io_mount.service
|
||||
1
systemd/user/default.target.wants/vaulthunters_mount.service
Symbolic link
1
systemd/user/default.target.wants/vaulthunters_mount.service
Symbolic link
@@ -0,0 +1 @@
|
||||
/home/narl/.config/systemd/user/vaulthunters_mount.service
|
||||
@@ -9,7 +9,7 @@ After=network-online.target
|
||||
# The command to start the mount.
|
||||
# Replace "my-remote:" and "/path/to/local/mount" accordingly.
|
||||
# The flags below are highly recommended for a good experience.
|
||||
ExecStart=rclone mount google_drive: %h/gdrive \
|
||||
ExecStart=rclone mount google_drive: %h/remote/gdrive \
|
||||
--vfs-cache-mode writes \
|
||||
--log-file /tmp/rclone.log \
|
||||
--log-level INFO
|
||||
|
||||
21
systemd/user/narl_io_mount.service
Normal file
21
systemd/user/narl_io_mount.service
Normal file
@@ -0,0 +1,21 @@
|
||||
# ~/.config/systemd/user/rclone-mount.service
|
||||
|
||||
[Unit]
|
||||
Description=sshfs mount for narl.io server
|
||||
# This ensures your network is ready before it tries to mount
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
# The command to start the mount.
|
||||
# Replace "my-remote:" and "/path/to/local/mount" accordingly.
|
||||
# The flags below are highly recommended for a good experience.
|
||||
ExecStart=sshfs -f -p 420 narl@narl.io:/opt %h/remote/narl.io
|
||||
|
||||
# The command to unmount gracefully.
|
||||
ExecStop=fusermount -u %h/narl_io
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
# This tells systemd to start the service at user login.
|
||||
WantedBy=default.target
|
||||
22
systemd/user/vaulthunters_mount.service
Normal file
22
systemd/user/vaulthunters_mount.service
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
# ~/.config/systemd/user/rclone-mount.service
|
||||
|
||||
[Unit]
|
||||
Description=sshfs mount for narl.io vaulthunters server
|
||||
# This ensures your network is ready before it tries to mount
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
# The command to start the mount.
|
||||
# Replace "my-remote:" and "/path/to/local/mount" accordingly.
|
||||
# The flags below are highly recommended for a good experience.
|
||||
ExecStart=sshfs -f -p 420 narl@vh3.narl.io:/opt/minecraft_vaulthunters %h/remote/vh3.narl.io
|
||||
|
||||
# The command to unmount gracefully.
|
||||
ExecStop=fusermount -u %h/vaulthunters_server
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
# This tells systemd to start the service at user login.
|
||||
WantedBy=default.target
|
||||
1
systemd/user/xdg-desktop-autostart.target.wants/sunshine.service
Symbolic link
1
systemd/user/xdg-desktop-autostart.target.wants/sunshine.service
Symbolic link
@@ -0,0 +1 @@
|
||||
/usr/lib/systemd/user/sunshine.service
|
||||
@@ -1,144 +1,178 @@
|
||||
// ~/.config/waybar/config.jsonc
|
||||
{
|
||||
[
|
||||
{
|
||||
"name": "top",
|
||||
"layer": "top",
|
||||
"position": "top",
|
||||
// "output": "eDP-1",
|
||||
"height": 30,
|
||||
"modules-left": ["hyprland/workspaces"],
|
||||
"modules-center": [],
|
||||
"modules-right": [
|
||||
// "custom/pixelbuds_pro",
|
||||
"custom/network",
|
||||
"custom/mem",
|
||||
"custom/cpu",
|
||||
"custom/tlp",
|
||||
"wireplumber#sink",
|
||||
"wireplumber#source",
|
||||
"tray",
|
||||
"height": 34,
|
||||
"spacing": 4,
|
||||
"margin-top": 6,
|
||||
"margin-left": 10,
|
||||
"margin-right": 10,
|
||||
|
||||
"modules-left": [
|
||||
"hyprland/workspaces",
|
||||
"hyprland/window"
|
||||
],
|
||||
"modules-center": [
|
||||
"clock"
|
||||
],
|
||||
"modules-right": [
|
||||
"tray",
|
||||
"custom/gamemode",
|
||||
"custom/power_status"
|
||||
],
|
||||
|
||||
// --- Standard Modules ---
|
||||
"hyprland/workspaces": {
|
||||
"format": "{icon}",
|
||||
"on-click": "activate"
|
||||
},
|
||||
"hyprland/window": {
|
||||
"format": "{}",
|
||||
"max-length": 35
|
||||
"max-length": 50
|
||||
},
|
||||
"clock": {
|
||||
"format": "{:%a %d %b %H:%M}",
|
||||
"format-alt": false,
|
||||
"on-click-right": "xdg-open https://calendar.proton.me/u/0/month &> /dev/null & disown",
|
||||
"tooltip": false,
|
||||
"tooltip": false
|
||||
},
|
||||
"cpu": {
|
||||
"format": "CPU: {usage}%",
|
||||
"tooltip": true,
|
||||
"tray": {
|
||||
"icon-size": 18,
|
||||
"spacing": 10
|
||||
},
|
||||
|
||||
"custom/gamemode": {
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/fluxo-rs/target/release/fluxo-rs game",
|
||||
"on-click": "~/.config/hypr/scripts/gamemode.sh & disown",
|
||||
"interval": 1
|
||||
},
|
||||
"memory": {
|
||||
"format": "MEM: {used}/{total}GB",
|
||||
|
||||
// --- Fluxo-rs Power ---
|
||||
"custom/power_status": {
|
||||
"format": "{} ",
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/fluxo-rs/target/release/fluxo-rs power",
|
||||
"on-click": "~/.config/hypr/scripts/powermenu.sh & disown",
|
||||
"interval": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "bottom",
|
||||
"layer": "top",
|
||||
"position": "bottom",
|
||||
"height": 34,
|
||||
"spacing": 4,
|
||||
"margin-bottom": 6,
|
||||
"margin-left": 10,
|
||||
"margin-right": 10,
|
||||
|
||||
"modules-left": [
|
||||
"custom/sys",
|
||||
"custom/cpu",
|
||||
"custom/mem",
|
||||
"custom/network",
|
||||
"custom/disk-root"
|
||||
],
|
||||
"modules-center": [
|
||||
],
|
||||
"modules-right": [
|
||||
"custom/bluetooth-audio",
|
||||
"custom/volume",
|
||||
"custom/mic"
|
||||
],
|
||||
|
||||
// --- Fluxo-rs System & Hardware ---
|
||||
"custom/sys": {
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/fluxo-rs/target/release/fluxo-rs sys",
|
||||
"interval": 5
|
||||
},
|
||||
"custom/cpu": {
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/fluxo-rs/target/release/fluxo-rs cpu",
|
||||
"on-click": "zenmonitor & disown",
|
||||
"interval": 3
|
||||
},
|
||||
"network": {
|
||||
"format-wifi": "{essid} ({signalStrength}%): {ipaddr}",
|
||||
"format-ethernet": "{ifname}: {ipaddr}",
|
||||
"format-disconnected": "Disconnected",
|
||||
"tooltip-format": "{ifname} via {gwaddr}"
|
||||
"custom/mem": {
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/fluxo-rs/target/release/fluxo-rs mem",
|
||||
"interval": 3
|
||||
},
|
||||
"wireplumber#sink": {
|
||||
"format": "{node_name} {volume}% {icon}",
|
||||
"format-muted": "{node_name} ",
|
||||
"format-icons": {
|
||||
"headphone": "",
|
||||
"hands-free": "",
|
||||
"default": ["", "", ""]
|
||||
"custom/network": {
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/fluxo-rs/target/release/fluxo-rs net",
|
||||
"interval": 2
|
||||
},
|
||||
|
||||
// --- Fluxo-rs Utilities ---
|
||||
"custom/disk-root": {
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/fluxo-rs/target/release/fluxo-rs disk /",
|
||||
"interval": 30
|
||||
},
|
||||
|
||||
// --- Fluxo-rs Audio & BT ---
|
||||
"custom/volume": {
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/fluxo-rs/target/release/fluxo-rs vol",
|
||||
"on-click": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle",
|
||||
"on-click-right": "~/.config/waybar/scripts/audio.sh cycle",
|
||||
"on-scroll-up": "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+",
|
||||
"on-scroll-down": "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-",
|
||||
"on-click-right": "~/.config/waybar/fluxo-rs/target/release/fluxo-rs vol --cycle",
|
||||
"on-click-middle": "pavucontrol",
|
||||
"scroll-step": 5
|
||||
"interval": 1
|
||||
},
|
||||
"wireplumber#source": {
|
||||
"node-type": "Audio/Source",
|
||||
"format": "{node_name} {volume}% ",
|
||||
"format-muted": "",
|
||||
"custom/mic": {
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/fluxo-rs/target/release/fluxo-rs mic",
|
||||
"on-click": "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle",
|
||||
"on-click-right": "~/.config/waybar/scripts/cycle_input.sh cycle",
|
||||
"on-scroll-up": "wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 5%+",
|
||||
"on-scroll-down": "wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 5%-",
|
||||
"on-click-right": "~/.config/waybar/fluxo-rs/target/release/fluxo-rs mic --cycle",
|
||||
"on-click-middle": "pavucontrol",
|
||||
"scroll-step": 5
|
||||
"interval": 1
|
||||
},
|
||||
"custom/bluetooth-audio": {
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/scripts/bluetooth_audio.sh",
|
||||
"interval": 3,
|
||||
"on-click": "~/.config/waybar/scripts/bluetooth_audio.sh disconnect & disown"
|
||||
},
|
||||
"exec": "~/.config/waybar/fluxo-rs/target/release/fluxo-rs bt",
|
||||
"on-click": "~/.config/waybar/fluxo-rs/target/release/fluxo-rs bt menu",
|
||||
"on-click-right": "~/.config/waybar/fluxo-rs/target/release/fluxo-rs bt disconnect",
|
||||
"interval": 3
|
||||
}
|
||||
|
||||
"pulseaudio": {
|
||||
"format": "{icon} {volume}%",
|
||||
"format-muted": " Muted",
|
||||
"format-icons": {
|
||||
"headphone": "",
|
||||
"hands-free": "",
|
||||
"headset": "",
|
||||
"phone": "",
|
||||
"portable": "",
|
||||
"car": "",
|
||||
"default": ["", ""]
|
||||
},
|
||||
"on-click": "pavucontrol & disown"
|
||||
},
|
||||
"tray": {
|
||||
"icon-size": 18,
|
||||
"spacing": 6
|
||||
},
|
||||
"custom/power": {
|
||||
"format": "",
|
||||
"tooltip": false,
|
||||
"on-click": "~/.config/hypr/scripts/powermenu.sh & disown"
|
||||
},
|
||||
"custom/tlp": {
|
||||
// --- Commented Out Modules ---
|
||||
/*
|
||||
"custom/gpu": {
|
||||
"format": "{}",
|
||||
"exec": "~/.config/waybar/scripts/tlp-profile.sh",
|
||||
"return-type": "json",
|
||||
"interval": 5
|
||||
"exec": "~/.config/waybar/fluxo-rs/target/release/fluxo-rs gpu",
|
||||
"on-click": "lact gui & disown",
|
||||
"interval": 3
|
||||
},
|
||||
"battery": {
|
||||
"states": {
|
||||
"warning": 30,
|
||||
"critical": 15
|
||||
},
|
||||
"format": "{capacity}%",
|
||||
"format-charging": "{capacity}%",
|
||||
"format-plugged": "{capacity}%",
|
||||
"format-alt": "{time} {icon}",
|
||||
"format-full": "{capacity}%",
|
||||
"format-icons": ["", "", "", "", ""]
|
||||
"custom/btrfs": {
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/fluxo-rs/target/release/fluxo-rs pool",
|
||||
"interval": 30
|
||||
},
|
||||
"custom/pixelbuds_pro": {
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/scripts/pixelbuds_pro_control.sh",
|
||||
"interval": 5,
|
||||
"on-click": "~/.config/waybar/scripts/pixelbuds_pro_control.sh connect & disown",
|
||||
"on-click-right": "~/.config/waybar/scripts/pixelbuds_pro_control.sh cycle_anc & disown"
|
||||
},
|
||||
"custom/audio-output": {
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"exec": "/home/narl/.config/waybar/scripts/audio.sh show",
|
||||
"on-click": "/home/narl/.config/waybar/scripts/audio.sh cycle & disown",
|
||||
"interval": 1
|
||||
},
|
||||
"custom/gamemode": {
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/scripts/gamemode_status.sh",
|
||||
"on-click": "~/.config/hypr/scripts/gamemode.sh & disown",
|
||||
"interval": 1
|
||||
"exec": "~/.config/waybar/fluxo-rs/target/release/fluxo-rs buds",
|
||||
"on-click": "~/.config/waybar/fluxo-rs/target/release/fluxo-rs buds connect & disown",
|
||||
"on-click-right": "~/.config/waybar/fluxo-rs/target/release/fluxo-rs buds cycle_anc & disown",
|
||||
"interval": 5
|
||||
},
|
||||
"custom/gpu-screen-recorder": {
|
||||
"format": "{}",
|
||||
@@ -148,61 +182,7 @@
|
||||
"on-click-middle": "nautilus ~/Videos/replay & disown",
|
||||
"on-click": "~/.config/waybar/scripts/toggle-replay.sh & disown",
|
||||
"interval": 1
|
||||
},
|
||||
"custom/gpu": {
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/scripts/gpu_info.sh",
|
||||
"on-click": "lact gui & disown",
|
||||
"interval": 3
|
||||
},
|
||||
"custom/cpu": {
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/scripts/cpu_info.sh",
|
||||
"on-click": "zenmonitor & disown",
|
||||
"interval": 3
|
||||
},
|
||||
"custom/mem": {
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/scripts/memory.sh",
|
||||
"interval": 3
|
||||
},
|
||||
"custom/btrfs": {
|
||||
"format": "{}",
|
||||
"exec": "~/.config/waybar/scripts/btrfs.sh",
|
||||
"return-type": "json",
|
||||
"interval": 30
|
||||
},
|
||||
"custom/disk-root": {
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/scripts/disk_info.sh /",
|
||||
"interval": 30
|
||||
},
|
||||
"custom/disk-gdrive": {
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/scripts/disk_info.sh ~/gdrive",
|
||||
"interval": 30
|
||||
},
|
||||
"custom/disk-data": {
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/scripts/disk_info.sh ~/data",
|
||||
"interval": 30
|
||||
},
|
||||
"custom/disk-games": {
|
||||
"format": "{}",
|
||||
"return-type": "json",
|
||||
"exec": "~/.config/waybar/scripts/disk_info.sh ~/games",
|
||||
"interval": 30
|
||||
},
|
||||
"custom/network": {
|
||||
"exec": "~/.config/waybar/scripts/network.sh",
|
||||
"interval": 2, // in seconds
|
||||
"format": "{}",
|
||||
"return-type": "json"
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
]
|
||||
|
||||
@@ -5,7 +5,8 @@ DESCRIPTION=$(pactl list sources | grep -A2 "Name: $DEFAULT_SOURCE" | grep "Desc
|
||||
|
||||
case $1 in
|
||||
cycle)
|
||||
SOURCES=($(pactl list short sources | awk '{print $2}'))
|
||||
# Filter out monitor sources
|
||||
SOURCES=($(pactl list short sources | awk '{print $2}' | grep -v ".monitor"))
|
||||
NUM_SOURCES=${#SOURCES[@]}
|
||||
CURRENT_SOURCE=$(pactl info | grep 'Default Source' | cut -d ' ' -f3)
|
||||
|
||||
@@ -16,6 +17,10 @@ case $1 in
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
# If current source was a monitor or not in list, just pick the first one
|
||||
if [ $NUM_SOURCES -gt 0 ]; then
|
||||
pactl set-default-source "${SOURCES[0]}"
|
||||
fi
|
||||
;;
|
||||
show)
|
||||
TEXT=$(echo "$DESCRIPTION" | cut -c -20)
|
||||
@@ -35,6 +40,6 @@ case $1 in
|
||||
printf '{"text": "%s", "tooltip": "%s", "class": "%s"}' "$TEXT" "$DESCRIPTION" "$CLASS"
|
||||
;;
|
||||
*)
|
||||
echo "usage audio.sh {cycle|show}"
|
||||
echo "usage cycle_input.sh {cycle|show}"
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -28,11 +28,16 @@ TX_MBPS="0.00"
|
||||
|
||||
# Read previous values if the stats file exists
|
||||
if [ -f "$STATS_FILE" ]; then
|
||||
source "$STATS_FILE" # This loads PREV_TIME, PREV_RX_BYTES, PREV_TX_BYTES
|
||||
# shellcheck source=/dev/null
|
||||
# Use a lock to ensure we don't source while another instance is writing
|
||||
{
|
||||
flock -s 200 || exit 1
|
||||
source "$STATS_FILE" 2>/dev/null
|
||||
} 200>"$STATS_FILE.lock"
|
||||
fi
|
||||
|
||||
# Calculate speed if we have previous data and time has passed
|
||||
if [ -n "$PREV_TIME" ] && [ "$TIME_NOW" -gt "$PREV_TIME" ]; then
|
||||
if [ -n "$PREV_TIME" ] && [ -n "$PREV_RX_BYTES" ] && [ -n "$PREV_TX_BYTES" ] && [ "$TIME_NOW" -gt "$PREV_TIME" ]; then
|
||||
TIME_DIFF=$((TIME_NOW - PREV_TIME))
|
||||
|
||||
RX_BPS=$(( (RX_BYTES_NOW - PREV_RX_BYTES) / TIME_DIFF ))
|
||||
@@ -43,10 +48,14 @@ if [ -n "$PREV_TIME" ] && [ "$TIME_NOW" -gt "$PREV_TIME" ]; then
|
||||
TX_MBPS=$(printf "%.2f" "$(echo "$TX_BPS / 1024 / 1024" | bc -l)")
|
||||
fi
|
||||
|
||||
# Save current values for the next run
|
||||
echo "PREV_TIME=$TIME_NOW" > "$STATS_FILE"
|
||||
echo "PREV_RX_BYTES=$RX_BYTES_NOW" >> "$STATS_FILE"
|
||||
echo "PREV_TX_BYTES=$TX_BYTES_NOW" >> "$STATS_FILE"
|
||||
# Save current values for the next run safely using a lock
|
||||
# We use a subshell with flock to ensure atomic updates and prevent race conditions
|
||||
(
|
||||
flock -x 200 || exit 1
|
||||
echo "PREV_TIME=$TIME_NOW" > "$STATS_FILE"
|
||||
echo "PREV_RX_BYTES=$RX_BYTES_NOW" >> "$STATS_FILE"
|
||||
echo "PREV_TX_BYTES=$TX_BYTES_NOW" >> "$STATS_FILE"
|
||||
) 200>"$STATS_FILE.lock"
|
||||
|
||||
# Format the main output string
|
||||
OUTPUT_TEXT="$INTERFACE ($IP_ADDR): ${RX_MBPS} MB/s ${TX_MBPS} MB/s"
|
||||
|
||||
37
waybar/scripts/volume.sh
Executable file
37
waybar/scripts/volume.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
TYPE=$1 # "mic" for source, empty for sink
|
||||
|
||||
if [ "$TYPE" == "mic" ]; then
|
||||
TARGET="@DEFAULT_AUDIO_SOURCE@"
|
||||
else
|
||||
TARGET="@DEFAULT_AUDIO_SINK@"
|
||||
fi
|
||||
|
||||
# Get volume and mute status from wpctl
|
||||
OUTPUT=$(wpctl get-volume $TARGET)
|
||||
VOLUME_RAW=$(echo "$OUTPUT" | awk '{print $2}')
|
||||
VOLUME=$(echo "$VOLUME_RAW * 100 / 1" | bc)
|
||||
MUTE=$(echo "$OUTPUT" | grep -c "MUTED")
|
||||
|
||||
if [ "$MUTE" -eq 1 ]; then
|
||||
if [ "$TYPE" == "mic" ]; then
|
||||
ICON=""
|
||||
else
|
||||
ICON=""
|
||||
fi
|
||||
printf '{"text": "%s", "class": "muted", "percentage": %d}' "$ICON" "$VOLUME"
|
||||
else
|
||||
if [ "$TYPE" == "mic" ]; then
|
||||
ICON=""
|
||||
else
|
||||
if [ "$VOLUME" -le 30 ]; then
|
||||
ICON=""
|
||||
elif [ "$VOLUME" -le 60 ]; then
|
||||
ICON=""
|
||||
else
|
||||
ICON=""
|
||||
fi
|
||||
fi
|
||||
printf '{"text": "%d%% %s", "class": "unmuted", "percentage": %d}' "$VOLUME" "$ICON" "$VOLUME"
|
||||
fi
|
||||
64
waybar/scripts/volume_combined.py
Normal file
64
waybar/scripts/volume_combined.py
Normal file
@@ -0,0 +1,64 @@
|
||||
import subprocess
|
||||
import json
|
||||
import sys
|
||||
|
||||
def get_wpctl_status(target):
|
||||
try:
|
||||
output = subprocess.check_output(["wpctl", "get-volume", target], text=True)
|
||||
parts = output.strip().split()
|
||||
if len(parts) < 2:
|
||||
return 0, False
|
||||
vol = int(float(parts[1]) * 100)
|
||||
muted = "[MUTED]" in output
|
||||
return vol, muted
|
||||
except:
|
||||
return 0, False
|
||||
|
||||
def get_pactl_description(target_type):
|
||||
try:
|
||||
cmd_info = ["pactl", "info"]
|
||||
info = subprocess.check_output(cmd_info, text=True)
|
||||
search_key = "Default Sink" if target_type == "sink" else "Default Source"
|
||||
default_dev = next(line.split(": ")[1] for line in info.splitlines() if search_key in line)
|
||||
|
||||
cmd_list = ["pactl", "list", "sinks" if target_type == "sink" else "sources"]
|
||||
output = subprocess.check_output(cmd_list, text=True)
|
||||
|
||||
blocks = output.split("\n\n")
|
||||
for block in blocks:
|
||||
if f"Name: {default_dev}" in block:
|
||||
for line in block.splitlines():
|
||||
if "Description:" in line:
|
||||
desc = line.split(": ")[1].strip()
|
||||
# Add a small hint if it is a monitor, though cycle_input should prevent it
|
||||
if ".monitor" in default_dev:
|
||||
return "Monitor: " + desc[:11]
|
||||
return desc[:20]
|
||||
except:
|
||||
pass
|
||||
return "Unknown"
|
||||
|
||||
try:
|
||||
target_type = sys.argv[1] if len(sys.argv) > 1 else "sink"
|
||||
target = "@DEFAULT_AUDIO_SINK@" if target_type == "sink" else "@DEFAULT_AUDIO_SOURCE@"
|
||||
|
||||
vol, muted = get_wpctl_status(target)
|
||||
name = get_pactl_description(target_type)
|
||||
|
||||
if muted:
|
||||
icon = "" if target_type == "sink" else ""
|
||||
text = f"{name} {icon}"
|
||||
cls = "muted"
|
||||
else:
|
||||
if target_type == "sink":
|
||||
if vol <= 30: icon = ""
|
||||
elif vol <= 60: icon = ""
|
||||
else: icon = ""
|
||||
else:
|
||||
icon = ""
|
||||
text = f"{name} {vol}% {icon}"
|
||||
cls = "unmuted"
|
||||
|
||||
print(json.dumps({"text": text, "class": cls, "percentage": vol}))
|
||||
except Exception as e:
|
||||
print(json.dumps({"text": "Error", "class": "error"}))
|
||||
307
waybar/style.css
307
waybar/style.css
@@ -1,254 +1,133 @@
|
||||
/* ~/.config/waybar/style.css */
|
||||
@import "./catppuccin-waybar/themes/mocha.css";
|
||||
|
||||
/* --- Global Reset --- */
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
min-height: 0;
|
||||
font-family: JetBrainsMono Nerd Font;
|
||||
font-family: JetBrainsMono Nerd Font, monospace;
|
||||
font-size: 13px;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
/* --- Bar Background (Floating Island Style) --- */
|
||||
window#waybar {
|
||||
background-color: alpha(@base, 0.4);
|
||||
padding: 4px;
|
||||
transition-property: background-color;
|
||||
transition-duration: 0.5s;
|
||||
background-color: transparent;
|
||||
color: @text;
|
||||
}
|
||||
|
||||
window#waybar.hidden {
|
||||
opacity: 0.5;
|
||||
/* --- Shared Island Styling --- */
|
||||
#workspaces,
|
||||
#window,
|
||||
#clock,
|
||||
#tray,
|
||||
#custom-sys,
|
||||
#custom-cpu,
|
||||
#custom-gpu,
|
||||
#custom-mem,
|
||||
#custom-network,
|
||||
#custom-btrfs,
|
||||
#custom-disk-root,
|
||||
#custom-pixelbuds_pro,
|
||||
#custom-bluetooth-audio,
|
||||
#custom-volume,
|
||||
#custom-mic,
|
||||
#custom-gamemode,
|
||||
#custom-gpu-screen-recorder,
|
||||
#custom-power_status {
|
||||
background-color: alpha(@surface0, 0.95);
|
||||
margin: 4px 2px;
|
||||
padding: 0 12px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid alpha(@surface1, 0.5);
|
||||
}
|
||||
|
||||
/* --- Top Bar Special Handling --- */
|
||||
window#waybar.top {
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
/* --- Bottom Bar Special Handling --- */
|
||||
window#waybar.bottom {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
/* --- Workspaces --- */
|
||||
#workspaces button {
|
||||
all: initial;
|
||||
/* Remove GTK theme values (waybar #1351) */
|
||||
min-width: 0;
|
||||
/* Fix weird spacing in materia (waybar #450) */
|
||||
box-shadow: inset 0 -3px transparent;
|
||||
/* Use box-shadow instead of border so the text isn't offset */
|
||||
padding: 0px 12px;
|
||||
margin: 0px 3px;
|
||||
border-radius: 10px;
|
||||
background-color: @base;
|
||||
padding: 0 8px;
|
||||
margin: 4px 2px;
|
||||
border-radius: 5px;
|
||||
color: @subtext0;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#workspaces button.active {
|
||||
color: @text;
|
||||
border-bottom: 3px solid @blue;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
box-shadow: inherit;
|
||||
text-shadow: inherit;
|
||||
background-color: @surface0;
|
||||
color: @text;
|
||||
color: @blue;
|
||||
background-color: @surface1;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
border-bottom: 3px solid @maroon;
|
||||
}
|
||||
|
||||
#memory,
|
||||
#cpu,
|
||||
#custom-gpu,
|
||||
#custom-cpu,
|
||||
#custom-mem,
|
||||
#custom-power,
|
||||
#custom-gamemode,
|
||||
#custom-tlp,
|
||||
#battery,
|
||||
#backlight,
|
||||
#wireplumber,
|
||||
#custom-network,
|
||||
#network,
|
||||
#clock,
|
||||
#tray,
|
||||
#custom-disk-root,
|
||||
#custom-disk-gdrive,
|
||||
#custom-disk-games,
|
||||
#custom-disk-data,
|
||||
#custom-pixelbuds_pro,
|
||||
#custom-bluetooth-audio,
|
||||
#custom-audio-output,
|
||||
#custom-btrfs,
|
||||
#custom-gpu-screen-recorder {
|
||||
border-radius: 10px;
|
||||
margin: 0px 2px;
|
||||
padding: 0px 10px;
|
||||
background-color: @base;
|
||||
color: @text;
|
||||
}
|
||||
|
||||
#wireplumber.muted, #custom-pixelbuds_pro, #custom-audio-output.muted {
|
||||
background-color: @base;
|
||||
color: @subtext1;
|
||||
border-bottom: 3px solid @subtext1;
|
||||
}
|
||||
|
||||
#custom-pixelbuds_pro.disconnected {
|
||||
padding-right: 10px;
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
#custom-gpu-screen-recorder,
|
||||
#custom-gpu-screen-recorder.recording {
|
||||
padding-right: 12px;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
#custom-gamemode {
|
||||
padding-right: 9px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
#custom-pixelbuds_pro.anc-active {
|
||||
color: @sapphire;
|
||||
border-bottom: 3px solid @sapphire;
|
||||
}
|
||||
|
||||
#custom-bluetooth-audio {
|
||||
color: @sapphire;
|
||||
border-bottom: 3px solid @sapphire;
|
||||
}
|
||||
|
||||
#custom-pixelbuds_pro.anc-aware {
|
||||
color: @sapphire;
|
||||
border-bottom: 3px solid @sapphire;
|
||||
}
|
||||
|
||||
#custom-pixelbuds_pro.anc-off {
|
||||
color: @text;
|
||||
border-bottom: 3px solid @text;
|
||||
}
|
||||
|
||||
#custom-gpu-screen-recorder,
|
||||
#custom-gamemode {
|
||||
background-color: @base;
|
||||
color: @subtext1;
|
||||
border-bottom: 3px solid @subtext1;
|
||||
}
|
||||
|
||||
#custom-power {
|
||||
color: @maroon;
|
||||
}
|
||||
|
||||
#custom-gpu-screen-recorder.recording,
|
||||
#custom-gamemode.active {
|
||||
color: @maroon;
|
||||
border-bottom: 3px solid @maroon;
|
||||
}
|
||||
|
||||
#custom-tlp {
|
||||
padding: 0 10px;
|
||||
min-width: 10px;
|
||||
}
|
||||
|
||||
#custom-tlp.charging {
|
||||
color: @mauve;
|
||||
border-bottom: 3px solid @mauve;
|
||||
}
|
||||
|
||||
#custom-tlp.bat {
|
||||
color: @sapphire;
|
||||
border-bottom: 3px solid @sapphire;
|
||||
}
|
||||
|
||||
#custom-tlp.warning {
|
||||
color: @yellow;
|
||||
border-bottom: 3px solid @yellow;
|
||||
}
|
||||
|
||||
#custom-tlp.critical {
|
||||
color: @red;
|
||||
border-bottom: 3px solid @red;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.8s;
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
background-color: @surface2;
|
||||
color: @text;
|
||||
}
|
||||
|
||||
/* --- Clock (Centered Pill) --- */
|
||||
#clock {
|
||||
color: @mauve;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* --- Power Status --- */
|
||||
#custom-power_status {
|
||||
font-weight: bold;
|
||||
}
|
||||
#custom-power_status.charging { color: @green; border-color: @green; }
|
||||
#custom-power_status.bat { color: @yellow; }
|
||||
#custom-power_status.warning { color: @peach; }
|
||||
#custom-power_status.critical {
|
||||
color: @red;
|
||||
border-color: @red;
|
||||
animation: blink 1s infinite alternate;
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
color: @yellow;
|
||||
border-bottom: 3px solid @yellow;
|
||||
opacity: 0.6;
|
||||
}
|
||||
to { background-color: alpha(@red, 0.4); }
|
||||
}
|
||||
|
||||
#custom-gpu.max,
|
||||
#custom-cpu.max,
|
||||
#custom-mem.max,
|
||||
#custom-btrfs.max,
|
||||
#custom-disk-root.max,
|
||||
#custom-disk-gdrive.max,
|
||||
#custom-disk-games.max,
|
||||
#custom-disk-data.max {
|
||||
color: @maroon;
|
||||
/* border-bottom: 3px solid @maroon; */
|
||||
}
|
||||
/* --- Hardware Metrics (Left Bottom) --- */
|
||||
#custom-sys { color: @teal; }
|
||||
#custom-cpu { color: @blue; }
|
||||
#custom-mem { color: @lavender; }
|
||||
#custom-network { color: @sapphire; }
|
||||
|
||||
#custom-gpu.high,
|
||||
#custom-gpu.high,
|
||||
#custom-cpu.high,
|
||||
#custom-mem.high,
|
||||
#custom-btrfs.high,
|
||||
#custom-disk-root.high,
|
||||
#custom-disk-gdrive.high,
|
||||
#custom-disk-games.high,
|
||||
#custom-disk-data.high {
|
||||
color: @yellow;
|
||||
/* border-bottom: 3px solid @yellow; */
|
||||
}
|
||||
#custom-cpu.high, #custom-mem.high { color: @yellow; }
|
||||
#custom-cpu.max, #custom-mem.max { color: @red; }
|
||||
|
||||
#memory,
|
||||
#cpu,
|
||||
#disk,
|
||||
#network,
|
||||
#custom-network,
|
||||
#custom-gpu.normal,
|
||||
#custom-cpu.normal,
|
||||
#custom-mem.normal,
|
||||
#custom-btrfs.normal,
|
||||
#custom-disk-root.normal,
|
||||
#custom-disk-gdrive.normal,
|
||||
#custom-disk-games.normal,
|
||||
#custom-disk-data.normal {
|
||||
color: @blue;
|
||||
/* border-bottom: 3px solid @mauve; */
|
||||
}
|
||||
/* --- Center Bottom Utilities --- */
|
||||
#custom-gamemode { color: @yellow; }
|
||||
#custom-gamemode.active { color: @red; border-color: @red; }
|
||||
|
||||
/* --- Right Bottom Controls --- */
|
||||
#custom-disk-root { color: @sky; }
|
||||
#custom-volume { color: @mauve; }
|
||||
#custom-mic { color: @flamingo; }
|
||||
#custom-volume.muted, #custom-mic.muted { color: @overlay0; }
|
||||
|
||||
#backlight {
|
||||
color: @mauve;
|
||||
}
|
||||
|
||||
#wireplumber.muted {
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
#custom-audio-output.unmuted, #wireplumber {
|
||||
color: @mauve;
|
||||
border-bottom: 3px solid @mauve;
|
||||
}
|
||||
|
||||
#clock {
|
||||
color: @mauve;
|
||||
}
|
||||
|
||||
#network {
|
||||
}
|
||||
#custom-bluetooth-audio { color: @blue; }
|
||||
|
||||
/* --- Tooltip --- */
|
||||
tooltip {
|
||||
border-radius: 10px;
|
||||
padding: 9px;
|
||||
background-color: @base;
|
||||
background-color: alpha(@base, 0.95);
|
||||
border: 1px solid @surface1;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
tooltip label {
|
||||
padding: 5px;
|
||||
background-color: @base;
|
||||
color: @text;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user