This commit is contained in:
parent
00bebbe34a
commit
f427907563
13 changed files with 95 additions and 71 deletions
56
home/ui.nix
56
home/ui.nix
|
|
@ -30,7 +30,7 @@ in
|
|||
nerd-fonts.caskaydia-cove
|
||||
cascadia-code
|
||||
inter
|
||||
emojione
|
||||
joypixels
|
||||
|
||||
bluetuith
|
||||
keepmenu
|
||||
|
|
@ -54,6 +54,12 @@ in
|
|||
})
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfreePredicate = pkg:
|
||||
builtins.elem (lib.getName pkg) [
|
||||
"joypixels"
|
||||
];
|
||||
nixpkgs.config.joypixels.acceptLicense = true;
|
||||
|
||||
home.file = {
|
||||
".config/kitty/light.conf".source = dotfiles/kitty/light.conf;
|
||||
".config/kitty/dark.conf".source = dotfiles/kitty/dark.conf;
|
||||
|
|
@ -87,7 +93,52 @@ in
|
|||
subprocess.call(cmd, shell=True)
|
||||
'';
|
||||
|
||||
".bin/screenshot".source = (import ./bin/screenshot.nix) pkgs;
|
||||
".bin/screenshot".source = pkgs.writers.writePython3 "screenshot" { flakeIgnore = [ "E501" ];} ''
|
||||
import subprocess
|
||||
import re
|
||||
|
||||
options = """\
|
||||
a selected area (copy)
|
||||
current window (copy)
|
||||
full screen (copy)
|
||||
a selected area
|
||||
current window
|
||||
full screen
|
||||
viewer
|
||||
"""
|
||||
|
||||
cmd = '${config.programs.rofi.package}/bin/rofi -dmenu -location 2 -l 7 -i -p "Screenshot which area?"'
|
||||
result = subprocess.run(cmd,
|
||||
input=options,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
shell=True,
|
||||
text=True)
|
||||
|
||||
if result.returncode != 0:
|
||||
exit(1)
|
||||
|
||||
choice = result.stdout.strip()
|
||||
cmd = "${pkgs.pkgs.sway-contrib.grimshot}/bin/grimshot "
|
||||
if choice == "viewer":
|
||||
filename = subprocess.getoutput("mktemp")
|
||||
cmd += f"save area {filename}"
|
||||
else:
|
||||
cmd += "copy " if re.match(".*(copy)", choice) else "save "
|
||||
|
||||
for k, v in {"a selected area.*": "area ",
|
||||
"current window.*": "active ",
|
||||
"current screen.*": "output ",
|
||||
"all screens.*": "screen "}.items():
|
||||
if re.match(k, choice):
|
||||
cmd += v
|
||||
|
||||
subprocess.call(cmd,
|
||||
shell=True)
|
||||
|
||||
if choice == "viewer":
|
||||
subprocess.run(f"nsxiv -b {filename}", shell=True)
|
||||
'';
|
||||
|
||||
".bin/ocrzone".source = pkgs.writers.writeBash "ocrzone" ''
|
||||
${pkgs.pkgs.sway-contrib.grimshot}/bin/grimshot save area - | \
|
||||
|
|
@ -299,7 +350,6 @@ in
|
|||
|
||||
programs.rofi = {
|
||||
enable = true;
|
||||
package = pkgs.rofi-wayland;
|
||||
plugins = [ pkgs.rofi-calc pkgs.rofi-emoji ];
|
||||
theme = "theme.rasi";
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue