Compare commits

..

5 commits

4 changed files with 79 additions and 48 deletions

View file

@ -1,18 +1,23 @@
# Modular sourcing
######################################################################################## $confDir = ~/.config/hypr/hyprland.conf.d
AUTOGENERATED HYPR CONFIG. # Load plugins first
PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT, source = $confDir/plugins.conf
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/ # See https://wiki.hyprland.org/Configuring/Monitors/
monitor=,preferred,auto,1 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 # unscale XWayland
xwayland { xwayland {
force_zero_scaling = true force_zero_scaling = true
@ -20,12 +25,6 @@ xwayland {
# See https://wiki.hyprland.org/Configuring/Keywords/ for more # 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/ # For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input { input {
kb_layout = fr kb_layout = fr
@ -43,18 +42,6 @@ input {
sensitivity = 0 # -1.0 - 1.0, 0 means no modification. 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 { decoration {
# See https://wiki.hyprland.org/Configuring/Variables/ for more # See https://wiki.hyprland.org/Configuring/Variables/ for more
@ -125,8 +112,6 @@ device:epic-mouse-v1 {
$terminal = alacritty $terminal = alacritty
# Modular sourcing # Modular sourcing
$confDir = ~/.config/hypr/hyprland.conf.d
source = $confDir/plugins.conf
source = $confDir/environment.conf source = $confDir/environment.conf
source = $confDir/bindings.conf source = $confDir/bindings.conf
source = $confDir/windowrules.conf source = $confDir/windowrules.conf

View file

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

View file

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

68
sync
View file

@ -3,12 +3,28 @@
import os import os
import argparse 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( parser = argparse.ArgumentParser(
prog="Dotfiles sync", prog="Dotfiles sync",
description="Saves and restores my dotfiles", description="Saves and restores my dotfiles",
) )
parser.add_argument("action", choices=["save", "restore"]) 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 = [ synced_files = [
("editor/helix/", "~/.config/helix/"), ("editor/helix/", "~/.config/helix/"),
@ -45,22 +61,54 @@ synced_files = [
] ]
def save(): def save(fd: tuple[str, str]):
for p in synced_files: folder = "/".join(fd[0].split("/")[0:-1])
folder = "/".join(p[0].split("/")[0:-1])
if not os.path.exists(folder): if not os.path.exists(folder):
os.mkdir(folder) os.mkdir(folder)
os.system(f"rsync -r {p[1]} {p[0]}") os.system(f"rsync -r {fd[1]} {fd[0]}")
def restore(): def restore(fd: tuple[str, str]):
for p in synced_files: os.system(f"rsync -r {fd[0]} {fd[1]}")
os.system(f"rsync -r {p[0]} {p[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
if __name__ == "__main__": if __name__ == "__main__":
args = parser.parse_args() 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": if args.action == "save":
save() save(synced_files[i])
elif args.action == "restore": elif args.action == "restore":
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")