Compare commits

..

No commits in common. "1724222a6c68260bab7ae0336730840d29400707" and "9e057fbfe0e8304a2f5e6076cdf71d5a446530c9" have entirely different histories.

4 changed files with 48 additions and 79 deletions

View file

@ -1,23 +1,18 @@
# Modular sourcing
$confDir = ~/.config/hypr/hyprland.conf.d
# Load plugins first
source = $confDir/plugins.conf
########################################################################################
AUTOGENERATED HYPR CONFIG.
PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT,
OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS.
########################################################################################
#
# Please note not all available settings / options are set here.
# For a full list, see the wiki
#
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=,preferred,auto,1
general {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
gaps_in = 5
gaps_out = 20
border_size = 2
col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
col.inactive_border = rgba(595959aa)
layout = hy3
}
# unscale XWayland
xwayland {
force_zero_scaling = true
@ -25,6 +20,12 @@ xwayland {
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
# Execute your favorite apps at launch
# exec-once = waybar & hyprpaper & firefox
# Source a file (multi-file configs)
# source = ~/.config/hypr/myColors.conf
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
kb_layout = fr
@ -42,6 +43,18 @@ input {
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}
general {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
gaps_in = 5
gaps_out = 20
border_size = 2
col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
col.inactive_border = rgba(595959aa)
layout = hy3
}
decoration {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
@ -112,6 +125,8 @@ device:epic-mouse-v1 {
$terminal = alacritty
# Modular sourcing
$confDir = ~/.config/hypr/hyprland.conf.d
source = $confDir/plugins.conf
source = $confDir/environment.conf
source = $confDir/bindings.conf
source = $confDir/windowrules.conf

View file

@ -3,7 +3,7 @@ $mainMod = SUPER
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, RETURN, exec, $terminal
bind = $mainMod, Q, killactive,
bind = $mainMod, Q, hy3:killactive,
bind = $mainMod SHIFT, Q, exit,
bind = $mainMod, N, exec, thunar
bind = $mainMod, M, exec, prismlauncher

View file

@ -10,6 +10,8 @@ plugin {
autotile {
enable = true
trigger_width = 800
trigger_height = 500
}
}
}

76
sync
View file

@ -3,28 +3,12 @@
import os
import argparse
# https://stackoverflow.com/a/287944
class bcolors:
BLUE = "\033[94m"
GREEN = "\033[92m"
PURPLE = "\033[95m"
ENDC = "\033[0m"
BOLD = "\033[1m"
UNDERLINE = "\033[4m"
parser = argparse.ArgumentParser(
prog="Dotfiles sync",
description="Saves and restores my dotfiles",
)
parser.add_argument("action", choices=["save", "restore"])
parser.add_argument(
"-s",
"--select",
help="Select the files and folders to sync",
action="store_true",
)
synced_files = [
("editor/helix/", "~/.config/helix/"),
@ -61,54 +45,22 @@ synced_files = [
]
def save(fd: tuple[str, str]):
folder = "/".join(fd[0].split("/")[0:-1])
if not os.path.exists(folder):
os.mkdir(folder)
os.system(f"rsync -r {fd[1]} {fd[0]}")
def save():
for p in synced_files:
folder = "/".join(p[0].split("/")[0:-1])
if not os.path.exists(folder):
os.mkdir(folder)
os.system(f"rsync -r {p[1]} {p[0]}")
def restore(fd: tuple[str, str]):
os.system(f"rsync -r {fd[0]} {fd[1]}")
def list_files(reverse: bool = False) -> list[int]:
len_len = len(str(len(synced_files)))
for i, f in enumerate(synced_files):
i = str(i)
i = " " * (len_len - len(i)) + i
print(
f"{bcolors.PURPLE}{i} {bcolors.GREEN}{f[int(reverse)]} {bcolors.ENDC}-> {bcolors.GREEN}{f[int(not reverse)]}{bcolors.ENDC}"
)
user_action = input(
f"{bcolors.BOLD}{bcolors.BLUE}::{bcolors.ENDC} {bcolors.BOLD}Files to sync (eg: 1 2 3, 1-3):\n{bcolors.BLUE}::{bcolors.ENDC} "
)
# Parse input
out = []
if user_action.count("-") == 0:
out = list(map(lambda x: int(x), user_action.split()))
elif user_action.count("-") == 1:
out = list(range(*map(lambda x: int(x), user_action.split("-"))))
out += [out[-1] + 1]
else:
raise Exception("Invalid user input")
return out
def restore():
for p in synced_files:
os.system(f"rsync -r {p[0]} {p[1]}")
if __name__ == "__main__":
args = parser.parse_args()
msg = ""
r = list_files(args.action == "save") if args.select else range(len(synced_files))
for ri, i in enumerate(r):
if args.action == "save":
save(synced_files[i])
elif args.action == "restore":
restore(synced_files[i])
print(" " * len(msg), end="\r")
index = "0" * (len(str(len(r))) - len(str(ri + 1))) + str(ri + 1)
msg = f"[{index}/{len(r)}] Synced {synced_files[i]}"
print(msg, end="\r")
if args.action == "save":
save()
elif args.action == "restore":
restore()