Compare commits

..

No commits in common. "aefc1a93ad5ed65688bfe4afda5f132e8c496274" and "e78180c263d4a480ab6d56739fcbbd899b80b8a4" have entirely different histories.

5 changed files with 10 additions and 117 deletions

View File

@ -200,11 +200,11 @@
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1687002145,
"narHash": "sha256-xJCwdtxIFDImx4XsVzWns8jzh6htcvWhjdrVDNZfjTg=",
"lastModified": 1686925761,
"narHash": "sha256-H+i0VQvc2gx/QUCRNFoLZmHmCDITMQiF9zkDLj0pYCc=",
"owner": "hyprwm",
"repo": "contrib",
"rev": "fa0b667ef28c0f7e597f916eadb3f8bef48d9ef8",
"rev": "fd07e8b82042c0d2ca0c492df2b8f4854573c7d0",
"type": "github"
},
"original": {

View File

@ -281,11 +281,7 @@
};
};
in {
packages = let
writePython311Script =
pkgs.writers.makePythonWriter pkgs.python311 pkgs.python311Packages
pkgs.buildPackages.python311Packages;
in flake-utils.lib.flattenTree {
packages = flake-utils.lib.flattenTree {
discordWayland = pkgs.callPackage ./packages/discord/default.nix rec {
pname = "discord-electron";
binaryName = "DiscordCanary";
@ -301,19 +297,6 @@
swayimg = pkgs.callPackage ./packages/swayimg/default.nix { };
hyprland-autoname-workspaces =
pkgs.callPackage ./packages/workspace-renamer/default.nix { };
shortcuts = let
script = writePython311Script "shortcuts" { }
(builtins.readFile ./scripts/shortcuts/shortcuts.py);
in pkgs.stdenv.mkDerivation {
name = "shortcuts";
src = ./shortcuts;
installPhase = ''
mkdir -p $out/bin
ln -s ${script} $out/bin/shortcuts
mkdir -p $out/shortcuts
cp -r * $out/shortcuts
'';
};
};
});
}

View File

@ -10,7 +10,6 @@ in with lib; {
fuzzel -f "Iosevka Sans Quasi" -b "181818dd" -S "b9b9b9ff" -s "252525dd" -t "777777ff" -B 5 -r 5 -C "70b433dd"'';
notif-package =
inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.swaynotificationcenter;
shortcuts = inputs.self.packages.${pkgs.system}.shortcuts;
in {
home.packages = with pkgs; [
# General
@ -192,8 +191,8 @@ in with lib; {
bind = , xf86audiomute, exec, swayosd --output-volume mute-toggle
# Screenshots
bind = , print, exec, grimblast --scale 1 copysave area ~/Pictures/Screenshots/$(date -Iseconds).png
bind = SHIFT, print, exec, grimblast --scale 1 copysave output ~/Pictures/Screenshots/$(date -Iseconds).png
bind = , print, exec, grimblast copysave area ~/Pictures/Screenshots/$(date -Iseconds).png
bind = SHIFT, print, exec, grimblast copysave output ~/Pictures/Screenshots/$(date -Iseconds).png
# Caps lock indicator
bindr = CAPS, caps_lock, exec, swayosd --caps-lock
@ -204,14 +203,11 @@ in with lib; {
# Notif bind
bind = $mainMod, T, exec, swaync-client -t -sw
# Shortcut dispatcher
bind = $mainMod, W, exec, ${shortcuts}/bin/shortcuts ~/.config/shortcuts/shortcuts.toml
## Window rules
# Gamescope - vmware
windowrulev2 = float,class:^(.gamescope-wrapped)$,title:VMware Workstation
windowrulev2 = noborder,class:^(.gamescope-wrapped)$,title:VMware Workstation
windowrulev2 = rounding 0,class:^(.gamescope-wrapped)$,title:VMware Workstation
# Gamescope
windowrulev2 = float,class:^(.gamescope-wrapped)$
windowrulev2 = noborder,class:^(.gamescope-wrapped)$
windowrulev2 = rounding 0,class:^(.gamescope-wrapped)$
# Clipboard history management
exec-once=wl-paste --watch cliphist store
@ -260,19 +256,6 @@ in with lib; {
};
Install = { WantedBy = [ "graphical-session.target" ]; };
};
# Shortcut dispatcher
xdg.configFile."shortcuts/shortcuts.toml" = {
text = ''
directories = ["~/.config/shortcuts/shortcuts", "${shortcuts}/shortcuts"]
picker_command = "${
builtins.replaceStrings [ ''"'' ] [ ''\"'' ] fuzzel-command
} --dmenu"
'';
onChange = ''
mkdir -p ~/.config/shortcuts/shortcuts
'';
};
#########################
## SwayNotificationCenter (notifications)
#########################

View File

@ -1,68 +0,0 @@
# https://blog.stigok.com/2019/11/05/packing-python-script-binary-nicely-in-nixos.html
import argparse
import tomllib
import os
import subprocess
import sys
from pathlib import Path
def parse_directory(directory):
dictionary = {}
for entry in os.listdir(directory):
path = directory / entry
if path.is_dir():
dictionary[entry] = parse_directory(path)
else:
dictionary[entry] = path
return dictionary
def merge(dict1, dict2):
for key in iter(dict2):
if key in dict1:
if isinstance(dict1[key], dict) and isinstance(dict2[key], dict):
merge(dict1[key], dict2[key])
else:
dict1[key] = dict2[key]
else:
dict1[key] = dict2[key]
parser = argparse.ArgumentParser(prog='shortcuts.py',
description="shortcut dispatcher")
parser.add_argument('config')
args = parser.parse_args()
data = ""
with open(args.config, 'rb') as f:
data = tomllib.load(f)
dicts = []
for dir in data["directories"]:
path = Path(dir).expanduser()
if path.exists():
dicts.append(parse_directory(path))
res = {}
for d in dicts:
merge(res, d)
while isinstance(res, dict):
items = '\n'.join(sorted(res))
proc = subprocess.Popen(data["picker_command"],
shell=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
proc.stdin.write(str.encode(items))
outs, errs = proc.communicate()
outs = outs.decode().strip()
res = res[outs]
proc = subprocess.Popen(res,
stdin=sys.stdin.buffer,
stdout=sys.stdout.buffer,
stderr=sys.stderr.buffer)
proc.wait()

View File

@ -1,5 +0,0 @@
#!/usr/bin/env bash
hyprctl dispatch exec -- "[float;size 1829 1029] gamescope -W 2560 -w 2560 -H 1440 -h 1440 --scaler integer --force-windows-fullscreen -- vmware"
wait