diff --git a/.bash_exports b/.bash_exports index 049f1f4..6209fd0 100644 --- a/.bash_exports +++ b/.bash_exports @@ -1,26 +1,17 @@ -# editor -export EDITOR=nvim -export TERMINAL=kitty - - -# infinite bash history -# remove '-1' in both places if your bash version < 4.3 +# bash history +export HISTCONTROL=ignoreboth export HISTFILESIZE=-1 export HISTSIZE=-1 -# writes bash history after every command -export PROMPT_COMMAND="history -a" # GCM export GCM_CREDENTIAL_STORE=cache - # zoxide if command -v zoxide >/dev/null 2>&1; then eval "$(zoxide init bash)" fi - # pyenv if command -v pyenv >/dev/null 2>&1; then export PYENV_ROOT="$HOME/.pyenv" @@ -28,7 +19,6 @@ if command -v pyenv >/dev/null 2>&1; then eval "$(pyenv init - bash)" fi - # android-sdk export ANDROID_SDK_ROOT=/opt/android-sdk export PATH=$PATH:$ANDROID_SDK_ROOT/cmdline-tools/latest/bin diff --git a/.bash_prompt b/.bash_prompt new file mode 100644 index 0000000..2369534 --- /dev/null +++ b/.bash_prompt @@ -0,0 +1,24 @@ +# History append +shopt -s histappend + +# Prompt +set_prompt() { + local EXIT_STATUS=$? + local SUCCESS="\[\e[32m\]" + local ERROR="\[\e[34m\]" + local RESET="\[\e[0m\]" + + history -a + history -c + history -r + + if [ $EXIT_STATUS -eq 0 ]; then + local COLOR=$SUCCESS + else + local COLOR=$ERROR + fi + + # PS1="[\u@\h \W]${COLOR}\\\$${RESET} " + PS1="[\u@\h \! \W]${COLOR}\\\$${RESET} " +} +PROMPT_COMMAND=set_prompt diff --git a/.bashrc b/.bashrc index ee82ff5..25fd79e 100644 --- a/.bashrc +++ b/.bashrc @@ -107,6 +107,8 @@ alias download='aria2c -x16 -s16' alias scrcpy-def='scrcpy -S --no-audio -K' alias share='python3 -m http.server' alias globalshare='(cd ~/Share && python3 -m http.server)' +alias agrep='ps aux | grep' + # fun aliases alias mm='unimatrix -f -a -s 92 -l coo -c yellow' @@ -115,6 +117,13 @@ alias mmbeesquit='unimatrix -f -s 86 -u '\''beesquit'\'' -c yellow' alias mmsnow='unimatrix -u ❄❆❅᪥𑁍⭒*❄❆❅᪥* -c white -a' # extra +# functions +meomap() { + for net in "$@"; do + sudo nmap -sn "$net/24" + done +} + # additional aliases if [ -f "$HOME/.bash_private" ]; then . "$HOME/.bash_private" @@ -122,3 +131,6 @@ fi if [ -f "$HOME/.bash_aliases" ]; then . "$HOME/.bash_aliases" fi +if [ -f "$HOME/.bash_prompt" ]; then + . "$HOME/.bash_prompt" +fi diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc index 407cc6f..4c471cf 100644 --- a/.config/dunst/dunstrc +++ b/.config/dunst/dunstrc @@ -17,6 +17,12 @@ progress_bar_height = 7 highlight = "#BD93F9" origin = bottom-right +# Testing: +mouse_left_click = do_action, close_current +mouse_middle_click = do_action, close_current +mouse_right_click = close_all + + [urgency_low] background = "#20212C6A" foreground = "#C0CAF5" diff --git a/.config/dunst/scripts/executable_BSC.py b/.config/dunst/scripts/executable_BSC.py deleted file mode 100644 index 88b88ce..0000000 --- a/.config/dunst/scripts/executable_BSC.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python3 -from dataclasses import dataclass -import subprocess -import sys -import os -import time - -battery_state = {"Discharging": False, "Charging": True} - - -@dataclass(slots=True) -class Battery: - percent: int - power_plugged: bool - - -def sensors_battery(base_path: str) -> Battery: - with open(base_path + "capacity", "r") as c, open(base_path + "status", "r") as s: - return Battery( - percent=int(c.read().strip()), power_plugged=battery_state[s.read().strip()] - ) - - -def main(sleep_time: int, base_path: str): - while True: - if sensors_battery(base_path).power_plugged: - os.system('notify-send -u normal -r "6896" "Battery" "Charging"') - while sensors_battery(base_path).power_plugged: - time.sleep(sleep_time) - os.system('notify-send -u normal -r "6896" "Battery" "Discharging"') - elif sensors_battery(base_path).percent <= 15: - os.system('notify-send -u critical -r "6896" "Battery" "Low battery alarm"') - while ( - not sensors_battery(base_path).power_plugged - or sensors_battery(base_path).percent > 5 - ): - time.sleep(sleep_time) - if sensors_battery(base_path).percent <= 5: - os.system("systemctl suspend") - time.sleep(60) - time.sleep(sleep_time) - - -if __name__ == "__main__": - service_name = "BSC" - base_path = "/sys/class/power_supply/BAT0/" - if not os.path.exists(base_path): - sys.stdout.write("Can't get battery info\n") - sys.stdout.flush() - sys.exit(1) - if subprocess.run(["pgrep", service_name]).returncode != 1: - sys.stdout.write("Process alredy exists\n") - sys.stdout.flush() - sys.exit(1) - with open("/proc/self/comm", "w") as f: - f.write(service_name) - main(2, base_path) diff --git a/.config/dunst/scripts/executable_ROGprofiler.sh b/.config/dunst/scripts/executable_ROGprofiler.sh deleted file mode 100644 index 46e4a77..0000000 --- a/.config/dunst/scripts/executable_ROGprofiler.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -asusctl profile -n - -notify-send -i $HOME/.config/dunst/scripts/icons/performance.svg -u low -r "3378455" "$(asusctl profile -p | grep Active | sed 's/^.*is //')" diff --git a/.config/dunst/scripts/executable_brightness.sh b/.config/dunst/scripts/executable_brightness.sh deleted file mode 100644 index 64b0a8c..0000000 --- a/.config/dunst/scripts/executable_brightness.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -msgId="3378455" - -brightnessctl "$@" >/dev/null - -brightpercent=$(ddcutil -d 1 getvcp 10 | sed 's/^.*current value = //' | sed 's/, max.*//') - -notify-send -i $HOME/.config/dunst/scripts/icons/brightness.svg -a "changeBrightness" -u low -r "$msgId" \ - -h int:value:"$brightpercent" "Яркость экрана: $brightpercent%" diff --git a/.config/dunst/scripts/executable_eDP-1brightness.sh b/.config/dunst/scripts/executable_eDP-1brightness.sh deleted file mode 100644 index fe0577d..0000000 --- a/.config/dunst/scripts/executable_eDP-1brightness.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -msgId="3378455" - -brightpercent=$(brightnessctl -m --class='backlight' | awk -F, '{print substr($4, 0, length($4)-1)}') - -notify-send -i $HOME/.config/dunst/scripts/icons/brightness.svg -a "changeBrightness" -u low -r "$msgId" \ - -h int:value:"$brightpercent" "Яркость экрана: $brightpercent%" diff --git a/.config/dunst/scripts/executable_micro.sh b/.config/dunst/scripts/executable_micro.sh deleted file mode 100644 index 29e4f32..0000000 --- a/.config/dunst/scripts/executable_micro.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -msgId="3378455" - -station=$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@ | sed 's/Volume://' | tr -d [:digit:] | tr -d ' .[]') - -if [ $station = 'MUTED' ]; then - notify-send -i "$HOME/.config/dunst/scripts/icons/mic off.svg" -u low -r "$msgId" "Микрофон выключен" -else - notify-send -i "$HOME/.config/dunst/scripts/icons/mic on.svg" -u low -r "$msgId" "Микрофон включен" -fi diff --git a/.config/dunst/scripts/executable_trackinfo.sh b/.config/dunst/scripts/executable_trackinfo.sh deleted file mode 100644 index bb02343..0000000 --- a/.config/dunst/scripts/executable_trackinfo.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -sleep 0.7 - -msgId="3378455" - -artist=$(playerctl metadata artist) -title=$(playerctl metadata title) -image=$(playerctl metadata mpris:artUrl) - -notify-send -u low -r "$msgId" "$artist" "$title" -i "$image" diff --git a/.config/dunst/scripts/executable_volume.sh b/.config/dunst/scripts/executable_volume.sh deleted file mode 100644 index 260a86d..0000000 --- a/.config/dunst/scripts/executable_volume.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -msgId="3378455" - -wpctl set-mute @DEFAULT_AUDIO_SINK@ 0 - -volume=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/Volume://' | - sed 's/ 0.//' | tr -d ' .') - -notify-send -i $HOME/.config/dunst/scripts/icons/volume.svg -a "changevolume" -u low -r "$msgId" \ - -h int:value:"$volume" "Громкость: $volume%" diff --git a/.config/dunst/scripts/executable_volumemute.sh b/.config/dunst/scripts/executable_volumemute.sh deleted file mode 100644 index 38f4d08..0000000 --- a/.config/dunst/scripts/executable_volumemute.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -msgId="3378455" - -station=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/Volume://' | tr -d [:digit:] | tr -d ' .[]') - -if [ $station = 'MUTED' ]; then - notify-send -i "$HOME/.config/dunst/scripts/icons/volume mute.svg" -u low -r "$msgId" "Звук выключен" -else - notify-send -i "$HOME/.config/dunst/scripts/icons/volume.svg" -u low -r "$msgId" "Звук включен" -fi diff --git a/.config/dunst/scripts/icons/brightness down.svg b/.config/dunst/scripts/icons/brightness down.svg deleted file mode 100644 index dd66a9a..0000000 --- a/.config/dunst/scripts/icons/brightness down.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/.config/dunst/scripts/icons/brightness.svg b/.config/dunst/scripts/icons/brightness.svg deleted file mode 100644 index d73b23b..0000000 --- a/.config/dunst/scripts/icons/brightness.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/.config/dunst/scripts/icons/mic off.svg b/.config/dunst/scripts/icons/mic off.svg deleted file mode 100644 index 95aa849..0000000 --- a/.config/dunst/scripts/icons/mic off.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/.config/dunst/scripts/icons/mic on.svg b/.config/dunst/scripts/icons/mic on.svg deleted file mode 100644 index 271ed32..0000000 --- a/.config/dunst/scripts/icons/mic on.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/.config/dunst/scripts/icons/pause.svg b/.config/dunst/scripts/icons/pause.svg deleted file mode 100644 index 1a05469..0000000 --- a/.config/dunst/scripts/icons/pause.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/.config/dunst/scripts/icons/performance.svg b/.config/dunst/scripts/icons/performance.svg deleted file mode 100644 index c21d3dc..0000000 --- a/.config/dunst/scripts/icons/performance.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/.config/dunst/scripts/icons/play.svg b/.config/dunst/scripts/icons/play.svg deleted file mode 100644 index 5f5412d..0000000 --- a/.config/dunst/scripts/icons/play.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/.config/dunst/scripts/icons/volume down.svg b/.config/dunst/scripts/icons/volume down.svg deleted file mode 100644 index fc9d81b..0000000 --- a/.config/dunst/scripts/icons/volume down.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/.config/dunst/scripts/icons/volume mute.svg b/.config/dunst/scripts/icons/volume mute.svg deleted file mode 100644 index 4da1f37..0000000 --- a/.config/dunst/scripts/icons/volume mute.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/.config/dunst/scripts/icons/volume.svg b/.config/dunst/scripts/icons/volume.svg deleted file mode 100644 index 8281fc0..0000000 --- a/.config/dunst/scripts/icons/volume.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/.config/hypr/config/arbitary_settings.conf b/.config/hypr/config/arbitary_settings.conf index f7b2cbb..a206237 100644 --- a/.config/hypr/config/arbitary_settings.conf +++ b/.config/hypr/config/arbitary_settings.conf @@ -1,5 +1,6 @@ # Wallpaper -env = WALLPAPER,$HOME/Pictures/Wallpapers/Arcane/Jinx/jinx-fog.png +# env = WALLPAPER,$HOME/Pictures/Wallpapers/Arcane/Jinx/jinx-fog.png +env = WALLPAPER,$HOME/Pictures/Wallpapers/Scapes/Deserts/desert-night.jpg # Lockscreen wallpaper env = LOCK_WALLPAPER,$HOME/Pictures/Wallpapers/Arcane/Scenes/arcane-airship.png diff --git a/.config/hypr/config/autostart.conf b/.config/hypr/config/autostart.conf index 512c9d1..19ff646 100644 --- a/.config/hypr/config/autostart.conf +++ b/.config/hypr/config/autostart.conf @@ -1,8 +1,9 @@ # System # Initialize dbus exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP -# Set workspace 100 for the scroll-left support -exec-once = bash -c "sleep 1 && for monitor in $(hyprctl monitors -j | jq -r '.[].name'); do hyprctl dispatch workspace 100 && hyprctl dispatch focusworkspaceoncurrentmonitor 100; done" +# Set workspaces to hundreds for the scroll-to-left support +# exec-once = bash -c "sleep 1 && for monitor in $(hyprctl monitors -j | jq -r '.[].name'); do hyprctl dispatch workspace 100 && hyprctl dispatch focusworkspaceoncurrentmonitor 100; done" +exec-once = ~/.config/hypr/scripts/set-workspaces.sh # Initialize sleep exec-once = uwsm app -- systemd-inhibit --who="Hyprland config" --why="wlogout keybind" --what=handle-power-key --mode=block sleep infinity @@ -26,6 +27,6 @@ exec-once = uwsm app -- waybar # Extra # Color correction -exec-once = uwsm app -- ~/.config/hypr/scripts/color-correction.sh +exec-once = ~/.config/hypr/scripts/color-correction.sh # Apply GTK themes exec-once = nwg-look -a diff --git a/.config/hypr/config/binds.conf b/.config/hypr/config/binds.conf index 76b2cec..d03abed 100644 --- a/.config/hypr/config/binds.conf +++ b/.config/hypr/config/binds.conf @@ -2,7 +2,8 @@ $mainMod = SUPER # change layout that supports no shift retapping -bindl = ALT, Shift_L, exec, hyprctl switchxkblayout main next +bindln = Shift_L, ALT_L, exec, hyprctl switchxkblayout main next +bindln = ALT_L, Shift_L, exec, hyprctl switchxkblayout main next # Toggle performance mode @@ -30,12 +31,19 @@ bind = $mainMod, Q, exec, kitty bind = $mainMod, E, exec, thunar bind = $mainMod, R, exec, rofi -show drun -terminal kitty -no-history -matching prefix -drun-match-fields name -no-tokenize bind = $mainMod SHIFT, R, exec, ~/.config/rofi/network-manager/run-manager.sh -bind = $mainMod, C, exec, hyprpicker -a +bind = $mainMod, S, exec, hyprpicker -a +bind = $mainMod, C, exec, dunstctl close-all -# copy binds +# clipboard binds bind = $mainMod, V, exec, rofi -modi clipboard:/$HOME/.config/rofi/clipboard/cliphist-rofi-img.sh -show clipboard -show-icon -config ~/.config/rofi/clipboard-config.rasi -bind = $mainMod SHIFT, S, exec, IMG=~/Pictures/Screenshots/$(date +%Y-%m-%d_%H-%m-%s).png && grim -g "$(slurp)" $IMG && wl-copy < $IMG + + +# screenshot binds +# no screen freeze +# bind = $mainMod SHIFT, S, exec, IMG=~/Pictures/Screenshots/$(date +%Y-%m-%d_%H-%m-%s).png && grim -g "$(slurp)" $IMG && wl-copy < $IMG +# screen freeze +bind = $mainMod SHIFT, S, exec, hyprpicker -r -z & sleep 0.2; IMG=~/Pictures/Screenshots/$(date +%Y-%m-%d_%H-%m-%s).png && grim -g "$(slurp)" $IMG && wl-copy < $IMG; kill $! bind = , PRINT, exec, grim - | wl-copy @@ -115,6 +123,10 @@ binde = $mainMod CTRL, j, resizeactive, 0 30 binde = $mainMod CTRL, k, resizeactive, 0 -30 +# Focus on initial workspace (TODO: different for monitors) +bind = $mainMod, 0, focusworkspaceoncurrentmonitor, 100 + + # Switch workspaces binde = $mainMod, A, exec, .config/hypr/scripts/workspace-handler.sh change previous binde = $mainMod, D, exec, .config/hypr/scripts/workspace-handler.sh change next @@ -129,5 +141,5 @@ binde = $mainMod CTRL SHIFT, A, movetoworkspace, r-1 binde = $mainMod CTRL SHIFT, D, movetoworkspace, r+1 -# Swap worlspaces between monitors +# Swap workspaces between monitors bind = $mainMod, TAB, swapactiveworkspaces, 1 0 diff --git a/.config/hypr/config/env.conf b/.config/hypr/config/env.conf index 44e63d4..5be3cb6 100644 --- a/.config/hypr/config/env.conf +++ b/.config/hypr/config/env.conf @@ -1,3 +1,8 @@ +# Apps +env = EDITOR,nvim +env = TERMINAL,kitty + + # GTK theme env = GTK_THEME,Colloid-Transparent-Dracula @@ -21,6 +26,7 @@ env = MOZ_ENABLE_WAYLAND,1 # chrome --enable-features=TouchpadOverscrollHistoryNavigation + # Scaling env = GDK_SCALE,1 xwayland { diff --git a/.config/hypr/config/monitors.conf b/.config/hypr/config/monitors.conf index 36b0727..b37df0d 100644 --- a/.config/hypr/config/monitors.conf +++ b/.config/hypr/config/monitors.conf @@ -6,3 +6,4 @@ monitor = eDP-1, prefered, auto, 1 # custom monitor = desc:Communications Supply Corporation (A division of WESCO) P120ZDG-BF4, 2160x1440@60, auto, 1.33333334 monitor = desc:AU Optronics 0x243D, 1920x1080@60, 0x0, 1, bitdepth, 10 +monitor = desc:Samsung Electric Company Q85A 0x01000E00, 2560x1440@59.95, auto, 1 diff --git a/.config/hypr/config/preferences.conf b/.config/hypr/config/preferences.conf new file mode 100644 index 0000000..4fb232b --- /dev/null +++ b/.config/hypr/config/preferences.conf @@ -0,0 +1,20 @@ +# Splashes +ecosystem { + no_update_news = true + no_donation_nag = true +} + +# render +render { + direct_scanout = 2 # maybe change it to 0 (default) +} + +# Misc +misc { + disable_hyprland_logo = true + disable_splash_rendering = true + mouse_move_enables_dpms = true + key_press_enables_dpms = true + initial_workspace_tracking = 2 + session_lock_xray = false +} diff --git a/.config/hypr/config/style.conf b/.config/hypr/config/style.conf index 83ee0cf..069f6ca 100644 --- a/.config/hypr/config/style.conf +++ b/.config/hypr/config/style.conf @@ -1,16 +1,3 @@ -# Splashes -ecosystem { - no_update_news = true - no_donation_nag = true -} - -misc { - disable_hyprland_logo = true - disable_splash_rendering = true - key_press_enables_dpms = true -} - - # General config general { gaps_in = 3 @@ -22,13 +9,15 @@ general { } dwindle { - pseudotile = yes + # pseudotile = yes preserve_split = yes # smart_split = no } cursor { inactive_timeout = 2 + hide_on_key_press = true + hide_on_touch = true } diff --git a/.config/hypr/docs/README.md b/.config/hypr/docs/README.md new file mode 100644 index 0000000..e69de29 diff --git a/.config/hypr/scripts/dunst/volume-down.sh b/.config/hypr/scripts/dunst/volume-down.sh index 529989b..aa61017 100755 --- a/.config/hypr/scripts/dunst/volume-down.sh +++ b/.config/hypr/scripts/dunst/volume-down.sh @@ -5,4 +5,4 @@ msgId="3378455" volume=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -Eo [0-9]+% | head -1) notify-send -i $HOME/.config/hypr/scripts/dunst/icons/volume-down.svg -a "changevolume" -u low -r "$msgId" \ - -h int:value:"$volume" "Громкость: $volume%" + -h int:value:"$volume" "Громкость: $volume" diff --git a/.config/hypr/scripts/dunst/volume.sh b/.config/hypr/scripts/dunst/volume.sh index 0e76c5f..73d2d02 100755 --- a/.config/hypr/scripts/dunst/volume.sh +++ b/.config/hypr/scripts/dunst/volume.sh @@ -8,4 +8,4 @@ msgId="3378455" volume=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -Eo [0-9]+% | head -1) notify-send -i $HOME/.config/hypr/scripts/dunst/icons/volume.svg -a "changevolume" -u low -r "$msgId" \ - -h int:value:"$volume" "Громкость: $volume%" + -h int:value:"$volume" "Громкость: $volume" diff --git a/.config/hypr/scripts/set-workspaces.sh b/.config/hypr/scripts/set-workspaces.sh new file mode 100755 index 0000000..09ccac6 --- /dev/null +++ b/.config/hypr/scripts/set-workspaces.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Get current monitor +current_monitor=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .name') + +# Fallback +if [ -z "$current_monitor" ]; then + current_monitor=$(hyprctl monitors -j | jq -r '.[0].name') +fi + +# Set workspaces +count=1 +while IFS= read -r mon; do + ws=$((count * 100)) + hyprctl --batch "dispatch focusmonitor $mon; dispatch workspace $ws" + count=$((count + 1)) +done < <(hyprctl monitors -j | jq -r '.[].name') + +# Return focus +hyprctl dispatch focusmonitor "$current_monitor" diff --git a/.config/hypr/scripts/toggle-lid-sleep.sh b/.config/hypr/scripts/toggle-lid-sleep.sh new file mode 100755 index 0000000..05ef00d --- /dev/null +++ b/.config/hypr/scripts/toggle-lid-sleep.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +msgId="3378455" + +if pgrep -f "systemd-inhibit --what=handle-lid-switch" > /dev/null; then + pkill -f "systemd-inhibit --what=handle-lid-switch" + # notify-send -u low -r "$msgId" "Lid Sleep" "Do Not Sleep on lid close DISABLED" +else + systemd-inhibit --what=handle-lid-switch --who="Lid Toggle Script" --why="User toggled lid sleep off" --mode=block sleep infinity & + # notify-send -u low -r "$msgId" "Lid Sleep" "Do Not Sleep on lid close ENABLED" +fi +pkill -RTMIN+10 waybar diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index b77d42c..cca006d 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,5 +1,4 @@ require("config.lazy") require("config.config") -require("config.options") require("config.key_binds") require("config.clipboard") diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 548a17d..c2f3af8 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -3,15 +3,15 @@ "catppuccin": { "branch": "main", "commit": "426dbebe06b5c69fd846ceb17b42e12f890aedf1" }, "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, - "conform.nvim": { "branch": "master", "commit": "086a40dc7ed8242c03be9f47fbcee68699cc2395" }, + "conform.nvim": { "branch": "master", "commit": "dca1a190aa85f9065979ef35802fb77131911106" }, "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, - "flutter-tools.nvim": { "branch": "main", "commit": "677cc07c16e8b89999108d2ebeefcfc5f539b73c" }, + "flutter-tools.nvim": { "branch": "main", "commit": "7fc434e99297af83cba10deff008be53a008a6d5" }, "harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" }, "harpoon-lualine": { "branch": "master", "commit": "215c0847dfb787b19268f7b42eed83bdcf06b966" }, "indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lualine.nvim": { "branch": "master", "commit": "a905eeebc4e63fdc48b5135d3bf8aea5618fb21c" }, - "mini.nvim": { "branch": "main", "commit": "5849ef04c32a6a8e55957b946c0a275801d87530" }, + "mini.nvim": { "branch": "main", "commit": "4f6f84a96b076747b736d100388a8d7844771d7d" }, "neo-tree.nvim": { "branch": "main", "commit": "4d0828d95adaf4250c1373d2cd9318d3509712b7" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" }, @@ -19,7 +19,7 @@ "nvim-dap": { "branch": "master", "commit": "45a69eba683a2c448dd9ecfc4de89511f0646b5f" }, "nvim-dap-python": { "branch": "master", "commit": "1808458eba2b18f178f990e01376941a42c7f93b" }, "nvim-dap-ui": { "branch": "master", "commit": "1a66cabaa4a4da0be107d5eda6d57242f0fe7e49" }, - "nvim-lspconfig": { "branch": "master", "commit": "e146efacbafed3789ac568abcc5a981c5decaa58" }, + "nvim-lspconfig": { "branch": "master", "commit": "8fde495949782bb61c2605174e231d145a048d8c" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" }, "nvim-web-devicons": { "branch": "master", "commit": "c72328a5494b4502947a022fe69c0c47e53b6aa6" }, diff --git a/.config/nvim/lua/config/clipboard.lua b/.config/nvim/lua/config/clipboard.lua index 9c789de..06d3aee 100644 --- a/.config/nvim/lua/config/clipboard.lua +++ b/.config/nvim/lua/config/clipboard.lua @@ -1,9 +1,3 @@ +-- clipboard.lua will be edited by the bash command +-- it will be replaced with one of the files from templates/clipboard/ directory vim.o.clipboard = "unnamedplus" --- vim.api.nvim_create_autocmd("TextYankPost", { --- callback = function() --- local copy_to_unnamedplus = require("vim.ui.clipboard.osc52").copy("+") --- copy_to_unnamedplus(vim.v.event.regcontents) --- local copy_to_unnamed = require("vim.ui.clipboard.osc52").copy("*") --- copy_to_unnamed(vim.v.event.regcontents) --- end, --- }) diff --git a/.config/nvim/lua/config/config.lua b/.config/nvim/lua/config/config.lua index 02803b8..f940c0c 100644 --- a/.config/nvim/lua/config/config.lua +++ b/.config/nvim/lua/config/config.lua @@ -12,3 +12,17 @@ do vim.opt[k] = v end end + +-- More +vim.opt.fixeol = true +vim.opt.list = true +vim.opt.listchars = { + trail = "·", + tab = " ", +} + +-- Additional commands for typos +vim.api.nvim_create_user_command("Qa", "qa", {}) +vim.api.nvim_create_user_command("QA", "qa", {}) +vim.api.nvim_create_user_command("WQa", "qa", {}) +vim.api.nvim_create_user_command("Wqa", "qa", {}) diff --git a/.config/nvim/lua/config/options.lua b/.config/nvim/lua/config/options.lua deleted file mode 100644 index e92ceb2..0000000 --- a/.config/nvim/lua/config/options.lua +++ /dev/null @@ -1,6 +0,0 @@ -vim.opt.fixeol = true -vim.opt.list = true -vim.opt.listchars = { - trail = "·", - tab = " ", -} diff --git a/.config/nvim/lua/plugins/render-markdown.lua b/.config/nvim/lua/plugins/render-markdown.lua index a47cead..f7f5819 100644 --- a/.config/nvim/lua/plugins/render-markdown.lua +++ b/.config/nvim/lua/plugins/render-markdown.lua @@ -1,5 +1,5 @@ return { - "MeanderingProgrammer/render-markdown.nvim", - dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" }, - opts = {}, + -- "MeanderingProgrammer/render-markdown.nvim", + -- dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" }, + -- opts = {}, } diff --git a/.config/waybar/modules/power.jsonc b/.config/waybar/modules/power.jsonc index 1affc00..57e7b4d 100644 --- a/.config/waybar/modules/power.jsonc +++ b/.config/waybar/modules/power.jsonc @@ -1,7 +1,7 @@ { "group/power-group": { "orientation": "horizontal", - "modules": ["backlight", "battery"], + "modules": ["backlight", "battery", "idle_inhibitor", "custom/lid_sleep"], }, "battery": { @@ -21,4 +21,19 @@ "on-click": "python $HOME/.config/hypr/scripts/awww.py", "tooltip-format": "{percent}%", }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "󰐂", + "deactivated": "󱩜", + }, + }, + "custom/lid_sleep": { + "format": "{}", + "exec": "pgrep -f 'systemd-inhibit --what=[h]andle-lid-switch' > /dev/null && echo '󱜤' || echo '󱠎'", + "on-click": "~/.config/hypr/scripts/toggle-lid-sleep.sh", + "tooltip": true, + "tooltip-format": "Toggle Lid Sleep", + "signal": 10, + }, } diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 524aef9..6602a31 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -118,6 +118,14 @@ tooltip label { padding-left: 6px; } +#idle_inhibitor { + padding-right: 12px; +} + +#custom-lid_sleep { + padding-right: 16px; +} + #bluetooth { padding-left: 12px; diff --git a/config-scripts/export-config.sh b/config-scripts/export-config.sh index c911a6c..e5cf07b 100755 --- a/config-scripts/export-config.sh +++ b/config-scripts/export-config.sh @@ -27,6 +27,7 @@ cp -r ~/.bash_profile "$CONFIG_SAVE_DIR/.bash_profile" cp -r ~/.bashrc "$CONFIG_SAVE_DIR/.bashrc" cp -r ~/.bash_exports "$CONFIG_SAVE_DIR/.bash_exports" cp -r ~/.bash_aliases "$CONFIG_SAVE_DIR/.bash_aliases" +cp -r ~/.bash_prompt "$CONFIG_SAVE_DIR/.bash_prompt" cp -r ~/.ideavimrc "$CONFIG_SAVE_DIR/.ideavimrc" echo 'Copied configs' diff --git a/config-scripts/install-config.sh b/config-scripts/install-config.sh index 03c912c..e1ba356 100755 --- a/config-scripts/install-config.sh +++ b/config-scripts/install-config.sh @@ -1,61 +1,82 @@ #!/bin/bash +set -uo pipefail + +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +RED='\033[0;31m' +NC='\033[0m' + + +# ---- Preparing for setup ---- +# Testing for sudo access +if ! sudo -v; then + echo -e "${RED}Error: Failed to use sudo.${NC}" >&2 + exit 1 +fi + + # ---- Initial setup ---- # Creating all the directories -echo "Creating all the directories...." -mkdir -p ~/.config/bash -mkdir -p ~/Documents/obsidian/Notes -mkdir -p ~/Pictures/Screenshots -mkdir -p ~/Pictures/Wallpapers -mkdir ~/Downloads -mkdir ~/Programming -mkdir ~/Public -mkdir ~/Music -mkdir ~/Videos -mkdir ~/config-scripts -mkdir ~/scripts -mkdir -p ~/tmp/daily +echo -e "${YELLOW}Creating all the directories....${NC}" +mkdir -p "$HOME/.config/bash" +mkdir -p "$HOME/Documents/obsidian/Notes" +mkdir -p "$HOME/Pictures/Screenshots" +mkdir -p "$HOME/Pictures/Wallpapers" +mkdir -p "$HOME/Downloads" +mkdir -p "$HOME/Programming" +mkdir -p "$HOME/Public" +mkdir -p "$HOME/Music" +mkdir -p "$HOME/Videos" +mkdir -p "$HOME/config-scripts" +mkdir -p "$HOME/scripts" +mkdir -p "$HOME/tmp/daily" # Creating extra files -echo "Creating extra files...." -touch ~/.bash_profile -touch ~/.bash_exports -touch ~/.inputrc -touch ~/.bashrc -touch ~/.bash_aliases -touch ~/.bash_private +echo -e "${YELLOW}Creating extra files....${NC}" +touch "$HOME/.bash_profile" +touch "$HOME/.bash_exports" +touch "$HOME/.inputrc" +touch "$HOME/.bashrc" +touch "$HOME/.bash_aliases" +touch "$HOME/.bash_private" +touch "$HOME/.bash_prompt" # Creating extra links -echo "Creating extra links...." -ln -s ~/.bash_profile ~/.config/bash/bash_profile -ln -s ~/.bash_exports ~/.config/bash/bash_exports -ln -s ~/.inputrc ~/.config/bash/inputrc -ln -s ~/.bashrc ~/.config/bash/bashrc -ln -s ~/.bash_aliases ~/.config/bash/bash_aliases -ln -s ~/.bash_private ~/.config/bash/bash_private - +echo -e "${YELLOW}Creating extra links....${NC}" +ln -sf "$HOME/.bash_profile" "$HOME/.config/bash/bash_profile" +ln -sf "$HOME/.bash_exports" "$HOME/.config/bash/bash_exports" +ln -sf "$HOME/.inputrc" "$HOME/.config/bash/inputrc" +ln -sf "$HOME/.bashrc" "$HOME/.config/bash/bashrc" +ln -sf "$HOME/.bash_aliases" "$HOME/.config/bash/bash_aliases" +ln -sf "$HOME/.bash_private" "$HOME/.config/bash/bash_private" +ln -sf "$HOME/.bash_prompt" "$HOME/.config/bash/bash_prompt" # ---- Packages setup ---- -# Updating package databases & installed packages -echo "Updating package databases & installed packages...." -sudo pacman -Syu --noconfirm +# Updating package databases +echo -e "${YELLOW}Updating package databases....${NC}" +sudo pacman -Sy # Installing the base packages -echo "Installing the base packages...." -sudo pacman -S --needed git base-devel less jq inetutils +echo -e "${YELLOW}Installing the base packages....${NC}" +sudo pacman -S --needed --noconfirm git base-devel less jq inetutils # Installing extra packages -echo "Installing extra packages...." -sudo pacman -S --noconfirm yadm wl-clipboard hyprland uwsm hypridle hyprlock brightnessctl -sudo pacman -S --noconfirm xdg-desktop-portal-hyprland xdg-desktop-portal xdg-desktop-portal-gtk -sudo pacman -S --noconfirm rofi waybar dunst awww kitty neovim nwg-look grim slurp -sudo pacman -S --noconfirm thunar thunar-shares-plugin thunar-archive-plugin thunar-volman -sudo pacman -S --niconfirm gvfs gvfs-mtp gvfs-afc gvfs-nfs gvfs-smb gvfs-goa gvfs-wsdd gvfs-dnssd gvfs-gphoto2 +echo -e "${YELLOW}Installing extra packages....${NC}" +sudo pacman -S --needed --noconfirm \ + yadm wl-clipboard hyprland uwsm hypridle hyprlock brightnessctl \ + xdg-desktop-portal-hyprland xdg-desktop-portal xdg-desktop-portal-gtk \ + rofi waybar dunst awww kitty neovim yazi nwg-look grim slurp \ + thunar thunar-shares-plugin thunar-archive-plugin thunar-volman \ + gvfs gvfs-mtp gvfs-afc gvfs-nfs gvfs-smb gvfs-goa gvfs-wsdd gvfs-dnssd gvfs-gphoto2 # ---- Config setup ---- # This will delete all current dotfiles. Please be careful! # Cloning config from git -echo "Cloning config from git...." +echo -e "${YELLOW}Cloning config from git....${NC}" yadm clone https://git.frik.su/Beesquit/dotfiles.git yadm reset --hard origin/main ya pkg upgrade + +# ---- Finished ---- +echo -e "${GREEN}The setup is finished!${NC}" diff --git a/config-scripts/install-yay.sh b/config-scripts/install-yay.sh index 582cbf4..c417826 100755 --- a/config-scripts/install-yay.sh +++ b/config-scripts/install-yay.sh @@ -1,4 +1,6 @@ #!/bin/bash +# Installing needed packages +sudo pacman -S --noconfirm --needed git base-devel # Installing yay echo "Checking if yay is installed...." if ! command -v yay >/dev/null 2>&1; then diff --git a/config-scripts/link-bash.sh b/config-scripts/link-bash.sh index 7b64878..985c4dd 100755 --- a/config-scripts/link-bash.sh +++ b/config-scripts/link-bash.sh @@ -7,6 +7,7 @@ touch ~/.bashrc touch ~/.bash_aliases touch ~/.bash_private touch ~/.bash_exports +touch ~/.bash_prompt mkdir -p "$bash_cfg_path" ln -s ~/.inputrc "$bash_cfg_path/inputrc" @@ -15,3 +16,4 @@ ln -s ~/.bashrc "$bash_cfg_path/bashrc" ln -s ~/.bash_aliases "$bash_cfg_path/bash_aliases" ln -s ~/.bash_private "$bash_cfg_path/bash_private" ln -s ~/.bash_exports "$bash_cfg_path/bash_exports" +ln -s ~/.bash_prompt "$bash_cfg_path/bash_prompt" diff --git a/config-scripts/yadm-readd.sh b/config-scripts/yadm-readd.sh index 7f4b397..e439836 100755 --- a/config-scripts/yadm-readd.sh +++ b/config-scripts/yadm-readd.sh @@ -18,5 +18,6 @@ yadm add ~/.bash_profile yadm add ~/.bashrc yadm add ~/.bash_exports yadm add ~/.bash_aliases +yadm add ~/.bash_prompt yadm add ~/.ideavimrc