Mon Jun 3 01:00:53 AM CEST 2024

This commit is contained in:
Thomas Avé 2024-06-03 01:00:53 +02:00
parent 0483baf022
commit 0b1b9c1481
7 changed files with 61 additions and 76 deletions

View File

@ -8,6 +8,7 @@
./rofi
./alacritty
./firefox
./ssh
];
services.hyprpaper = {

View File

@ -15,6 +15,7 @@
programs.home-manager.enable = true;
home.packages = with pkgs; [
htop
waypipe
];

View File

@ -25,7 +25,19 @@ in
ExtensionSettings = {
"{c7c120ff-2878-4e59-a5a3-cd4d1655bc13}" = {
install_url = "file://${./files/signed.xpi}";
installation_mode = "force_installed";
installation_mode = "normal_installed";
};
"@contain-google" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/google-container/latest.xpi";
installation_mode = "normal_installed";
};
"{ea4204c0-3209-4116-afd2-2a208e21a779}" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/enable-bing-chat/latest.xpi";
installation_mode = "normal_installed";
};
"{3e4d2037-d300-4e95-859d-3cba866f46d3}" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/private-internet-access-ext/latest.xpi";
installation_mode = "normal_installed";
};
};
@ -44,11 +56,21 @@ in
ublock-origin
bitwarden
privacy-badger
beyond-20
display-_anchors
facebook-container
multi-account-containers
istilldontcareaboutcookies
return-youtube-dislikes
sponsorblock
unpaywall
vimium
];
settings = {
"browser.disableResetPrompt" = true;
"browser.download.panel.shown" = true;
"browser.shell.checkDefaultBrowser" = false;
"browser.tabs.inTitlebar" = 0;
"browser.shell.defaultBrowserCheckCount" = 1;
"browser.startup.homepage" = "https://start.duckduckgo.com";
"browser.compactmode.show" = true;

View File

@ -7,12 +7,22 @@ let
playerctl = "${pkgs.playerctl}/bin/playerctl";
wl-paste = "${pkgs.wl-clipboard}/bin/wl-paste";
hyprpaper = "${pkgs.hyprpaper}/bin/hyprpaper";
firefox = "${pkgs.firefox}/bin/firefox";
waybar = "${inputs.waybar.packages.${pkgs.system}.waybar}/bin/waybar";
wpctl = "${pkgs.wireplumber}/bin/wpctl";
alacritty = "${pkgs.alacritty}/bin/alacritty";
swaylock = "${pkgs.swaylock}/bin/swaylock";
rofi = "${pkgs.rofi}/bin/rofi";
jq = "${pkgs.jq}/bin/jq";
rofi-ykman = pkgs.writeShellScriptBin "rofi-ykman" ''
accounts=''$(${pkgs.yubikey-manager}/bin/ykman oath accounts list)
prompt="YubiKey OATH"
account=''$(echo "''${accounts/, TOTP/\n}" | awk '{ print $0 "\0icon\x1fyubioath"; }' | ${rofi} -dmenu -i -p "''$prompt" ''${shortcuts[@]})
code=''$(${pkgs.yubikey-manager}/bin/ykman oath accounts code "''$account")
IFS=', ' read -r -a code <<< "''$code"
echo -n "''${code[-1]}" | ${pkgs.wl-clipboard}/bin/wl-copy;
'';
launch_alacritty = pkgs.writeShellScriptBin "launch_alacritty" ''
RUNNING_WAYPIPE=false
SSH_CLIENT=""
@ -31,7 +41,6 @@ let
fi
fi
if [ $RUNNING_WAYPIPE == true ]; then
PREVIOUS_SESSION_ID=$(grep -z "SSH_SESSION_ID" "/proc/$CHILD_PID/environ" | xargs -0 -n 1 | grep -oP "[0-9]*")
SSH_SESSION_ID=$RANDOM
@ -57,6 +66,10 @@ in
indicator = true;
};
home.packages = with pkgs; [
wl-clipboard
];
services.hyprpaper = {
enable = true;
settings = {
@ -195,14 +208,14 @@ in
"$mainMod, Q, killactive,"
"$mainMod, A, exec, nautilus"
"$mainMod, S, exec, gnome-calendar"
"$mainMod, B, exec, MOZ_ENABLE_WAYLAND=1 firefox"
"$mainMod, B, exec, MOZ_ENABLE_WAYLAND=1 ${firefox}"
"$mainMod, M, fullscreen, 1"
"$mainMod, F11, fullscreen"
"$mainMod, F, togglefloating,"
"$mainMod, SPACE, togglesplit, # dwindle"
"CONTROL_L ALT_L, L, exec, ${swaylock}"
"$mainMod, C, exec, cliphist list | awk '{print $0, \"\0icon\x1fcom.github.davidmhewitt.clipped\"}' | ${rofi} -dmenu -display-columns 2 | cliphist decode | wl-copy"
"$mainMod, Y, exec, ${./files/rofi-ykman.sh}"
"$mainMod, Y, exec, ${rofi-ykman}/bin/rofi-ykman"
"$mainMod, N, exec, ${./files/rofi-ssh.sh}"
"$mainMod, Escape, exec, ${rofi} -show power-menu -modi power-menu:${./files/rofi-power-menu.sh}"

View File

@ -1,72 +0,0 @@
#!/usr/bin/env bash
# rofi-ykman
# YubiKey OATH utility
#2019 nukeop
print_usage() {
echo "Usage: rofi-ykman [command]"
echo
echo "Commands:"
echo " clipboard Copy the code to the clipboard. (default)"
echo " type Type the code."
echo
}
clipboard () {
if [ $XDG_SESSION_TYPE == "wayland" ]
then
wl-copy
else
xsel --clipboard
fi
}
type () {
if [ $XDG_SESSION_TYPE == "wayland" ]
then
wtype -
else
xargs xdotool type
fi
}
# shortcuts
type="Alt+1"
clipboard="Alt+2"
main() {
accounts=$(ykman oath accounts list)
shortcuts=(
-kb-custom-1 "$type"
-kb-custom-2 "$clipboard"
)
prompt="YubiKey OATH"
account=$(echo "${accounts/, TOTP/\n}" | awk '{ print $0 "\0icon\x1fyubioath"; }' | rofi -dmenu -i -p "$prompt" ${shortcuts[@]})
case $? in
1) exit ;;
10) command=type ;;
11) command=clipboard ;;
*) command=$default_command ;;
esac
code=$(ykman oath accounts code "$account")
IFS=', ' read -r -a code <<< "$code"
case $command in
clipboard) echo -n "${code[-1]}" | wl-copy;;
type) echo -n "${code[-1]}" | type;;
esac
}
default_command="${1:-clipboard}"
case $default_command in
clipboard|type) ;;
*) print_usage; exit 1;;
esac
main

16
home/ssh/default.nix Normal file
View File

@ -0,0 +1,16 @@
{ inputs, config, pkgs, ... }:
{
programs.ssh = {
enable = true;
matchBlocks = [
{
host = "Mallorea";
hostname = "10.1";
port = 22;
user = "server";
forwardAgent = true;
}
];
};
}

View File

@ -1,2 +1,6 @@
{inputs, pkgs, ...}:
{
services.pcscd.enable = true;
services.udev.packages = [ pkgs.yubikey-personalization ];
}