commit c6e4ef543593887fbd63632f5d31aa6140fc8166 Author: Viyurz <128215328+Viyurz@users.noreply.github.com> Date: Tue Sep 26 17:12:28 2023 +0200 First commit diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf new file mode 100644 index 0000000..c09232a --- /dev/null +++ b/.config/hypr/hyprland.conf @@ -0,0 +1,151 @@ +# Jaaj Hyprland config + +# Source colors variables +source = ~/.config/hypr/colors.conf + + + +# Monitors config in separate file to allow multiple configs +source = ~/.config/hypr/monitors.conf + + + +# Exec once +exec-once = artix-pipewire-launcher +exec-once = nm-applet +exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 +exec-once = $HOME/.scripts/swayidle.sh +exec-once = swayosd-server + +# XWayland +exec-once = xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2 + +# Clipboard +exec-once = wl-paste -w wl-copy -p +exec-once = cliphist wipe && wl-paste --watch cliphist store + +# Discord +exec-once = discord --start-minimized +# exec-once = xwaylandvideobridge + +# Nextcloud +exec-once = nextcloud --background +exec-once = gnome-keyring-daemon -s -f + +# Theming +exec-once = echo 1 > "$HOME/.cache/weeb-mode" +exec-once = sw -r + +# Prevent hidden Wine System Tray window from keeping workspace existing +exec-once = $HOME/.scripts/kill-wine-explorer.sh + + + +# Environement variables +env = EDITOR,vim +env = XDG_CURRENT_DESKTOP,Hyprland +env = XDG_SESSION_TYPE,wayland +env = XDG_SESSION_DESKTOP,Hyprland +env = QT_AUTO_SCREEN_SCALE_FACTOR,1 +env = QT_QPA_PLATFORM,wayland;xcb +env = SDL_VIDEODRIVER,wayland +env = _JAVA_AWT_WM_NONEREPARENTING,1 +env = CLUTTER_BACKEND,wayland +env = GRIM_DEFAULT_DIR,$HOME/Images/grim-screenshots +env = DXVK_LOG_LEVEL,none +env = MOZ_ENABLE_WAYLAND,1 +env = GDK_BACKEND,wayland +env = GDK_SCALE,1 +env = XCURSOR_SIZE,24 + + + +# Variables +general { + border_size = $border_size + gaps_in = $gaps_in + gaps_out = $gaps_out + col.active_border = $accent1 $accent2 45deg + col.inactive_border = $background1 $background2 45deg +} + +input { + kb_layout = fr + kb_variant = latin9 + numlock_by_default = true + sensitivity = 0 # -1.0 - 1.0, 0 means no modification. + follow_mouse = 2 + float_switch_override_focus = 0 + touchpad { + disable_while_typing = false + natural_scroll = yes + } +} + +device:asus-rog-sica { + sensitivity = -0.55 +} + +device:logitech-g203-lightsync-gaming-mouse { + sensitivity = -0.55 +} + + +decoration { + rounding = $border_radius + active_opacity = 0.85 + inactive_opacity = 0.65 + blur { + enabled = true + size = 2 + passes = 1 + ignore_opacity = true + new_optimizations = on + xray = true + } +} + +animations { + enabled = yes + # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + bezier = myBezier, 0.05, 0.9, 0.1, 1.05 + animation = windows, 1, 7, myBezier + animation = windowsOut, 1, 7, default, popin 80% + animation = border, 1, 10, default + animation = fade, 1, 7, default + animation = workspaces, 1, 6, default +} + +gestures { + workspace_swipe = on +} + +dwindle { + # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more + pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = yes # you probably want this +} + +master { + # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more + new_is_master = true +} + +misc { + vfr = true + vrr = 2 + disable_autoreload = true + mouse_move_enables_dpms = true + key_press_enables_dpms = true + disable_hyprland_logo = true +} + + + +# Keybindings +source = ~/.config/hypr/keybindings.conf + + + +# Window rules +source = ~/.config/hypr/windowrules.conf diff --git a/.config/hypr/keybindings.conf b/.config/hypr/keybindings.conf new file mode 100644 index 0000000..4bda679 --- /dev/null +++ b/.config/hypr/keybindings.conf @@ -0,0 +1,88 @@ +$mainMod = SUPER + +binde = $mainMod_SHIFT, Q, killactive, +bind = $mainMod_SHIFT, E, exec, wlogout -b 4 -T 400 -B 400 -p layer-shell +binde = $mainMod_SHIFT, Space, togglefloating, +binde = $mainMod, P, pseudo, +binde = $mainMod_SHIFT, V, togglesplit, +bind = $mainMod, L, exec, $HOME/.scripts/swaylock.sh +bind = $mainMod, F, fullscreen + +bind = $mainMod_SHIFT, N, exec, swaync-client -t -sw +bind = $mainMod, R, exec, wofi --show run +bind = $mainMod, E, exec, thunar +binde = $mainMod_SHIFT, T, exec, kitty +bind = $mainMod_SHIFT, F, exec, firefox +bind = $mainMod_SHIFT, D, exec, discord +bind = , 107, exec, $HOME/.scripts/grim.sh screen +bind = ALT_L, 107, exec, $HOME/.scripts/grim.sh window +bind = CONTROL_L, 107, exec, $HOME/.scripts/grim.sh region +bind = $mainMod, V, exec, cliphist list | wofi --show dmenu | cliphist decode | wl-copy -n + +# Move focus with mainMod + arrow keys +bind = $mainMod, left, movefocus, l +bind = $mainMod, right, movefocus, r +bind = $mainMod, up, movefocus, u +bind = $mainMod, down, movefocus, d + +bind = $mainMod_SHIFT, left, movewindow, l +bind = $mainMod_SHIFT, right, movewindow, r +bind = $mainMod_SHIFT, up, movewindow, u +bind = $mainMod_SHIFT, down, movewindow, d + +# Switch workspaces with mainMod + [0-9] +bind = $mainMod, ampersand, workspace, 1 +bind = $mainMod, eacute, workspace, 2 +bind = $mainMod, quotedbl, workspace, 3 +bind = $mainMod, apostrophe, workspace, 4 +bind = $mainMod, parenleft, workspace, 5 +bind = $mainMod, minus, workspace, 6 +bind = $mainMod, egrave, workspace, 7 +bind = $mainMod, underscore, workspace, 8 +bind = $mainMod, ccedilla, workspace, 9 +bind = $mainMod, agrave, workspace, 10 + +# Move active window to a workspace with mainMod + SHIFT + [0-9] +bind = $mainMod SHIFT, ampersand, movetoworkspace, 1 +bind = $mainMod SHIFT, eacute, movetoworkspace, 2 +bind = $mainMod SHIFT, quotedbl, movetoworkspace, 3 +bind = $mainMod SHIFT, apostrophe, movetoworkspace, 4 +bind = $mainMod SHIFT, parenleft, movetoworkspace, 5 +bind = $mainMod SHIFT, minus, movetoworkspace, 6 +bind = $mainMod SHIFT, egrave, movetoworkspace, 7 +bind = $mainMod SHIFT, underscore, movetoworkspace, 8 +bind = $mainMod SHIFT, ccedilla, movetoworkspace, 9 +bind = $mainMod SHIFT, agrave, movetoworkspace, 10 + +# Scroll through existing workspaces with mainMod + scroll +bind = $mainMod, mouse_down, workspace, e+1 +bind = $mainMod, mouse_up, workspace, e-1 +# Same with ALT + TAB +bind = ALT, TAB, workspace, e+1 +bind = ALT_SHIFT, TAB, workspace, e-1 + +# Move/resize windows with mainMod + LMB/RMB and dragging +bindm = $mainMod, mouse:272, movewindow +bindm = $mainMod, mouse:273, resizewindow + +# Swayosd Audio/Brightness/Caps Lock +bindl = , Caps_Lock, exec, swayosd-client --caps-lock +binde = , XF86AudioRaiseVolume, exec, swayosd-client --output-volume=raise +binde = , XF86AudioLowerVolume, exec, swayosd-client --output-volume=lower +binde = , XF86AudioMute, exec, swayosd-client --output-volume=mute-toggle +binde = , XF86AudioMicMute, exec, swayosd-client --input-volume=mute-toggle +bindel = , XF86MonBrightnessUp, exec, swayosd-client --brightness raise +bindel = , XF86MonBrightnessDown, exec, swayosd-client --brightness lower + +# Media keys +bindl = , XF86AudioPlay, exec, playerctl play-pause +bindl = , XF86AudioNext, exec, playerctl next +bindl = , XF86AudioPrev, exec, playerctl previous + +# Foobar2000 +bind = CTRL, P, exec, $HOME/.scripts/foobar2000.sh -pp +bind = CTRL, up, exec, $HOME/.scripts/foobar2000.sh -vu +bind = CTRL, down, exec, $HOME/.scripts/foobar2000.sh -vd + +# Weeb mode +bind = $mainMod SHIFT, W, exec, $HOME/.scripts/toggle-weeb-mode.sh diff --git a/.config/hypr/monitors.conf b/.config/hypr/monitors.conf new file mode 100644 index 0000000..20dc64d --- /dev/null +++ b/.config/hypr/monitors.conf @@ -0,0 +1,18 @@ +# Laptop config +monitor = eDP-1, 1920x1080@60, 0x0, 1 +monitor = , preferred, auto, 1, mirror, eDP-1 + +workspace = 1, monitor:eDP-1, default:true +workspace = 2, monitor:eDP-1 +workspace = 3, monitor:eDP-1 +workspace = 4, monitor:eDP-1 + +# Desktop config +# monitor = DP-1, 1920x1080@165, 0x0, 1 +# monitor = HDMI-A-1, preferred, 1920x0, 1 +# monitor = , preferred, auto, 1 + +# workspace = 1, monitor:DP-1, default:true +# workspace = 2, monitor:DP-1 +# workspace = 3, monitor:DP-1 +# workspace = 4, monitor:DP-1 diff --git a/.config/hypr/windowrules.conf b/.config/hypr/windowrules.conf new file mode 100644 index 0000000..ff2d601 --- /dev/null +++ b/.config/hypr/windowrules.conf @@ -0,0 +1,75 @@ +# Opaque windows +windowrule = opaque,^(firefox|libreoffice-writer)$ + +# Idle Inhibit +windowrule = idleinhibit focus, class:^(vlc)$ +windowrule = idleinhibit focus, class:^(zoom)$ + +# Foobar2000 +windowrule = float,^(foobar2000.exe)$ +windowrule = size 1024 576,^(foobar2000.exe)$ +windowrulev2 = size 740 516,class:^(foobar2000.exe)$,title:^(Preferences:) +windowrulev2 = size 575,115,class:^(foobar2000.exe)$,title:^(Processing...)$ +windowrulev2 = size 660 440,class:^(foobar2000.exe)$,title:^(Playlist Search) +windowrulev2 = center,class:^(foobar2000.exe)$,title:^(Playlist Search) + +# Firefox/NetworkManager +windowrule = float,title:^(Firefox - Choose User Profile)$ +windowrule = float,^(nm-connection-editor)$ + +# Winecfg +windowrule = float,^(winecfg.exe)$ +windowrulev2 = size 410 462,class:^(winecfg.exe)$,xwayland:1 +windowrulev2 = size 415 487,class:^(winecfg.exe)$,xwayland:0 +# Hide Wine System Tray +#windowrule = workspace 1,title:^(Wine System Tray)$ +windowrule = float,title:^(Wine System Tray)$ +windowrule = move -5 -5,title:^(Wine System Tray)$ +windowrule = size 0 0,title:^(Wine System Tray)$ +windowrule = nofocus,title:^(Wine System Tray)$ +windowrule = noinitialfocus,title:^(Wine System Tray)$ + + +# Hide xwaylandvideobridge window +windowrulev2 = move -5 -5,class:^(xwaylandvideobridge)$ +windowrulev2 = size 0 0,class:^(xwaylandvideobridge)$ +windowrulev2 = nofocus,class:^(xwaylandvideobridge)$ +windowrulev2 = noinitialfocus,class:^(xwaylandvideobridge)$ + + +# Gamescope +windowrule = nofullscreenrequest,title:^(gamescope) +windowrule = forceinput,^(gamescope) + + +# Riot Client +windowrule = size 1536 864,title:^(Riot Client Main)$ +windowrule = move 192 108,title:^(Riot Client Main)$ +windowrule = float,title:^(Riot Client Main) +windowrule = forceinput,title:^(Riot Client Main) + +# LoL Client +windowrule = size 1280 720,title:^(League of Legends) +windowrule = float,title:^(League of Legends) +windowrule = center,title:^(League of Legends) +windowrule = forceinput,title:^(League of Legends) + +# LoL +windowrule = float,title:^(League of Legends (TM) Client) +windowrule = size 1920 1080,^(League of Legends (TM) Client) +windowrule = fullscreen,^(League of Legends (TM) Client) +windowrule = forceinput,^(League of Legends (TM) Client) + + + +# Ubisoft Connect +windowrule = float,^(upc.exe)$ + + +# Genshin Impact +windowrule = float,title:^(Genshin Impact)$ + + +# Warframe +windowrulev2 = float,class:^(launcher.exe)$,title:^(Warframe)$ +windowrule = fullscreen,^(warframe.x64.exe)$ diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf new file mode 100644 index 0000000..7687b39 --- /dev/null +++ b/.config/kitty/kitty.conf @@ -0,0 +1,99 @@ +# https://sw.kovidgoyal.net/kitty/conf/ + +# Fonts +font_family 'JetBrainsMono Nerd Font' +bold_font auto +italic_font auto +bold_italic_font auto + +font_size 11 + + + +# Cursor +cursor_shape beam +cursor_beam_thickness 1 + + + +# Mouse +mouse_hide_wait 0 + +url_color #eca37a +url_style single + +show_hyperlink_target yes + +strip_trailing_spaces always + +# select_by_word_characters @-./_~?&=%+# + +focus_follows_mouse no + +pointer_shape_when_grabbed hand + +default_pointer_shape arrow + +pointer_shape_when_dragging beam + + + +# Performance tuning +repaint_delay 10 +input_delay 3 +sync_to_monitor no + + + +# Terminal bell +enable_audio_bell no +visual_bell_duration 0.0 +window_alert_on_bell no + + + +# Window layout +remember_window_size no +initial_window_width 960 +initial_window_height 540 + +window_border_width 0 + +window_padding_width 0 6 + + + +# Tab bar +tab_bar_edge top + +tab_bar_style powerline + +tab_bar_align left + +tab_bar_min_tabs 2 + +tab_switch_strategy previous + +tab_powerline_style angled + +tab_activity_symbol (!) +tab_title_template "{index}{activity_symbol}: {title.replace('proxzima@proxzima:', '')}" + +tab_bar_background #59290d + +active_tab_foreground #f0e6de +active_tab_background #9c4716 +active_tab_font_style bold-italic + +inactive_tab_foreground #f0e6de +inactive_tab_background #703310 +inactive_tab_font_style normal + + + +# Keyboard shortcuts +# Don't intercept the following key strokes to make zsh-shift-select work. +map ctrl+shift+left no_op +map ctrl+shift+right no_op +map ctrl+shift+home no_op +map ctrl+shift+end no_op diff --git a/.config/pulse/default.pa b/.config/pulse/default.pa new file mode 100644 index 0000000..2d46430 --- /dev/null +++ b/.config/pulse/default.pa @@ -0,0 +1 @@ +load-module module-switch-on-connect diff --git a/.config/swaync/config.json b/.config/swaync/config.json new file mode 100644 index 0000000..aaf71b2 --- /dev/null +++ b/.config/swaync/config.json @@ -0,0 +1,60 @@ +{ + "$schema": "/etc/xdg/swaync/configSchema.json", + "positionX": "right", + "positionY": "top", + "layer": "top", + "cssPriority": "application", + "control-center-margin-top": 0, + "control-center-margin-bottom": 0, + "control-center-margin-right": 0, + "control-center-margin-left": 0, + "notification-icon-size": 64, + "notification-body-image-height": 100, + "notification-body-image-width": 200, + "timeout": 10, + "timeout-low": 5, + "timeout-critical": 0, + "fit-to-screen": true, + "control-center-width": 500, + "control-center-height": 600, + "notification-window-width": 500, + "keyboard-shortcuts": true, + "image-visibility": "when-available", + "transition-time": 200, + "hide-on-clear": false, + "hide-on-action": true, + "script-fail-notify": true, + "scripts": { + "example-script": { + "exec": "echo 'Do something...'", + "urgency": "Normal" + } + }, + "notification-visibility": { + "example-name": { + "state": "muted", + "urgency": "Low", + "app-name": "Spotify" + } + }, + "widgets": [ + "title", + "dnd", + "notifications", + "mpris" + ], + "widget-config": { + "title": { + "text": "Notifications", + "clear-all-button": true, + "button-text": "Clear All" + }, + "dnd": { + "text": "Do Not Disturb" + }, + "mpris": { + "image-size": 96, + "image-radius": 12 + } + } +} diff --git a/.config/swaync/style.css b/.config/swaync/style.css new file mode 100644 index 0000000..736e38d --- /dev/null +++ b/.config/swaync/style.css @@ -0,0 +1,215 @@ +@import url('file:///home/viyurz/.config/gtk-3.0/colors-gtk.css'); + +* { + font-family: "Cantarell"; + color: @foreground; +} + +.blank-window { + background: transparent; +} + +.notification-row { + outline: none; +} + +.notification-row:focus, +.notification-row:hover { + background: @hovered; +} + +.notification, .control-center { + border: 2px solid transparent; + border-radius: 4px; + margin: 30px; + background-image: linear-gradient(160deg, @background1, @background2), linear-gradient(160deg, @accent1, @accent2); + background-clip: padding-box, border-box; + background-origin: border-box; + box-shadow: none; +} + +.widget-title, +.widget-dnd, +.control-center .notification { + margin: 10px; +} + +.notification-default-action, +.notification-action { + padding: 0; + margin: 0; + box-shadow: none; + background: transparent; + border: none; + border-radius: 0px; +} + +.notification-default-action:hover, +.notification-action:hover { + /*-gtk-icon-effect: none;*/ + background-image: linear-gradient(160deg, @hovered, @hovered), linear-gradient(160deg, @accent1, @accent2); +} + +.notification-content { + background: transparent; + padding: 6px; +} + +/* Uncomment to enable specific urgency colors +.low { + background: yellow; + padding: 6px; + border-radius: 12px; +} + +.normal { + background: green; + padding: 6px; + border-radius: 12px; +} + +.critical { + background: red; + padding: 6px; + border-radius: 12px; +} +*/ + + +.close-button { + background: transparent; + text-shadow: none; + padding: 0; + border-radius: 100%; + margin: 32px; + box-shadow: none; + border: none; + min-width: 24px; + min-height: 24px; +} + +.close-button:hover { + box-shadow: none; + background-color: @bad; + transition: all 0.15s ease-in-out; + border: none; +} + +/* When alternative actions are visible */ +.notification-default-action:not(:only-child) { + border-bottom-left-radius: 0px; + border-bottom-right-radius: 0px; +} + +/* add bottom border radius to eliminate clipping */ +.notification-action:first-child { + border-bottom-left-radius: 10px; +} + +.notification-action:last-child { + border-bottom-right-radius: 10px; + border-right: 1px solid @noti-border-color; +} + +.image { +} + +.body-image { + margin-top: 6px; + background-color: white; + border-radius: 12px; +} + +.summary { + font-size: 16px; + font-weight: bold; + background: transparent; + text-shadow: none; +} + +.time { + font-size: 16px; + font-weight: bold; + background: transparent; + text-shadow: none; +} + +.body { + font-size: 15px; + font-weight: normal; + background: transparent; + text-shadow: none; +} + +/* The "Notifications" and "Do Not Disturb" text widget */ +.top-action-title { + text-shadow: none; +} + +.control-center-list { + background: transparent; +} + +.floating-notifications { + background: transparent; +} + +/*** Widgets ***/ + +/* Title widget */ +.widget-title { + font-size: 1.5rem; +} + +.widget-title > button { + font-size: initial; + text-shadow: none; + border: 2px solid transparent; + border-radius: 4px; + background-image: linear-gradient(160deg, @background1, @background2), linear-gradient(160deg, @accent1, @accent2); + background-clip: padding-box, border-box; + background-origin: border-box; + box-shadow: none; +} + +.widget-title > button:hover { + background-image: linear-gradient(160deg, @selected, @selected), linear-gradient(160deg, @accent1, @accent2); +} + +/* DND widget */ +.widget-dnd > switch { + border: 2px solid transparent; + border-radius: 16px; + background-image: linear-gradient(160deg, @background1, @background2), linear-gradient(160deg, @accent1, @accent2); + background-clip: padding-box, border-box; + background-origin: border-box; + box-shadow: none; +} + +.widget-dnd > switch:checked { + background-image: linear-gradient(160deg, @selected, @selected), linear-gradient(160deg, @accent1, @accent2); +} + +.widget-dnd > switch slider { + background-color: alpha(@disabled, 0.5); +} + +.widget-dnd > switch:checked slider { + background-color: alpha(@accent1, 0.5); +} + +/* Mpris widget */ +.widget-mpris { + /* The parent to all players */ +} +.widget-mpris-player { + padding: 8px; + margin: 8px; +} +.widget-mpris-title { + font-weight: bold; + font-size: 1.25rem; +} +.widget-mpris-subtitle { + font-size: 1.1rem; +} diff --git a/.config/waybar/bluetooth_toggle_power.sh b/.config/waybar/bluetooth_toggle_power.sh new file mode 100755 index 0000000..68c9d89 --- /dev/null +++ b/.config/waybar/bluetooth_toggle_power.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +if [[ $(bluetoothctl show | grep Powered: | cut -f 2 -d ' ') == "no" ]]; then + if [[ ! $(bluetoothctl power on) ]]; then + rfkill block bluetooth + rfkill unblock bluetooth + fi +else + bluetoothctl power off +fi diff --git a/.config/waybar/config b/.config/waybar/config new file mode 100644 index 0000000..baa9421 --- /dev/null +++ b/.config/waybar/config @@ -0,0 +1,200 @@ +{ + "layer": "top", // Waybar at top layer + // "position": "top", // Waybar position (top|bottom|left|right) + // "height": 30, // Waybar height (to be removed for auto height) + "modules-left": [ + "hyprland/workspaces", + "tray", + "network", + "bluetooth", + "pulseaudio#output", + "pulseaudio#input", + "mpris" + ], + "modules-right": [ + "hyprland/window", + "backlight", + "battery", + "custom/gpu-temp", + "custom/gpu-usage", + "memory", + "custom/cpu-temp", + "cpu", + "clock" + ], + + "hyprland/workspaces": { + "disable-scroll": true, + "all-outputs": false, + "on-click": "activate", + "format": "{name}" + }, + "tray": { + // "icon-size": 21, + "spacing": 8 + }, + "network": { + // "interface": "wlp2*", // (Optional) To force the use of this interface + "interval": 5, + "format-wifi": "󰖩 {essid} ({frequency}GHz) 󰜮 {bandwidthDownBytes} 󰜷 {bandwidthUpBytes}", + "format-ethernet": "󰛳 󰜮 {bandwidthDownBytes} 󰜷 {bandwidthUpBytes}", + "tooltip-format-wifi": "{essid} ({signalStrength}%) - {frequency}GHz\n󰜮 {bandwidthDownBytes} | 󰜷 {bandwidthUpBytes}", + "tooltip-format-ethernet": "{ipaddr}/{cidr}\n󰜮 {bandwidthDownBytes} | 󰜷 {bandwidthUpBytes}", + "format-linked": "󰲛 {ifname} (No IP)", + "format-disconnected": "󰲛 Disconnected", + "on-click-right": "nm-connection-editor" + }, + "bluetooth": { + "format": "", + "format-connected": " {device_alias}", + "format-connected-battery": " {device_alias} {device_battery_percentage}%", + // "format-device-preference": [ "device1", "device2" ], // preference list deciding the displayed device + "tooltip-format": "{controller_alias} ({controller_address})\n{num_connections} connected", + "tooltip-format-connected": "{controller_alias} ({controller_address})\n{num_connections} connected\n\n{device_enumerate}", + "tooltip-format-enumerate-connected": "{device_alias} {device_address}", + "tooltip-format-enumerate-connected-battery": "{device_alias} {device_address} {device_battery_percentage}%", + "on-click": "$HOME/.config/waybar/bluetooth_toggle_power.sh", + "on-click-right": "blueman-manager" + }, + "pulseaudio#output": { + "on-click": "swayosd-client --output-volume=mute-toggle", + "on-click-right": "pavucontrol", + "on-scroll-up": "swayosd-client --output-volume=raise", + "on-scroll-down": "swayosd-client --output-volume=lower", + "scroll-step": 5, + "smooth-scrolling-threshold": 1, + "format": "{icon} {volume}%", + "format-muted": "󰝟 {volume}%", + "format-bluetooth": "(){icon} {volume}%", + "format-bluetooth-muted": "()󰝟 {volume}%", + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["󰕿", "󰖀", "󰕾"] + } + }, + "pulseaudio#input": { + "on-click": "swayosd-client --input-volume=mute-toggle", + "on-click-right": "pavucontrol", + "on-scroll-up": "swayosd-client --input-volume=raise", + "on-scroll-down": "swayosd-client --input-volume=lower", + "scroll-step": 5, + "smooth-scrolling-threshold": 1, + "format": "{format_source}", + "format-muted": "{format_source}", + "format-bluetooth": "(){format_source}", + "format-bluetooth-muted": "(){format_source}", + "format-source": "󰍬 {volume}%", + "format-source-muted": "󰍭 {volume}%" + }, + "mpris": { + "format": " {status_icon} {title}", + "player": "beefweb", + "ignored-players": ["firefox"], + "status-icons": { + "playing": "", + "paused": "󰏥", + "stopped": "" + }, + "max-length": 35 + }, + "hyprland/window" : { + "format": "{}", + "separate-outputs": true, + "max-length": 35 + }, + "backlight": { + "on-scroll-up": "swayosd-client --brightness=raise", + "on-scroll-down": "swayosd-client --brightness=lower", + "format": "{icon} {percent}%", + "format-icons": ["", "", "", "", "", "", "", "", ""], + "scroll-step": 5, + "smooth-scrolling-threshold": 1 + }, + "battery": { + "interval": 15, + "states": { + "100": 100, + "90": 90, + "80": 80, + "70": 70, + "60": 60, + "50": 50, + "40": 40, + "30": 30, + "20": 20, + "10": 10 + }, + "format-time": "{H}:{m}", + "format": "{icon} {capacity}% ({time})", + "format-icons": ["󰂎", "󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"], + "format-plugged": "󰂄 {capacity}%", + "format-charging-100": "󰂅 {capacity}% ({time})", + "format-charging-90": "󰂋 {capacity}% ({time})", + "format-charging-80": "󰂊 {capacity}% ({time})", + "format-charging-70": "󰢞 {capacity}% ({time})", + "format-charging-60": "󰂉 {capacity}% ({time})", + "format-charging-50": "󰢝 {capacity}% ({time})", + "format-charging-40": "󰂈 {capacity}% ({time})", + "format-charging-30": "󰂇 {capacity}% ({time})", + "format-charging-20": "󰂆 {capacity}% ({time})", + "format-charging-10": "󰢜 {capacity}% ({time})", + "tooltip-format": "{timeTo}\nPower draw: {power}W" + }, + "custom/gpu-temp": { + "exec": "$HOME/.scripts/waybar-gpu-temp.sh", + "interval": 5, + "return-type": "json", + "format": "{icon} {}", + "format-icons": { + "low": "󱃃", + "normal": "󰔏", + "high": "󰔏", + "alert": "󰸁" + } + }, + "custom/gpu-usage": { + "exec": "$HOME/.scripts/waybar-gpu-usage.sh", + "return-type": "json", + "format": "󰢮 {}", + "interval" : 5 + }, + "memory": { + "format": " {used}GiB", + "interval": 5 + }, + "custom/cpu-temp": { + "exec": "$HOME/.scripts/waybar-cpu-temp.sh", + "interval": 5, + "return-type": "json", + "format": "{icon} {}", + "format-icons": { + "low": "󱃃", + "normal": "󰔏", + "high": "󰔏", + "alert": "󰸁" + } + }, + "cpu": { + "format": " {usage}%", + "interval": 5 + }, + "clock": { + "interval": 1, + "format": "󰥔 {:%X}", + "tooltip-format": "{calendar}", + "calendar": { + "mode": "month", + "format": { + "months": "{}", + "days": "{}", + "weekdays": "{}", + "today": "{}" + } + } + } +} diff --git a/.config/waybar/style.css b/.config/waybar/style.css new file mode 100644 index 0000000..bdb1994 --- /dev/null +++ b/.config/waybar/style.css @@ -0,0 +1,129 @@ +@import url("file:///home/viyurz/.config/gtk-3.0/colors-gtk.css"); + +* { + font-family: 'JetBrainsMono Nerd Font'; + font-size: 13px; +} + +#waybar { + background-image: linear-gradient(160deg, @background1, @background2), linear-gradient(160deg, @accent1, @accent2); + background-clip: padding-box, border-box; + background-origin: border-box; + border-bottom: 2px solid transparent; + border-radius: 0; +} + +.modules-left, .modules-center, .modules-right { + margin-bottom: 2px; + color: @foreground; +} + +#workspaces button { + box-shadow: none; + border: none; + border-radius: 0; +} + +#workspaces button:hover { + background-color: @hovered; +} + +#workspaces button.active { + background-color: @selected; +} + +#workspaces button.urgent { + background-color: @urgent; +} + +#tray > .passive { + -gtk-icon-effect: dim; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: @urgent; +} + +#button, +#tray, +#network, +#bluetooth, +#pulseaudio, +#custom-media, +#window, +#backlight, +#battery, +#custom-gpu-temp, +#custom-gpu-usage, +#memory, +#custom-cpu-temp, +#cpu, +#clock { + padding: 2px 8px; +} + +/* +.modules-left { + color: @accent1; +} + + .modules-right { + color: @accent2; +} +*/ + +#pulseaudio, +#backlight, +#custom-gpu-temp, +#custom-gpu-usage, +#custom-cpu-temp, +#cpu { + color: @accent1; +} + +#network, +#bluetooth, +#mpris, +#battery, +#memory, +#clock { + color: @accent2; +} + +#pulseaudio.output.muted, +#pulseaudio.input.source-muted { + color: @disabled; +} + +#network.disabled, #network.disconnected, +#bluetooth.disabled, #bluetooth.off { + color: @disabled2; +} + +#battery.charging { + background-color: alpha(@good, 0.33); +} + +#battery.30:not(.charging), +#custom-temp-gpu.high, +#custom-temp-cpu.high { + background-color: alpha(@bad, 0.33); +} + +#battery.20:not(.charging), +#battery.10:not(.charging), +#custom-temp-gpu.alert, +#custom-temp-cpu.alert { + background-color: alpha(@bad, 0.5); + animation-name: blink; + animation-duration: 1.5s; + animation-timing-function: steps(2, start); + animation-iteration-count: infinite; +} + +@keyframes blink { + to { + background-color: transparent; + } +} diff --git a/.config/wlogout/layout b/.config/wlogout/layout new file mode 100644 index 0000000..2de5285 --- /dev/null +++ b/.config/wlogout/layout @@ -0,0 +1,24 @@ +{ + "label" : "lock", + "action" : "~/.config/hypr/swaylock", + "text" : "Lock", + "keybind" : "l" +} +{ + "label" : "logout", + "action" : "hyprctl dispatch exit --", + "text" : "Logout", + "keybind" : "e" +} +{ + "label" : "shutdown", + "action" : "sudo poweroff", + "text" : "Shutdown", + "keybind" : "s" +} +{ + "label" : "reboot", + "action" : "sudo reboot", + "text" : "Reboot", + "keybind" : "r" +} diff --git a/.config/wlogout/lock-focus.png b/.config/wlogout/lock-focus.png new file mode 100644 index 0000000..4fead94 Binary files /dev/null and b/.config/wlogout/lock-focus.png differ diff --git a/.config/wlogout/lock.png b/.config/wlogout/lock.png new file mode 100644 index 0000000..a313e58 Binary files /dev/null and b/.config/wlogout/lock.png differ diff --git a/.config/wlogout/logout-focus.png b/.config/wlogout/logout-focus.png new file mode 100644 index 0000000..f879af7 Binary files /dev/null and b/.config/wlogout/logout-focus.png differ diff --git a/.config/wlogout/logout.png b/.config/wlogout/logout.png new file mode 100644 index 0000000..94bb6a5 Binary files /dev/null and b/.config/wlogout/logout.png differ diff --git a/.config/wlogout/reboot-focus.png b/.config/wlogout/reboot-focus.png new file mode 100644 index 0000000..7076d03 Binary files /dev/null and b/.config/wlogout/reboot-focus.png differ diff --git a/.config/wlogout/reboot.png b/.config/wlogout/reboot.png new file mode 100644 index 0000000..82f4dd5 Binary files /dev/null and b/.config/wlogout/reboot.png differ diff --git a/.config/wlogout/shutdown-focus.png b/.config/wlogout/shutdown-focus.png new file mode 100644 index 0000000..4c5f004 Binary files /dev/null and b/.config/wlogout/shutdown-focus.png differ diff --git a/.config/wlogout/shutdown.png b/.config/wlogout/shutdown.png new file mode 100644 index 0000000..3d8e4fd Binary files /dev/null and b/.config/wlogout/shutdown.png differ diff --git a/.config/wlogout/style.css b/.config/wlogout/style.css new file mode 100644 index 0000000..8f969bc --- /dev/null +++ b/.config/wlogout/style.css @@ -0,0 +1,63 @@ +@import url("file:///home/viyurz/.config/gtk-3.0/colors-gtk.css"); + +* { + background-image: none; +} + +window { + background-color: rgba(12, 12, 12, 0.5); +} + +button { + font-family: "Hack Nerd Font"; + font-size: 13pt; + color: @foreground; + margin: 5px; + background-repeat: no-repeat; + background-position: center; + background-size: 25%; + background-color: transparent; + border: 2px solid transparent; + border-radius: 16px; + box-shadow: none +} + +button:hover { + background-color: alpha(@foreground, 0.25); +} + +button:focus, button:active { + background-color: alpha(@foreground, 0.5); +} + +#lock { + background-image: image(url("./lock.png")); +} + +#lock:focus, #lock:active { + background-image: image(url("./lock-focus.png")); +} + +#logout { + background-image: image(url("./logout.png")); +} + +#logout:focus, #logout:active { + background-image: image(url("./logout-focus.png")); +} + +#shutdown { + background-image: image(url("./shutdown.png")); +} + +#shutdown:focus, #shutdown:active { + background-image: image(url("./shutdown-focus.png")); +} + +#reboot { + background-image: image(url("./reboot.png")); +} + +#reboot:focus, #reboot:active { + background-image: image(url("./reboot-focus.png")); +} diff --git a/.config/wofi/style.css b/.config/wofi/style.css new file mode 100644 index 0000000..567cb55 --- /dev/null +++ b/.config/wofi/style.css @@ -0,0 +1,32 @@ +@import url('file:///home/viyurz/.config/gtk-3.0/colors-gtk.css'); + +window { + color: @foreground; + font-family: 'JetBrainsMono Nerd Font'; + background-image: linear-gradient(160deg, @background1, @background2), linear-gradient(160deg, @accent1, @accent2); + background-clip: padding-box, border-box; + background-origin: border-box; + border: 2px solid transparent; + border-radius: 4px; +} + +#scroll { + margin: 5px 7px; + border: none; + outline: none; + background: none; +} + +#input { + margin: 2px; + box-shadow: none; + border-radius: 4px 4px 0 0; + background-color: @hovered; +} + +#entry:selected { + outline: none; + padding-left: 8px; + border-radius: 2px; + background-color: @selected; +} diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 0000000..4357af0 --- /dev/null +++ b/.gitconfig @@ -0,0 +1,15 @@ +[user] + name = Viyurz + username = Viyurz + email = 128215328+Viyurz@users.noreply.github.com + signingkey = /home/viyurz/.ssh/id_ed25519.pub +[init] + defaultBranch = main +[commit] + gpgsign = true +[gpg] + format = ssh +[pull] + rebase = true +[diff] + colorMoved = zebra diff --git a/.local/bin/genshin-impact b/.local/bin/genshin-impact new file mode 100755 index 0000000..71b4eda --- /dev/null +++ b/.local/bin/genshin-impact @@ -0,0 +1,3 @@ +#!/bin/sh + +lutris lutris:rungame/genshin-impact diff --git a/.local/bin/lol b/.local/bin/lol new file mode 100755 index 0000000..b727e28 --- /dev/null +++ b/.local/bin/lol @@ -0,0 +1,9 @@ +#!/bin/sh + +# Note: If running in wayland, switch to borderless windowed to prevent the game window from disappearing + +hyprctl monitors | grep -qe 'HDMI-A-1' && "$HOME/.scripts/lol-watcher.sh" & + +lutris lutris:rungame/league-of-legends + +killall -9 lol-watcher.sh &> /dev/null diff --git a/.local/bin/sw b/.local/bin/sw new file mode 100755 index 0000000..0d45fac --- /dev/null +++ b/.local/bin/sw @@ -0,0 +1,339 @@ +#!/bin/sh + +wp_base_dir="$HOME/Images/Wallpapers/Desktop" +declare -A wp_dirs=([SFW]="$wp_base_dir/SFW" + [NSFW]="$wp_base_dir/( ͡° ͜ʖ ͡°)" + [BONK]="$wp_base_dir/Bonk") + + + +function pick_random_wallpaper { + if [[ ${#wp_opts[@]} -eq 0 ]]; then + target_wp_dirs=("${wp_dirs[SFW]}") + else + for opt in "${!wp_opts[@]}"; do + opt_value=${wp_opts[$opt]} + if [[ $opt_value -eq 1 ]]; then + target_wp_dirs+=("${wp_dirs[$opt]}") + fi + done + fi + + echo "Picking a random wallpaper from ${target_wp_dirs[@]}." + + wallpaper="$(find "${target_wp_dirs[@]}" -type f | shuf -n 1)" + wallpaper="$wallpaper" +} + + + + +function help { + cat <<- EOF + Usage: $(basename "$0") [options...] + + -h, --help Show this message and quit. + -r, --random Change the theme by picking a random wallpaper. + -w, --wallpaper Change the theme using this wallpaper. + -s, --sfw Pick a wallpaper from SFW folder (default). + -n, --nsfw Pick a wallpaper from NSFW folder. + -b, --bonk U horny dog ¬‿¬. + + Options -s and -n can be used together. + If no option is specified, reloads the current theme. + EOF +} + + + +declare -A wp_opts +while getopts "hrw:snb" opt; do + case $opt in + h) + help + exit + ;; + r) + opt_random=1 + ;; + w) + opt_wallpaper=1 + opt_wallpaper_arg="$OPTARG" + ;; + s) + wp_opts[SFW]=1 + ;; + n) + wp_opts[NSFW]=1 + ;; + b) + wp_opts[BONK]=1 + ;; + \?) + echo "Invalid option: $opt." + exit 1 + ;; + esac +done + + + +if [[ $opt_random -eq 1 && $opt_wallpaper -eq 1 ]]; then + echo "Option -r and -w can't be used together." + exit 1 +elif [[ $opt_random -eq 1 ]]; then + pick_random_wallpaper +elif [[ $opt_wallpaper -eq 1 ]]; then + if [[ -f "$opt_wallpaper_arg" ]]; then + wallpaper="$opt_wallpaper_arg" + else + echo "Error: $opt_wallpaper_arg is not a valid path." + exit 1 + fi +else + if [[ $# -gt 0 ]]; then + echo "Warning: Neither -r or -w were specified, ignoring option(s): $*." + fi + # To get the current wallpaper + source "$HOME/.cache/wal/colors.sh" +fi + + + +echo "Selected wallpaper: $wallpaper" +#viu -h 15 "$wallpaper" + + + +# Create the colors scheme +echo "Generating color scheme using pywal." +wal -qni "$wallpaper" --saturate 0.75 + +# Pour si ya un apostrophe dans le nom du fichier +sed -iE "/^wallpaper=/,/#/ s/='/=\"/" /home/viyurz/.cache/wal/colors.sh +sed -iE "/^wallpaper=/,/#/ s/'$/\"/" /home/viyurz/.cache/wal/colors.sh + + + +# Source colors scheme generated +source "$HOME/.cache/wal/colors.sh" + + + +# Set additional colors +accent1_dark_hsl="$(pastel darken 1 "$color5" | pastel format hsl)" +accent2_dark_hsl="$(pastel darken 1 "$color6" | pastel format hsl)" +declare -A colors=( + [foreground]="$foreground" + [good]="#00BB66" + [bad]="#AA2222" + [urgent]="$color4" + [accent1]="$color5" + [accent2]="$color6" + [background1]="$(pastel lighten 0.2 "$accent1_dark_hsl" | pastel format hex)" + [background2]="$(pastel lighten 0.2 "$accent2_dark_hsl" | pastel format hex)" + [hovered]="$(pastel lighten 0.25 "$accent1_dark_hsl" | pastel format hex)" + [selected]="$(pastel lighten 0.35 "$accent1_dark_hsl" | pastel format hex)" + [disabled]="$(pastel lighten 0.35 "$accent1_dark_hsl" | pastel format hex)" + [disabled2]="$(pastel lighten 0.35 "$accent2_dark_hsl" | pastel format hex)" +) + +declare -A params=( + [border_radius]=4 + [border_size]=2 + [gaps_out]=15 + [gaps_in]=8 + [font]="'JetBrainsMono Nerd Font'" +) + +# Display accent colors +pastel color "${colors[accent1]}" +pastel color "${colors[accent2]}" + + + +# Set wallpaper using swaybg +if grep 0 "$HOME/.cache/weeb-mode"; then + wallpaper="/usr/share/hyprland/wall_2K.png" +fi +echo "Setting wallpaper using swaybg." +killall -9 swaybg &> /dev/null +hyprctl dispatch exec "swaybg -i \"$wallpaper\"" > /dev/null + + + +# Clear colors/params files +echo -n '' > "$HOME/.config/gtk-3.0/colors-gtk.css" +echo -n '' > "$HOME/.config/hypr/colors.conf" +echo "wallpaper=\"$wallpaper\"" > "$HOME/.config/hypr/colors.sh" + + + +# Set colors variables in files +echo "Writing colors to .conf/css/sh files." +for key in "${!colors[@]}"; do + value="${colors[$key]}" + # Hyprland + echo '$'"$key=rgb(${value:1})" >> "$HOME/.config/hypr/colors.conf" + # GTK + echo "@define-color $key $value;" >> "$HOME/.config/gtk-3.0/colors-gtk.css" + # Shell + echo "${key}=$value" >> "$HOME/.config/hypr/colors.sh" +done + +# Add Hyprland params +echo "Adding parameters to Hyprland .conf file." +for key in "${!params[@]}"; do + value="${params[$key]}" + echo '$'"$key=$value" >> "$HOME/.config/hypr/colors.conf" +done + +# Reload Hyprland +echo "Reloading Hyprland." +hyprctl reload &> /dev/null + + + +# Set Kitty params +echo "Setting Kitty parameters." +declare -A kitty_vars=( + [font_family]="${params[font]}" + [url_color]="${colors[accent1]}" + [tab_bar_background]="${colors[background1]}" + [active_tab_background]="${colors[selected]}" + [inactive_tab_background]="${colors[hovered]}" + [active_tab_foreground]="${colors[foreground]}" + [inactive_tab_foreground]="${colors[foreground]}" +) +for key in "${!kitty_vars[@]}"; do + value="${kitty_vars[$key]}" + sed -i "s/^$key.*/$key $value/" "$HOME/.config/kitty/kitty.conf" +done +echo "Reloading opened Kitties." +killall -SIGUSR1 kitty &> /dev/null + + + +# Convert CSS to SCSS for eww +# echo "Converting CSS colors file to SCSS for eww." +# cp "$HOME/.config/gtk-3.0/colors-gtk.css" "$HOME/.config/eww/colors.scss" +# sed -i -E 's/^@define-color /$/; s/^\$\S*/&:/' "$HOME/.config/eww/colors.scss" + + + +# Set Waybar params +echo "Setting Waybar parameters." +declare -A waybar_vars=( + [font-family]="${params[font]}" + [border-bottom]="${params[border_size]}px solid transparent" + [margin-bottom]="${params[border_size]}px" +) +for key in "${!waybar_vars[@]}"; do + value="${waybar_vars[$key]}" + sed -i "s~$key:[^;]*~$key: $value~" "$HOME/.config/waybar/style.css" +done + +echo "Reloading Waybar." +if pgrep -x -u "$USER" waybar > /dev/null; then + killall -SIGUSR2 waybar +else + hyprctl dispatch exec waybar > /dev/null +fi + + + +# Set Wofi params +echo "Setting Wofi parameters." +declare -A wofi_vars_window=( + [font-family]="${params[font]}" + [border]="${params[border_size]}px solid transparent" + [border-radius]="${params[border_radius]}px" +) +for key in "${!wofi_vars_window[@]}"; do + value="${wofi_vars_window[$key]}" + sed -i "/^window/,/$key:/ s~$key:[^;]*~$key: $value~" "$HOME/.config/wofi/style.css" +done + +declare -A wofi_vars_input=( + [margin]="${params[border_size]}px" + [border-radius]="${params[border_radius]}px ${params[border_radius]}px 0 0" +) +for key in "${!wofi_vars_input[@]}"; do + value="${wofi_vars_input[$key]}" + sed -i "/^#input/,/$key:/ s~$key:[^;]*~$key: $value~" "$HOME/.config/wofi/style.css" +done + +# Set entry:selected border-radius +sed -i "/^#entry:selected/,/border-radius:/ s/border-radius:[^;]*/border-radius: $(( params[border_radius]/2 ))px/" "$HOME/.config/wofi/style.css" + + + +# Set swaync params +#echo "Setting swaync parameters." +#sed -zi "s/border-radius:[^;]*/border-radius: ${params[border_radius]}px/1" "$HOME/.config/swaync/style.css" +#sed -i "s/border: [0-9]+.*/border: ${params[border_size]}px solid transparent;/" "$HOME/.config/swaync/style.css" +#sed -zi "s/margin:[^;]*/margin: $((params[gaps_out]*2))px/1" "$HOME/.config/swaync/style.css" +#sed -zi "s/margin:[^;]*/margin: ${params[gaps_out]}px/3" "$HOME/.config/swaync/style.css" +#sed -zi "s/border-radius:[^;]*/border-radius: ${params[border_radius]}px/8" "$HOME/.config/swaync/style.css" +echo "Reloading swaync." +if pgrep -x -u "$USER" swaync > /dev/null; then + swaync-client -rs > /dev/null +else + hyprctl dispatch exec swaync > /dev/null +fi + + + +# BetterDiscord +if [[ -x /bin/betterdiscordctl ]]; then + if [[ ! -f "$HOME/.config/BetterDiscord/data/stable/custom.css" ]]; then + echo "Downloading ClearVision theme for BetterDiscord." + mkdir -p "$HOME/.config/BetterDiscord/data/stable" + wget -O "$HOME/.config/BetterDiscord/data/stable/custom.css" "https://betterdiscord.app/Download?id=23" + fi + + echo "Setting BetterDiscord colors." + declare -A bd_vars=( + [main-color]="${colors[accent1]}" + [hover-color]="${colors[accent2]}" + [text-normal]="${colors[foreground]}" + [background-shading]='0%' + [background-overlay]='rgba(0, 0, 0, 0)' + [background-image]="linear-gradient(160deg, ${colors[background1]}, ${colors[background2]})" + ) + for key in "${!bd_vars[@]}"; do + value="${bd_vars[$key]}" + sed -i "s~--$key:[^;]*~--$key: $value~" "$HOME/.config/BetterDiscord/data/stable/custom.css" + done +fi + + + +# Change Wlogout icons color +echo "Changing wlogout icons colors." +wlogout_img=('lock' 'reboot' 'shutdown' 'logout') +for img in "${wlogout_img[@]}"; do + convert "$HOME/.config/wlogout/$img.png" -fill "${colors[accent1]}" -colorize 100 "$HOME/.config/wlogout/$img.png" + convert "$HOME/.config/wlogout/$img-focus.png" -fill "${colors[accent2]}" -colorize 100 "$HOME/.config/wlogout/$img-focus.png" +done + + + +# Reload pywalfox +if pgrep firefox &> /dev/null; then + echo "Reloading pywalfox." + pywalfox update 2> /dev/null +fi + + + +# OpenRGB +if [[ -x /bin/openrgb ]]; then + echo "Setting keyboard colors." + openrgb --noautoconnect -c "${colors[accent1]:1}" > /dev/null +fi + + + +# To use with swaylock +convert "$wallpaper" -blur 0x5 "$HOME/.cache/wallpaper-blurred.jpg" & diff --git a/.scripts/foobar2000.sh b/.scripts/foobar2000.sh new file mode 100755 index 0000000..79e8c5a --- /dev/null +++ b/.scripts/foobar2000.sh @@ -0,0 +1,42 @@ +#!/bin/sh +# Required: foo_runcmd + +export WINEPREFIX="$HOME/.local/share/wineprefixes/foobar2000" +foobar2000_cmd="$HOME/.foobar2000/foobar2000.exe" + + + +function start_foobar2000 { + [[ "$XDG_SESSION_TYPE" == 'wayland' ]] && opt="DISPLAY=" + hyprctl dispatch exec "$opt beefweb_mpris" > /dev/null + while ! pgrep foobar2000.exe &> /dev/null; do + sleep 0.1 + done + foo_runcmd '/runcmd=Playback/Volume/Set to -21 dB' + for ((i = 0 ; i < 10 ; i++)); do + foo_runcmd '/runcmd=Playback/Volume/Down' + done +} + + + +function foo_runcmd { + wine "$foobar2000_cmd" "${@}" &> /dev/null +} + + + +case "$1" in + -vu|volume-up) + foo_runcmd '/runcmd=Playback/Volume/Up';; + -vd|volume-down) + foo_runcmd '/runcmd=Playback/Volume/Down';; + -pp|play-pause) + if ! pgrep foobar2000.exe &> /dev/null; then + start_foobar2000 + fi + foo_runcmd '/playpause';; + *) + echo "Invalid option." + exit 1;; +esac diff --git a/.scripts/grim.sh b/.scripts/grim.sh new file mode 100755 index 0000000..6edd3e7 --- /dev/null +++ b/.scripts/grim.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +usage="Usage: $(basename "$0") screen | window | region" + +if [[ $# -ne 1 ]]; then + echo "$usage" + exit 1 +fi + + +case "$1" in + screen) + grim - | wl-copy + ;; + window) + grim -g "$(hyprctl activewindow -j | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"')" - | wl-copy + ;; + region) + region="$(slurp)" + [[ $? -ne 0 ]] && exit 1 + grim -g "$region" - | wl-copy + ;; + *) + echo "$usage" + exit 1 + ;; +esac + + +img_name="$(date +'%Y-%m-%d_%H-%M-%S'_grim.png)" + +wl-paste -t image > "$GRIM_DEFAULT_DIR/$img_name" + +notify-send "Grim" "Screenshot saved to $img_name" diff --git a/.scripts/kill-wine-explorer.sh b/.scripts/kill-wine-explorer.sh new file mode 100755 index 0000000..c836f4a --- /dev/null +++ b/.scripts/kill-wine-explorer.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +while true; do + killall -9 explorer.exe + sleep 5 +done diff --git a/.scripts/lol-watcher.sh b/.scripts/lol-watcher.sh new file mode 100755 index 0000000..4435044 --- /dev/null +++ b/.scripts/lol-watcher.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# This script + pgrep command +[[ $(pgrep "lol-watcher.sh" | wc -l) -gt 2 ]] && exit 1 + +while true; do + if hyprctl clients | grep -qe 'title: League of Legends (TM) Client'; then + hyprctl monitors | grep -qe 'HDMI-A-1' && hyprctl keyword monitor HDMI-A-1,disable + else + hyprctl monitors | grep -qe 'HDMI-A-1' || hyprctl keyword monitor HDMI-A-1,1920x1080@60,1920x0,1 + fi + sleep 5 +done diff --git a/.scripts/swayidle.sh b/.scripts/swayidle.sh new file mode 100755 index 0000000..6893a68 --- /dev/null +++ b/.scripts/swayidle.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# Edit /etc/elogind/logind.conf and change these lines: +# HandleLidSwitch=suspend -> HandleLidSwitch=lock +# HandleLidSwitchExternalPower=suspend -> HandleLidSwitchExternalPower=lock + +swayidle -w \ + timeout 300 "$HOME/.scripts/swaylock.sh" \ + timeout 360 'hyprctl dispatch dpms off' \ + resume 'hyprctl dispatch dpms on' \ + before-sleep "$HOME/.scripts/swaylock.sh" \ + lock "$HOME/.scripts/swaylock.sh" diff --git a/.scripts/swaylock.sh b/.scripts/swaylock.sh new file mode 100755 index 0000000..b91fb2f --- /dev/null +++ b/.scripts/swaylock.sh @@ -0,0 +1,66 @@ +#!/bin/sh + +source "$HOME/.config/hypr/colors.sh" + +options=( + --daemonize + --font Hack + --indicator-caps-lock + --indicator-radius 100 + --indicator-thickness 7 + --text-color "$foreground" + --text-caps-lock-color "$foreground" + --text-ver-color "$foreground" + --text-wrong-color "$foreground" + --text-clear-color "$disabled" + --ring-color "$accent1" + --ring-caps-lock-color "$accent2" + --ring-ver-color "$good" + --ring-wrong-color "$bad" + --ring-clear-color "$disabled" + --key-hl-color "$foreground" + --bs-hl-color "$disabled" + --caps-lock-key-hl-color "$foreground" + --caps-lock-bs-hl-color "$disabled2" + --separator-color 00000000 + --line-color 00000000 + --line-caps-lock-color 00000000 + --line-ver-color 00000000 + --line-wrong-color 00000000 + --line-clear-color 00000000 + --inside-color 00000000 + --inside-caps-lock-color 00000000 + --inside-ver-color 00000000 + --inside-wrong-color 00000000 + --inside-clear-color 00000000 + --separator-color 00000000 +) + +if swaylock --help 2>&1 | grep -qe '--screenshots'; then + options+=( + --disable-caps-lock-text + --indicator + --clock + --screenshots + --effect-blur 7x5 + --effect-vignette 0.5:0.5 + --grace 0 + --fade-in 0.2 + ) +else + options+=( + --show-failed-attempts + --indicator-idle-visible + --image "$HOME/.cache/wallpaper-blurred.jpg" + ) +fi + +if swaylock -v | grep -q fprintd; then + options+=( + --fingerprint + ) +fi + +swaylock "${options[@]}" + +sw -r diff --git a/.scripts/toggle-weeb-mode.sh b/.scripts/toggle-weeb-mode.sh new file mode 100755 index 0000000..611e613 --- /dev/null +++ b/.scripts/toggle-weeb-mode.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +source "$HOME/.cache/wal/colors.sh" + +if grep -q 1 "$HOME/.cache/weeb-mode"; then + wallpaper='/usr/share/hyprland/wall_2K.png' + echo 0 > "$HOME/.cache/weeb-mode" +else + echo 1 > "$HOME/.cache/weeb-mode" +fi + +killall -9 swaybg +hyprctl dispatch exec "swaybg -i \"$wallpaper\"" > /dev/null diff --git a/.scripts/waybar-cpu-temp.sh b/.scripts/waybar-cpu-temp.sh new file mode 100755 index 0000000..d7035d0 --- /dev/null +++ b/.scripts/waybar-cpu-temp.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +declare -i hwmon_nr=$(( $(cat -n /sys/class/hwmon/hwmon*/name | grep -oP '\d+\s+k10temp' | grep -oP '^\d+') - 1)) + +temp=$(cat /sys/class/hwmon/hwmon$hwmon_nr/temp1_input | cut -c -2) + +if [[ $temp -lt 45 ]]; then + class=low +elif [[ $temp -lt 70 ]]; then + class=normal +elif [[ $temp -lt 80 ]]; then + class=high +else + class=alert +fi + +cat << EOF +{"text": "$temp°C", "alt": "$class", "tooltip": "$temp°C", "class": "$class", "percentage": ""} +EOF diff --git a/.scripts/waybar-gpu-temp.sh b/.scripts/waybar-gpu-temp.sh new file mode 100755 index 0000000..6fe1f66 --- /dev/null +++ b/.scripts/waybar-gpu-temp.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +declare -i hwmon_nr_amd=$(( $(cat -n /sys/class/hwmon/hwmon*/name | grep 'amdgpu' | grep -oP '\d+') - 1)) + +if (( $hwmon_nr_amd >= 0 )); then + hwmon_path="/sys/class/hwmon/hwmon$hwmon_nr_amd" + temp=$(head -c -4 "$hwmon_path/temp1_input") +elif which nvidia-smi &> /dev/null; then + temp=$(nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader,nounits) +fi + +if [[ $temp -lt 45 ]]; then + class=low +elif [[ $temp -lt 70 ]]; then + class=normal +elif [[ $temp -lt 80 ]]; then + class=high +else + class=alert +fi + +cat << EOF +{"text": "$temp°C", "alt": "$class", "tooltip": "$temp°C", "class": "$class", "percentage": ""} +EOF diff --git a/.scripts/waybar-gpu-usage.sh b/.scripts/waybar-gpu-usage.sh new file mode 100755 index 0000000..323a9a4 --- /dev/null +++ b/.scripts/waybar-gpu-usage.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +declare -i hwmon_nr_amd=$(( $(cat -n /sys/class/hwmon/hwmon*/name | grep 'amdgpu' | grep -oP '\d+') - 1)) + +if (( $hwmon_nr_amd >= 0 )); then + hwmon_path="/sys/class/hwmon/hwmon$hwmon_nr_amd" + usage=$(cat "$hwmon_path/device/gpu_busy_percent") + vram=$(awk '{ print int($1/1024/1024) }' "$hwmon_path/device/mem_info_vram_used") + power=$(head -c -7 "$hwmon_path/power1_average") +elif which nvidia-smi &> /dev/null; then + usage=$(nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits) + vram=$(nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits) + power=$(nvidia-smi --query-gpu=power.draw --format=csv,noheader,nounits | awk '{ print int($1) }') +fi + +if [[ $vram -ge 1024 ]]; then + vram=$vram/1024 + vram_unit="GiB" +else + vram_unit="MiB" +fi + +cat << EOF +{"text": "$usage%", "alt": "", "tooltip": "GPU usage: $usage%\nVRAM usage: ${vram}$vram_unit\nPower draw: ${power}W", "class": "", "percentage": ""} +EOF diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..57a38c8 --- /dev/null +++ b/.vimrc @@ -0,0 +1,15 @@ +set term=kitty + +set number +filetype indent on +set autoindent + +set tabstop=4 +set shiftwidth=4 + +filetype plugin on +syntax on + +set mouse=a + +set clipboard=unnamedplus diff --git a/.zaliases b/.zaliases new file mode 100644 index 0000000..471e16c --- /dev/null +++ b/.zaliases @@ -0,0 +1,14 @@ +if grep -q '^NAME="Artix Linux"$' /etc/os-release; then + alias reboot="sudo reboot" + alias poweroff="sudo poweroff" +fi + +alias ssh="TERM=xterm-256color ssh" +#alias ssh="TERM=xterm-256color kitty +kitten ssh" +alias ff="fastfetch" +alias sc="shellcheck -s bash" +alias ip="ip --color=auto" + +# git init --bare $HOME/.dotfiles +# cfg config --local status.showUntrackedFiles no +alias cfg="/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME" diff --git a/.zprofile b/.zprofile new file mode 100644 index 0000000..6d353cf --- /dev/null +++ b/.zprofile @@ -0,0 +1,26 @@ +typeset -U path PATH +path=(~/.local/bin $path) +export PATH + +# SSH Agent +if [[ ! -f "$XDG_RUNTIME_DIR/ssh-agent.env" ]]; then + pkill -u "$USER" -9 ssh-agent + ssh-agent > "$XDG_RUNTIME_DIR/ssh-agent.env" +fi +source "$XDG_RUNTIME_DIR/ssh-agent.env" > /dev/null + +# If NVIDIA, set env vars +if ! printenv SSH_TTY &> /dev/null && lspci | grep -q 'VGA.*NVIDIA'; then + export GBM_BACKEND=nvidia-drm + export __GLX_VENDOR_LIBRARY_NAME=nvidia + export LIBVA_DRIVER_NAME=nvidia + export __GL_GSYNC_ALLOWED=1 + export __GL_VRR_ALLOWED=0 + export WLR_NO_HARDWARE_CURSORS=1 +fi + +# Restore Wal colors if not SSH session +printenv SSH_TTY &> /dev/null || wal -R + +# Autostart Hyprland on TTY1 +[[ "$XDG_VTNR" -eq 1 ]] && exec dbus-run-session Hyprland diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..59e45bc --- /dev/null +++ b/.zshrc @@ -0,0 +1,117 @@ +# Path to your oh-my-zsh installation. +ZSH=/usr/share/oh-my-zsh/ + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. +HYPHEN_INSENSITIVE="true" + +# Uncomment the following line to enable command auto-correction. +ENABLE_CORRECTION="true" + +plugins=(git-prompt sudo zsh-autosuggestions zsh-shift-select) + +ZSH_CACHE_DIR=$HOME/.cache/oh-my-zsh +if [[ ! -d $ZSH_CACHE_DIR ]]; then + mkdir $ZSH_CACHE_DIR +fi + +# If not running interactively, don't do anything +[[ $- != *i* ]] && exit + +source $HOME/.zaliases + +# Disable bell +unsetopt autocd beep + +# Enable case-insensitive auto completion +autoload -Uz compinit && compinit +zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' + +# Set prompt +PROMPT="%B%F{198}%n%F{015}@%F{014}%m%F{015}:%F{198}%~%F{015}> %b%f" +#autoload -Uz promptinit && promptinit + +# History settings +HISTFILE=~/.zhistory +HISTSIZE=10000 +SAVEHIST=10000 +setopt appendhistory +setopt extended_history +setopt share_history +setopt inc_append_history +setopt hist_find_no_dups +setopt hist_reduce_blanks + +# Enable case-insensitive globbing +setopt no_case_glob +setopt glob_complete + +autoload -Uz up-line-or-beginning-search down-line-or-beginning-search +zle -N up-line-or-beginning-search +zle -N down-line-or-beginning-search + +# Import colorscheme from 'wal' asynchronously +# & # Run the process in the background. +# # ( ) # Hide shell job control messages. +# # Not supported in the "fish" shell. +(cat ~/.cache/wal/sequences &) +# # To add support for TTYs this line can be optionally added. +source ~/.cache/wal/colors-tty.sh + +# create a zkbd compatible hash; +# to add other keys to this hash, see: man 5 terminfo +typeset -g -A key + +key[Home]="${terminfo[khome]}" +key[End]="${terminfo[kend]}" +key[Insert]="${terminfo[kich1]}" +key[Backspace]="${terminfo[kbs]}" +key[Delete]="${terminfo[kdch1]}" +key[Up]="${terminfo[kcuu1]}" +key[Down]="${terminfo[kcud1]}" +key[Left]="${terminfo[kcub1]}" +key[Right]="${terminfo[kcuf1]}" +key[PageUp]="${terminfo[kpp]}" +key[PageDown]="${terminfo[knp]}" +key[Shift-Tab]="${terminfo[kcbt]}" +key[Control-Left]="${terminfo[kLFT5]}" +key[Control-Right]="${terminfo[kRIT5]}" +key[Control-Backspace]="^H" +key[Control-Delete]="^5" + +# Setup key accordingly +bindkey -- "${key[Home]}" beginning-of-line +bindkey -- "${key[End]}" end-of-line +bindkey -- "${key[Insert]}" overwrite-mode +bindkey -- "${key[Backspace]}" backward-delete-char +bindkey -- "${key[Delete]}" delete-char +bindkey -- "${key[Up]}" up-line-or-history +bindkey -- "${key[Down]}" down-line-or-history +bindkey -- "${key[Left]}" backward-char +bindkey -- "${key[Right]}" forward-char +bindkey -- "${key[PageUp]}" beginning-of-buffer-or-history +bindkey -- "${key[PageDown]}" end-of-buffer-or-history +bindkey -- "${key[Shift-Tab]}" reverse-menu-complete +bindkey -- "${key[Up]}" up-line-or-beginning-search +bindkey -- "${key[Down]}" down-line-or-beginning-search +bindkey -- "${key[Control-Left]}" backward-word +bindkey -- "${key[Control-Right]}" forward-word +bindkey -- "${key[Control-Delete]}" kill-word +bindkey -M emacs "${key[Control-Backspace]}" backward-kill-word +bindkey -M viins "${key[Control-Backspace]}" backward-kill-word +bindkey -M vicmd "${key[Control-Backspace]}" backward-kill-word + +# Finally, make sure the terminal is in application mode, when zle is +# active. Only then are the values from $terminfo valid. +if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then + autoload -Uz add-zle-hook-widget + function zle_application_mode_start { echoti smkx } + function zle_application_mode_stop { echoti rmkx } + add-zle-hook-widget -Uz zle-line-init zle_application_mode_start + add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop +fi + +source $ZSH/oh-my-zsh.sh