fix: fixed conflicts + moving to yadm

This commit is contained in:
2026-02-20 17:21:21 +03:00
parent 03128d0bcf
commit b5f443916b
553 changed files with 704 additions and 256 deletions

4
.config/rofi/TODO.md Normal file
View File

@@ -0,0 +1,4 @@
- [ ] Add more VPNs to vpn-manager
- [ ] Don't request password when connecting to public network
- [ ] Add separator for power-menu?

View File

@@ -0,0 +1,297 @@
// Configuration
configuration {
modi: "drun,run,filebrowser,window";
show-icons: true;
display-drun: " ";
display-run: " ";
display-filebrowser: " ";
display-window: " ";
drun-display-format: "{name}";
window-format: "{w} · {c} · {t}";
// binds
// kb-row-up: "Up,Control+k,Shift+Tab,Shift+ISO_Left_Tab";
// kb-row-down: "Down,Control+j";
}
// Global Properties
@import "./colors.rasi"
@import "./fonts.rasi"
* {
border-color: var(border);
handle-color: var(selected);
background-color: var(background);
foreground-color: var(foreground);
alternate-background: var(background-alt);
normal-background: var(background);
normal-foreground: var(foreground);
urgent-background: var(urgent);
urgent-foreground: var(background);
active-background: var(active);
active-foreground: var(sel-foreground);
selected-normal-background: var(selected);
selected-normal-foreground: var(sel-foreground);
selected-urgent-background: var(active);
selected-urgent-foreground: var(background);
selected-active-background: var(urgent);
selected-active-foreground: var(sel-foreground);
alternate-normal-background: var(background);
alternate-normal-foreground: var(foreground);
alternate-urgent-background: var(urgent);
alternate-urgent-foreground: var(background);
alternate-active-background: var(active);
alternate-active-foreground: var(background);
}
// Main Window
window {
// properties for window widget
transparency: "real";
location: center;
anchor: center;
fullscreen: false;
width: 440px;
x-offset: 0px;
y-offset: 0px;
// properties for all widgets
enabled: true;
margin: 0px;
padding: 0px;
border: 2px solid;
border-radius: 10px;
border-color: @border-color;
cursor: "default";
// Backgroud Colors
background-color: @background-color;
}
// Main Box
mainbox {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 30px;
border: 0px solid;
border-radius: 15px;
border-color: @border-color;
background-color: transparent;
transparency : "real";
children: [ "inputbar", "message", "listview" ];
}
// Inputbar
inputbar {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border-color: @border-color;
background-color: transparent;
text-color: @foreground-color;
children: [ "textbox-prompt-colon", "entry", "mode-switcher" ];
}
prompt {
enabled: true;
background-color: inherit;
text-color: inherit;
}
textbox-prompt-colon {
enabled: true;
padding: 5px 0px;
expand: false;
str: " ";
background-color: inherit;
text-color: inherit;
}
entry {
enabled: true;
padding: 5px 0px;
background-color: inherit;
text-color: inherit;
cursor: text;
placeholder: "Search...";
placeholder-color: inherit;
}
num-filtered-rows {
enabled: true;
expand: false;
background-color: inherit;
text-color: inherit;
}
textbox-num-sep {
enabled: true;
expand: false;
str: "/";
background-color: inherit;
text-color: inherit;
}
num-rows {
enabled: true;
expand: false;
background-color: inherit;
text-color: inherit;
}
case-indicator {
enabled: true;
background-color: inherit;
text-color: inherit;
}
// Listview
listview {
enabled: true;
columns: 1;
lines: 8;
cycle: true;
dynamic: true;
scrollbar: true;
layout: vertical;
reverse: false;
fixed-height: true;
fixed-columns: true;
spacing: 5px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border-color: @border-color;
background-color: transparent;
text-color: @foreground-color;
cursor: "default";
}
scrollbar {
handle-width: 6px;
handle-color: @handle-color;
border-radius: 10px;
background-color: @alternate-background;
}
// Elements
element {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 5px 10px;
border: 0px solid;
border-radius: 10px;
border-color: @border-color;
background-color: transparent;
text-color: @foreground-color;
cursor: pointer;
}
element normal.normal {
background-color: transparent;
text-color: var(normal-foreground);
}
element normal.urgent {
background-color: var(urgent-background);
text-color: var(urgent-foreground);
}
element normal.active {
background-color: var(active-background);
text-color: var(active-foreground);
}
element selected.normal {
background-color: var(selected-normal-background);
text-color: var(selected-normal-foreground);
}
element selected.urgent {
background-color: var(selected-urgent-background);
text-color: var(selected-urgent-foreground);
}
element selected.active {
background-color: var(selected-active-background);
text-color: var(selected-active-foreground);
}
element alternate.normal {
background-color: transparent;
text-color: var(alternate-normal-foreground);
}
element alternate.urgent {
background-color: var(alternate-urgent-background);
text-color: var(alternate-urgent-foreground);
}
element alternate.active {
background-color: var(alternate-active-background);
text-color: var(alternate-active-foreground);
}
element-icon {
background-color: transparent;
text-color: inherit;
size: 24px;
cursor: inherit;
}
element-text {
background-color: transparent;
text-color: inherit;
highlight: inherit;
cursor: inherit;
vertical-align: 0.5;
horizontal-align: 0.0;
}
// Mode Switcher
mode-switcher{
enabled: true;
spacing: 10px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border-color: @border-color;
background-color: transparent;
text-color: @foreground-color;
}
button {
padding: 5px 10px;
border: 0px solid;
border-radius: 10px;
border-color: @border-color;
background-color: @alternate-background;
text-color: inherit;
cursor: pointer;
}
button selected {
background-color: var(selected-normal-background);
text-color: var(selected-normal-foreground);
}
// Message
message {
enabled: true;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px 0px 0px 0px;
border-color: @border-color;
background-color: transparent;
text-color: @foreground-color;
}
textbox {
padding: 8px 10px;
border: 0px solid;
border-radius: 10px;
border-color: @border-color;
background-color: @alternate-background;
text-color: @foreground-color;
vertical-align: 0.5;
horizontal-align: 0.0;
highlight: none;
placeholder-color: @foreground-color;
blink: true;
markup: true;
}
error-message {
padding: 10px;
border: 2px solid;
border-radius: 10px;
border-color: @border-color;
background-color: @background-color;
text-color: @foreground-color;
}

View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
tmp_dir="/tmp/cliphist"
rm -rf "$tmp_dir"
if [[ -n "$1" ]]; then
cliphist decode <<<"$1" | wl-copy
exit
fi
mkdir -p "$tmp_dir"
read -r -d '' prog <<EOF
/^[0-9]+\s<meta http-equiv=/ { next }
match(\$0, /^([0-9]+)\s(\[\[\s)?binary.*(jpg|jpeg|png|bmp)/, grp) {
system("echo " grp[1] "\\\\\t | cliphist decode >$tmp_dir/"grp[1]"."grp[3])
print \$0"\0icon\x1f$tmp_dir/"grp[1]"."grp[3]
next
}
1
EOF
cliphist list | gawk "$prog"

10
.config/rofi/colors.rasi Normal file
View File

@@ -0,0 +1,10 @@
* {
background: #0E12196A;
sel-foreground: #111218;
background-alt: #282B3C00;
foreground: #DADAFF;
selected: #87B2F6;
active: #33CCFF;
urgent: #50FA7B;
border: #87B2F6;
}

304
.config/rofi/config.rasi Normal file
View File

@@ -0,0 +1,304 @@
// Configuration
configuration {
modi: "drun,run,filebrowser,window";
show-icons: false;
display-drun: " ";
display-run: " ";
display-filebrowser: " ";
display-window: " ";
drun-display-format: "{name}";
window-format: "{w} · {c} · {t}";
// binds
kb-row-up: "Up,Control+k,Shift+Tab,Shift+ISO_Left_Tab";
kb-row-down: "Down,Control+j";
kb-accept-entry: "Control+m,Return,KP_Enter";
terminal: "mate-terminal";
kb-remove-to-eol: "Control+Shift+e";
kb-mode-complete: "Control+Shift+t";
kb-mode-next: "Shift+Right,Control+Tab,Control+l";
kb-mode-previous: "Shift+Left,Control+Shift+Tab,Control+h";
kb-remove-char-back: "BackSpace";
}
// Global Properties
@import "./colors.rasi"
@import "./fonts.rasi"
* {
border-color: var(border);
handle-color: var(selected);
background-color: var(background);
foreground-color: var(foreground);
alternate-background: var(background-alt);
normal-background: var(background);
normal-foreground: var(foreground);
urgent-background: var(urgent);
urgent-foreground: var(background);
active-background: var(active);
active-foreground: var(sel-foreground);
selected-normal-background: var(selected);
selected-normal-foreground: var(sel-foreground);
selected-urgent-background: var(active);
selected-urgent-foreground: var(background);
selected-active-background: var(urgent);
selected-active-foreground: var(sel-foreground);
alternate-normal-background: var(background);
alternate-normal-foreground: var(foreground);
alternate-urgent-background: var(urgent);
alternate-urgent-foreground: var(background);
alternate-active-background: var(active);
alternate-active-foreground: var(background);
}
// Main Window
window {
// properties for window widget
transparency: "real";
location: center;
anchor: center;
fullscreen: false;
width: 400px;
x-offset: 0px;
y-offset: 0px;
// properties for all widgets
enabled: true;
margin: 0px;
padding: 0px;
border: 2px solid;
border-radius: 10px;
border-color: @border-color;
cursor: "default";
// Backgroud Colors
background-color: @background-color;
}
// Main Box
mainbox {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 30px;
border: 0px solid;
border-radius: 15px;
border-color: @border-color;
background-color: transparent;
transparency: "real";
children: [ "inputbar", "message", "listview" ];
}
// Inputbar
inputbar {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border-color: @border-color;
background-color: transparent;
text-color: @foreground-color;
children: [ "textbox-prompt-colon", "entry", "mode-switcher" ];
}
prompt {
enabled: true;
background-color: inherit;
text-color: inherit;
}
textbox-prompt-colon {
enabled: true;
padding: 5px 0px;
expand: false;
str: " ";
background-color: inherit;
text-color: inherit;
}
entry {
enabled: true;
padding: 5px 0px;
background-color: inherit;
text-color: inherit;
cursor: text;
placeholder: "Search...";
placeholder-color: inherit;
}
num-filtered-rows {
enabled: true;
expand: false;
background-color: inherit;
text-color: inherit;
}
textbox-num-sep {
enabled: true;
expand: false;
str: "/";
background-color: inherit;
text-color: inherit;
}
num-rows {
enabled: true;
expand: false;
background-color: inherit;
text-color: inherit;
}
case-indicator {
enabled: true;
background-color: inherit;
text-color: inherit;
}
// Listview
listview {
enabled: true;
columns: 1;
lines: 8;
cycle: true;
dynamic: true;
scrollbar: true;
layout: vertical;
reverse: false;
fixed-height: true;
fixed-columns: true;
spacing: 5px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border-color: @border-color;
background-color: transparent;
text-color: @foreground-color;
cursor: "default";
}
scrollbar {
handle-width: 6px;
handle-color: @handle-color;
border-radius: 10px;
background-color: @alternate-background;
}
// Elements
element {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 5px 10px;
border: 0px solid;
border-radius: 10px;
border-color: @border-color;
background-color: transparent;
text-color: @foreground-color;
cursor: pointer;
}
element normal.normal {
background-color: transparent;
text-color: var(normal-foreground);
}
element normal.urgent {
background-color: var(urgent-background);
text-color: var(urgent-foreground);
}
element normal.active {
background-color: var(active-background);
text-color: var(active-foreground);
}
element selected.normal {
background-color: var(selected-normal-background);
text-color: var(selected-normal-foreground);
}
element selected.urgent {
background-color: var(selected-urgent-background);
text-color: var(selected-urgent-foreground);
}
element selected.active {
background-color: var(selected-active-background);
text-color: var(selected-active-foreground);
}
element alternate.normal {
background-color: transparent;
text-color: var(alternate-normal-foreground);
}
element alternate.urgent {
background-color: var(alternate-urgent-background);
text-color: var(alternate-urgent-foreground);
}
element alternate.active {
background-color: var(alternate-active-background);
text-color: var(alternate-active-foreground);
}
element-icon {
background-color: transparent;
text-color: inherit;
size: 24px;
cursor: inherit;
}
element-text {
background-color: transparent;
text-color: inherit;
highlight: inherit;
cursor: inherit;
vertical-align: 0.5;
horizontal-align: 0.0;
}
// Mode Switcher
mode-switcher{
enabled: true;
spacing: 10px;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px;
border-color: @border-color;
background-color: transparent;
text-color: @foreground-color;
}
button {
padding: 5px 10px;
border: 0px solid;
border-radius: 10px;
border-color: @border-color;
background-color: @alternate-background;
text-color: inherit;
cursor: pointer;
}
button selected {
background-color: var(selected-normal-background);
text-color: var(selected-normal-foreground);
}
// Message
message {
enabled: true;
margin: 0px;
padding: 0px;
border: 0px solid;
border-radius: 0px 0px 0px 0px;
border-color: @border-color;
background-color: transparent;
text-color: @foreground-color;
}
textbox {
padding: 8px 10px;
border: 0px solid;
border-radius: 10px;
border-color: @border-color;
background-color: @alternate-background;
text-color: @foreground-color;
vertical-align: 0.5;
horizontal-align: 0.0;
highlight: none;
placeholder-color: @foreground-color;
blink: true;
markup: true;
}
error-message {
padding: 10px;
border: 2px solid;
border-radius: 10px;
border-color: @border-color;
background-color: @background-color;
text-color: @foreground-color;
}

3
.config/rofi/fonts.rasi Normal file
View File

@@ -0,0 +1,3 @@
* {
font: "JetBrains Mono Nerd Font 13";
}

View File

@@ -0,0 +1,127 @@
#!/bin/bash
SIGNAL_ICONS=("󰤟 " "󰤢 " "󰤥 " "󰤨 ")
SECURED_SIGNAL_ICONS=("󰤡 " "󰤤 " "󰤧 " "󰤪 ")
get_signal_icon() {
local signal_icon
local signal="$1"
local security="$2"
local signal_level=$((signal / 25))
if [[ $signal_level > 3 ]]; then
signal_level=3
fi
if [[ "$signal_level" -lt "${#SIGNAL_ICONS[@]}" ]]; then
signal_icon="${SIGNAL_ICONS[$signal_level]}"
fi
if [[ "$security" =~ WPA || "$security" =~ WEP ]]; then
signal_icon="${SECURED_SIGNAL_ICONS[$signal_level]}"
fi
echo "$signal_icon"
}
main_menu_options() {
local wifi_device=$(nmcli d | grep "wifi " | sed "s/ .*//")
if [ $wifi_device == ""]; then
echo "󰖪 No wifi device available"
else
local ssid=$(nmcli -t -f GENERAL device show "$wifi_device" | grep CONNECTION | cut -d: -f2)
local signal=$(nmcli -t -f GENERAL device show "$wifi_device" | grep STATE | cut -d: -f2 | sed "s/ .*//")
local security=$(nmcli connection show "$ssid" | grep "key-mgmt" | cut -d: -f2 | tr a-z A-Z)
local signal_icon=$(get_signal_icon $signal "$security")
if [ ! -z "$ssid" ]; then
echo -en "\0active\x1f0\n"
echo "$signal_icon$ssid"
fi
echo " Rescan"
fi
}
list_wifi() {
local ssids=()
local formatted_list=()
local active_ssid=""
local wifi_device=$(nmcli d | grep "wifi " | sed "s/ .*//")
local counter=0
local active_options=""
while IFS=: read -r in_use signal security ssid; do
if [ -z "$ssid" ]; then continue; fi # Пропускаем сети без SSID
local signal_icon=$(get_signal_icon $signal $security)
# Добавляем иконку подключения, если сеть активна
local formatted="$signal_icon$ssid"
if [[ "$in_use" =~ \* ]]; then
active_ssid="$ssid"
active_options+="-a $counter"
fi
ssids+=("$ssid")
formatted_ssids+="$formatted\n"
let counter++
done <<<"$(nmcli -t -f IN-USE,SIGNAL,SECURITY,SSID dev wifi)"
local chosen_option=$(echo -e "$formatted_ssids" | rofi -dmenu -i $active_options -selected-row 1 -p "Wi-Fi SSID: ")
manage_wifi "$chosen_option"
}
manage_wifi() {
local wifi_device=$(nmcli d | grep "wifi " | sed "s/ .*//")
local chosen_option="$1"
if [ -z "$chosen_option" ]; then
return
else
# Удаляем значки уровня сигнала, если есть
local chosen_id=$chosen_option
for icon in "${SIGNAL_ICONS[@]}"; do
chosen_id=$(echo "$chosen_id" | sed "s/$icon//")
done
for icon in "${SECURED_SIGNAL_ICONS[@]}"; do
chosen_id=$(echo "$chosen_id" | sed "s/$icon//")
done
# Проверяем состояние выбранной сети
local active_ssid=$(nmcli -t -f GENERAL device show $wifi_device | grep CONNECTION | cut -d: -f2)
# Определяем действие в зависимости от состояния сети
local action
if [[ "$chosen_id" == "$active_ssid" ]]; then
action=" Disconnect"
else
action="󰸋 Connect"
fi
action=$(echo -e "$action\n Forget" | rofi -dmenu -p "Action: " -mesg "$chosen_option" -theme-str 'inputbar {enabled: false;} window {height: 200px;}')
case $action in
"󰸋 Connect")
local saved_connections=$(nmcli -g NAME connection show)
if [[ $(echo "$saved_connections" | grep -Fx "$chosen_id") ]]; then
nmcli connection up id "$chosen_id" | grep "successfully" && notify-send "Connected" "$chosen_id"
else
local wifi_password=$(rofi -dmenu -p "Password: " -password -theme-str 'window {height: 110px;} entry {placeholder: "Password:";} textbox-prompt-colon {enabled: false;}')
nmcli device wifi connect "$chosen_id" password "$wifi_password" | grep "successfully" && notify-send "Connected" "$chosen_id"
fi
;;
" Disconnect")
nmcli device disconnect $wifi_device && notify-send "Disconnected" "$chosen_id"
;;
" Forget")
nmcli connection delete id "$chosen_id" && notify-send "Forgotten" "$chosen_id"
;;
esac
fi
}
if [ -z "$@" ]; then
main_menu_options
elif [ "$@" == " Rescan" ]; then
notify-send "Scaning Networks" "Please wait"
dir=$(dirname "$0")
coproc (list_wifi)
elif [ "$@" == "󰖪 No wifi device available" ]; then
:
else
dir=$(dirname "$0")
coproc (manage_wifi "$@")
fi

View File

@@ -0,0 +1,3 @@
#!/bin/bash
dir=$(dirname "$0")
rofi -combi-mody " "," " -modi " ":$dir/network-manager.sh," ":$dir/vpn-manager.sh -show " "

View File

@@ -0,0 +1,3 @@
#!/bin/bash
dir=$(dirname "$0")
rofi -modi " ":$dir/vpn-manager.sh -show " "

View File

@@ -0,0 +1,93 @@
#!/bin/bash
# Checking if programms are available
case x"$@" in
x" Stop wireguard")
coproc (wg-quick down wg0 >/dev/null 2>&1) &
exit 0
;;
x" Start wireguard")
coproc (wg-quick up wg0 >/dev/null 2>&1) &
exit 0
;;
x" Stop netbird")
coproc (netbird down >/dev/null 2>&1) &
exit 0
;;
x" Start netbird")
coproc (netbird up >/dev/null 2>&1) &
exit 0
;;
x" Stop sing-box")
coproc (sudo systemctl stop sing-box >/dev/null 2>&1) &
exit 0
;;
x" Start sing-box")
coproc (sudo systemctl start sing-box >/dev/null 2>&1) &
exit 0
;;
esac
# Checking if programms are installed
wireguard_installed=true
if ! command -v wg-quick >/dev/null 2>&1; then
wireguard_installed=false
else
wireguard_installed=true
fi
netbird_installed=true
if ! command -v netbird >/dev/null 2>&1; then
netbird_installed=false
else
netbird_installed=true
fi
sing_box_installed=true
if ! systemctl list-unit-files -q sing-box.service >/dev/null 2>&1; then
sing_box_installed=false
else
sing_box_installed=true
fi
# active param
active="\0active\x1f"
# netbird
if $wireguard_installed; then
wireguard_status=$(sudo wg show interfaces)
if [ "$wireguard_status" != "wg0" ]; then
echo " Start wireguard"
else
active+="0"
echo " Stop wireguard"
fi
else
echo " Wireguard not installed"
fi
# netbird
if $netbird_installed; then
netbird_status=$(netbird status | grep "Networks" | cut -d: -f2 | sed "s/ -//")
if [ -z "$netbird_status" ]; then
echo " Start netbird"
else
active+="1"
echo " Stop netbird"
fi
else
echo " Netbird not installed"
fi
# sing-box
if $sing_box_installed; then
if systemctl status sing-box >/dev/null 2>&1; then
active+="2"
echo " Stop sing-box"
else
echo " Start sing-box"
fi
else
echo " Sing-box not installed"
fi
echo -en "$active\n"

View File

@@ -0,0 +1,41 @@
#!/usr/bin/bash
menu_content() {
echo -en "\0message\x1f Power menu\n"
echo "󰌾 Lock session"
echo "󰒲 Sleep"
echo " Shutdown"
echo " Reboot"
echo "󰜺 Cancel"
}
handle_selection() {
case x"$@" in
x"󰌾 Lock session")
coproc ($HOME/.config/hypr/scripts/hyprlock.sh >/dev/null 2>&1)
;;
x"󰒲 Sleep")
systemctl sleep
;;
x" Shutdown")
shutdown now
;;
x" Reboot")
reboot
;;
x"󰜺 Cancel")
exit 0
;;
esac
}
if [ -n "$ROFI_RETV" ]; then
# ROFI_RETV=0 - show menu, ROFI_RETV=1 - selection made
if [ "$ROFI_RETV" -eq 0 ]; then
menu_content
elif [ "$ROFI_RETV" -eq 1 ]; then
handle_selection "$1"
fi
else
rofi -show quit -modi "quit:$0" -theme-str "inputbar {enabled: false;} window {height: 310px;}"
fi

9
.config/rofi/rofi.cfg Normal file
View File

@@ -0,0 +1,9 @@
# rofi.kb-row-up: Up,Control+k,Shift+Tab,Shift+ISO_Left_Tab
# rofi.kb-row-down: Down,Control+j
rofi.kb-accept-entry: Control+m,Return,KP_Enter
rofi.terminal: mate-terminal
rofi.kb-remove-to-eol: Control+Shift+e
rofi.kb-mode-complete: Control+Shift+t
rofi.kb-mode-next: Shift+Right,Control+Tab,Control+l
rofi.kb-mode-previous: Shift+Left,Control+Shift+Tab,Control+h
rofi.kb-remove-char-back: BackSpace