Compare commits
3 Commits
0d334efce3
...
b9abdfce4a
| Author | SHA1 | Date | |
|---|---|---|---|
| b9abdfce4a | |||
| 4f9eb34a55 | |||
| 5bef57fb16 |
20
flake.nix
20
flake.nix
@ -3,8 +3,14 @@
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
nixpkgs-droid = "github:NixOS/nixpkgs/nixos-24.05";
|
||||
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11";
|
||||
|
||||
home-manager-droid = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs-droid";
|
||||
};
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
@ -54,6 +60,12 @@
|
||||
ghostty = {
|
||||
url = "github:ghostty-org/ghostty";
|
||||
};
|
||||
|
||||
nix-on-droid = {
|
||||
url = "github:nix-community/nix-on-droid/release-24.05";
|
||||
inputs.nixpkgs.follows = "nixpkgs-droid";
|
||||
inputs.home-manager.follows = "home-manager-droid";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = {
|
||||
@ -127,5 +139,13 @@
|
||||
];
|
||||
};
|
||||
};
|
||||
nixOnDroidConfigurations = {
|
||||
tsunemori = inputs.nix-on-droid.lib.nixOnDroidConfiguration {
|
||||
pkgs = import inputs.nixpkgs-droid {system = "aarch64-linux";};
|
||||
modules = [
|
||||
./tsunemori/configuration.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@ -23,12 +23,10 @@
|
||||
};
|
||||
};
|
||||
|
||||
# Bootloader
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
|
||||
# System level configuration
|
||||
sys = {
|
||||
audio.enable = true;
|
||||
bootloader.systemd-boot.enable = true;
|
||||
desktop = {
|
||||
plasma.enable = false;
|
||||
gnome.enable = true;
|
||||
|
||||
@ -29,12 +29,10 @@
|
||||
];
|
||||
};
|
||||
|
||||
# Bootloader
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
|
||||
# System level configuration
|
||||
sys = {
|
||||
audio.enable = true;
|
||||
bootloader.systemd-boot.enable = true;
|
||||
desktop = {
|
||||
steamdeck.enable = true;
|
||||
};
|
||||
|
||||
@ -3,183 +3,312 @@
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
}: {
|
||||
options = {
|
||||
desktop.hyprland.rofi.clipboard.enable = lib.mkEnableOption "rofi-clipboard";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.desktop.hyprland.rofi.clipboard.enable {
|
||||
home.file = {
|
||||
".config/rofi/cliboard.rasi".source = ../../../../config/clipboard.rasi;
|
||||
".config/rofi/cliboard.rasi".text = let
|
||||
main-bg = config.lib.stylix.colors.base01;
|
||||
main-fg = config.lib.stylix.colors.base02;
|
||||
main-br = config.lib.stylix.colors.base05;
|
||||
main-ex = config.lib.stylix.colors.base09;
|
||||
select-bg = config.lib.stylix.colors.base05; # Selected background color
|
||||
select-fg = config.lib.stylix.colors.base11; # Selected text color
|
||||
separatorcolor = "transparent";
|
||||
border-color = "transparent";
|
||||
in ''
|
||||
// Config //
|
||||
configuration {
|
||||
modi: "drun";
|
||||
show-icons: false;
|
||||
}
|
||||
|
||||
* {
|
||||
main-bg : #${main-bg};
|
||||
main-fg : #${main-fg};
|
||||
main-br : #${main-br};
|
||||
main-ex : #${main-ex};
|
||||
select-bg : #${select-bg};
|
||||
select-fg : #${select-fg};
|
||||
separatorcolor : ${separatorcolor};
|
||||
border-color : ${border-color};
|
||||
}
|
||||
|
||||
// Main //
|
||||
window {
|
||||
width: 23em;
|
||||
height: 30em;
|
||||
transparency: "real";
|
||||
fullscreen: false;
|
||||
enabled: true;
|
||||
cursor: "default";
|
||||
spacing: 0em;
|
||||
padding: 0em;
|
||||
border-color: @main-br;
|
||||
background-color: @main-bg;
|
||||
}
|
||||
mainbox {
|
||||
enabled: true;
|
||||
spacing: 0em;
|
||||
padding: 0.5em;
|
||||
orientation: vertical;
|
||||
children: [ "wallbox" , "listbox" ];
|
||||
background-color: transparent;
|
||||
}
|
||||
wallbox {
|
||||
spacing: 0em;
|
||||
padding: 0em;
|
||||
expand: false;
|
||||
orientation: horizontal;
|
||||
background-color: transparent;
|
||||
background-image: url("~/.dotfiles/config/backgrounds/aurora_borealis.png", width);
|
||||
children: [ "wallframe" , "inputbar" ];
|
||||
}
|
||||
wallframe {
|
||||
width: 5em;
|
||||
spacing: 0em;
|
||||
padding: 0em;
|
||||
expand: false;
|
||||
background-color: @main-bg;
|
||||
background-image: url("~/.dotfiles/config/backgrounds/aurora_borealis.png", height);
|
||||
}
|
||||
|
||||
|
||||
// Inputs //
|
||||
inputbar {
|
||||
enabled: true;
|
||||
padding: 0em;
|
||||
children: [ "entry" ];
|
||||
background-color: @main-bg;
|
||||
expand: true;
|
||||
}
|
||||
entry {
|
||||
enabled: true;
|
||||
padding: 1.8em;
|
||||
text-color: @main-fg;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
|
||||
// Lists //
|
||||
listbox {
|
||||
spacing: 0em;
|
||||
padding: 0em;
|
||||
orientation: vertical;
|
||||
children: [ "dummy" , "listview" , "dummy" ];
|
||||
background-color: transparent;
|
||||
}
|
||||
listview {
|
||||
enabled: true;
|
||||
padding: 0.5em;
|
||||
columns: 1;
|
||||
lines: 11;
|
||||
cycle: true;
|
||||
fixed-height: true;
|
||||
fixed-columns: false;
|
||||
expand: false;
|
||||
cursor: "default";
|
||||
background-color: transparent;
|
||||
text-color: @main-fg;
|
||||
}
|
||||
dummy {
|
||||
spacing: 0em;
|
||||
padding: 0em;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
|
||||
// Elements //
|
||||
element {
|
||||
enabled: true;
|
||||
padding: 0.5em;
|
||||
cursor: pointer;
|
||||
background-color: transparent;
|
||||
text-color: @main-fg;
|
||||
}
|
||||
element selected.normal {
|
||||
background-color: @select-bg;
|
||||
text-color: @select-fg;
|
||||
}
|
||||
element-text {
|
||||
vertical-align: 0.0;
|
||||
horizontal-align: 0.0;
|
||||
cursor: inherit;
|
||||
background-color: transparent;
|
||||
text-color: inherit;
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
wl-clipboard
|
||||
cliphist
|
||||
(writeShellScriptBin "clipboard" ''
|
||||
export confDir="''${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||
roconf="''${confDir}/rofi/cliboard.rasi"
|
||||
favoritesFile="''${HOME}/.cliphist_favorites"
|
||||
export confDir="''${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||
roconf="''${confDir}/rofi/cliboard.rasi"
|
||||
favoritesFile="''${HOME}/.cliphist_favorites"
|
||||
|
||||
if printenv HYPRLAND_INSTANCE_SIGNATURE &> /dev/null; then
|
||||
export hypr_border="$(hyprctl -j getoption decoration:rounding | jq '.int')"
|
||||
export hypr_width="$(hyprctl -j getoption general:border_size | jq '.int')"
|
||||
fi
|
||||
if printenv HYPRLAND_INSTANCE_SIGNATURE &> /dev/null; then
|
||||
export hypr_border="$(hyprctl -j getoption decoration:rounding | jq '.int')"
|
||||
export hypr_width="$(hyprctl -j getoption general:border_size | jq '.int')"
|
||||
fi
|
||||
|
||||
# Set rofi scaling
|
||||
[[ "''${rofiScale}" =~ ^[0-9]+$ ]] || rofiScale=10
|
||||
r_scale="configuration {font: \"JetBrainsMono Nerd Font ''${rofiScale}\";}"
|
||||
wind_border=$((hypr_border * 3 / 2))
|
||||
elem_border=$([ $hypr_border -eq 0 ] && echo "5" || echo $hypr_border)
|
||||
# Set rofi scaling
|
||||
[[ "''${rofiScale}" =~ ^[0-9]+$ ]] || rofiScale=10
|
||||
r_scale="configuration {font: \"JetBrainsMono Nerd Font ''${rofiScale}\";}"
|
||||
wind_border=$((hypr_border * 3 / 2))
|
||||
elem_border=$([ $hypr_border -eq 0 ] && echo "5" || echo $hypr_border)
|
||||
|
||||
# Evaluate spawn position
|
||||
readarray -t curPos < <(hyprctl cursorpos -j | jq -r '.x,.y')
|
||||
readarray -t monRes < <(hyprctl -j monitors | jq '.[] | select(.focused==true) | .width,.height,.scale,.x,.y')
|
||||
readarray -t offRes < <(hyprctl -j monitors | jq -r '.[] | select(.focused==true).reserved | map(tostring) | join("\n")')
|
||||
monRes[2]="$(echo "''${monRes[2]}" | sed "s/\.//")"
|
||||
monRes[0]="$(( ''${monRes[0]} * 100 / ''${monRes[2]} ))"
|
||||
monRes[1]="$(( ''${monRes[1]} * 100 / ''${monRes[2]} ))"
|
||||
curPos[0]="$(( ''${curPos[0]} - ''${monRes[3]} ))"
|
||||
curPos[1]="$(( ''${curPos[1]} - ''${monRes[4]} ))"
|
||||
# Evaluate spawn position
|
||||
readarray -t curPos < <(hyprctl cursorpos -j | jq -r '.x,.y')
|
||||
readarray -t monRes < <(hyprctl -j monitors | jq '.[] | select(.focused==true) | .width,.height,.scale,.x,.y')
|
||||
readarray -t offRes < <(hyprctl -j monitors | jq -r '.[] | select(.focused==true).reserved | map(tostring) | join("\n")')
|
||||
monRes[2]="$(echo "''${monRes[2]}" | sed "s/\.//")"
|
||||
monRes[0]="$(( ''${monRes[0]} * 100 / ''${monRes[2]} ))"
|
||||
monRes[1]="$(( ''${monRes[1]} * 100 / ''${monRes[2]} ))"
|
||||
curPos[0]="$(( ''${curPos[0]} - ''${monRes[3]} ))"
|
||||
curPos[1]="$(( ''${curPos[1]} - ''${monRes[4]} ))"
|
||||
|
||||
if [ "''${curPos[0]}" -ge "$((monRes[0] / 2))" ] ; then
|
||||
x_pos="east"
|
||||
x_off="-$((monRes[0] - curPos[0] - offRes[2]))"
|
||||
else
|
||||
x_pos="west"
|
||||
x_off="$((curPos[0] - offRes[0]))"
|
||||
fi
|
||||
if [ "''${curPos[0]}" -ge "$((monRes[0] / 2))" ] ; then
|
||||
x_pos="east"
|
||||
x_off="-$((monRes[0] - curPos[0] - offRes[2]))"
|
||||
else
|
||||
x_pos="west"
|
||||
x_off="$((curPos[0] - offRes[0]))"
|
||||
fi
|
||||
|
||||
if [ "''${curPos[1]}" -ge "$((monRes[1] / 2))" ] ; then
|
||||
y_pos="south"
|
||||
y_off="-$((monRes[1] - curPos[1] - offRes[3]))"
|
||||
else
|
||||
y_pos="north"
|
||||
y_off="$((curPos[1] - offRes[1]))"
|
||||
fi
|
||||
if [ "''${curPos[1]}" -ge "$((monRes[1] / 2))" ] ; then
|
||||
y_pos="south"
|
||||
y_off="-$((monRes[1] - curPos[1] - offRes[3]))"
|
||||
else
|
||||
y_pos="north"
|
||||
y_off="$((curPos[1] - offRes[1]))"
|
||||
fi
|
||||
|
||||
r_override="window{location:''${x_pos} ''${y_pos};anchor:''${x_pos} ''${y_pos};x-offset:''${x_off}px;y-offset:''${y_off}px;border:''${hypr_width}px;border-radius:''${wind_border}px;} wallbox{border-radius:''${elem_border}px;} element{border-radius:''${elem_border}px;}"
|
||||
r_override="window{location:''${x_pos} ''${y_pos};anchor:''${x_pos} ''${y_pos};x-offset:''${x_off}px;y-offset:''${y_off}px;border:''${hypr_width}px;border-radius:''${wind_border}px;} wallbox{border-radius:''${elem_border}px;} element{border-radius:''${elem_border}px;}"
|
||||
|
||||
# Show main menu if no arguments are passed
|
||||
if [ $# -eq 0 ]; then
|
||||
main_action=$(echo -e "History\nDelete\nView Favorites\nManage Favorites\nClear History" | rofi -dmenu -theme-str "entry { placeholder: \"Choose action\";}" -theme-str "''${r_scale}" -theme-str "''${r_override}" -config "''${roconf}")
|
||||
else
|
||||
main_action="History"
|
||||
fi
|
||||
# Show main menu if no arguments are passed
|
||||
if [ $# -eq 0 ]; then
|
||||
main_action=$(echo -e "History\nDelete\nView Favorites\nManage Favorites\nClear History" | rofi -dmenu -theme-str "entry { placeholder: \"Choose action\";}" -theme-str "''${r_scale}" -theme-str "''${r_override}" -config "''${roconf}")
|
||||
else
|
||||
main_action="History"
|
||||
fi
|
||||
|
||||
case "''${main_action}" in
|
||||
"History")
|
||||
selected_item=$(cliphist list | rofi -dmenu -theme-str "entry { placeholder: \"History...\";}" -theme-str "''${r_scale}" -theme-str "''${r_override}" -config "''${roconf}")
|
||||
if [ -n "$selected_item" ]; then
|
||||
echo "$selected_item" | cliphist decode | wl-copy
|
||||
notify-send "Copied to clipboard."
|
||||
fi
|
||||
;;
|
||||
"Delete")
|
||||
selected_item=$(cliphist list | rofi -dmenu -theme-str "entry { placeholder: \"Delete...\";}" -theme-str "''${r_scale}" -theme-str "''${r_override}" -config "''${roconf}")
|
||||
if [ -n "$selected_item" ]; then
|
||||
echo "$selected_item" | cliphist delete
|
||||
notify-send "Deleted."
|
||||
fi
|
||||
;;
|
||||
"View Favorites")
|
||||
if [ -f "$favoritesFile" ] && [ -s "$favoritesFile" ]; then
|
||||
mapfile -t favorites < "$favoritesFile"
|
||||
decoded_lines=()
|
||||
for favorite in "''${favorites[@]}"; do
|
||||
decoded_favorite=$(echo "$favorite" | base64 --decode)
|
||||
single_line_favorite=$(echo "$decoded_favorite" | tr '\n' ' ')
|
||||
decoded_lines+=("$single_line_favorite")
|
||||
done
|
||||
selected_favorite=$(printf "%s\n" "''${decoded_lines[@]}" | rofi -dmenu -theme-str "entry { placeholder: \"View Favorites\";}" -theme-str "''${r_scale}" -theme-str "''${r_override}" -config "''${roconf}")
|
||||
if [ -n "$selected_favorite" ]; then
|
||||
index=$(printf "%s\n" "''${decoded_lines[@]}" | grep -nxF "$selected_favorite" | cut -d: -f1)
|
||||
if [ -n "$index" ]; then
|
||||
selected_encoded_favorite="''${favorites[$((index - 1))]}"
|
||||
echo "$selected_encoded_favorite" | base64 --decode | wl-copy
|
||||
notify-send "Copied to clipboard."
|
||||
else
|
||||
notify-send "Error: Selected favorite not found."
|
||||
fi
|
||||
fi
|
||||
else
|
||||
notify-send "No favorites."
|
||||
fi
|
||||
;;
|
||||
"Manage Favorites")
|
||||
manage_action=$(echo -e "Add to Favorites\nDelete from Favorites\nClear All Favorites" | rofi -dmenu -theme-str "entry { placeholder: \"Manage Favorites\";}" -theme-str "''${r_scale}" -theme-str "''${r_override}" -config "''${roconf}")
|
||||
case "''${main_action}" in
|
||||
"History")
|
||||
selected_item=$(cliphist list | rofi -dmenu -theme-str "entry { placeholder: \"History...\";}" -theme-str "''${r_scale}" -theme-str "''${r_override}" -config "''${roconf}")
|
||||
if [ -n "$selected_item" ]; then
|
||||
echo "$selected_item" | cliphist decode | wl-copy
|
||||
notify-send "Copied to clipboard."
|
||||
fi
|
||||
;;
|
||||
"Delete")
|
||||
selected_item=$(cliphist list | rofi -dmenu -theme-str "entry { placeholder: \"Delete...\";}" -theme-str "''${r_scale}" -theme-str "''${r_override}" -config "''${roconf}")
|
||||
if [ -n "$selected_item" ]; then
|
||||
echo "$selected_item" | cliphist delete
|
||||
notify-send "Deleted."
|
||||
fi
|
||||
;;
|
||||
"View Favorites")
|
||||
if [ -f "$favoritesFile" ] && [ -s "$favoritesFile" ]; then
|
||||
mapfile -t favorites < "$favoritesFile"
|
||||
decoded_lines=()
|
||||
for favorite in "''${favorites[@]}"; do
|
||||
decoded_favorite=$(echo "$favorite" | base64 --decode)
|
||||
single_line_favorite=$(echo "$decoded_favorite" | tr '\n' ' ')
|
||||
decoded_lines+=("$single_line_favorite")
|
||||
done
|
||||
selected_favorite=$(printf "%s\n" "''${decoded_lines[@]}" | rofi -dmenu -theme-str "entry { placeholder: \"View Favorites\";}" -theme-str "''${r_scale}" -theme-str "''${r_override}" -config "''${roconf}")
|
||||
if [ -n "$selected_favorite" ]; then
|
||||
index=$(printf "%s\n" "''${decoded_lines[@]}" | grep -nxF "$selected_favorite" | cut -d: -f1)
|
||||
if [ -n "$index" ]; then
|
||||
selected_encoded_favorite="''${favorites[$((index - 1))]}"
|
||||
echo "$selected_encoded_favorite" | base64 --decode | wl-copy
|
||||
notify-send "Copied to clipboard."
|
||||
else
|
||||
notify-send "Error: Selected favorite not found."
|
||||
fi
|
||||
fi
|
||||
else
|
||||
notify-send "No favorites."
|
||||
fi
|
||||
;;
|
||||
"Manage Favorites")
|
||||
manage_action=$(echo -e "Add to Favorites\nDelete from Favorites\nClear All Favorites" | rofi -dmenu -theme-str "entry { placeholder: \"Manage Favorites\";}" -theme-str "''${r_scale}" -theme-str "''${r_override}" -config "''${roconf}")
|
||||
|
||||
case "''${manage_action}" in
|
||||
"Add to Favorites")
|
||||
item=$(cliphist list | rofi -dmenu -theme-str "entry { placeholder: \"Add to Favorites...\";}" -theme-str "''${r_scale}" -theme-str "''${r_override}" -config "''${roconf}")
|
||||
if [ -n "$item" ]; then
|
||||
full_item=$(echo "$item" | cliphist decode)
|
||||
encoded_item=$(echo "$full_item" | base64 -w 0)
|
||||
if grep -Fxq "$encoded_item" "$favoritesFile"; then
|
||||
notify-send "Item is already in favorites."
|
||||
else
|
||||
echo "$encoded_item" >> "$favoritesFile"
|
||||
notify-send "Added in favorites."
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
"Delete from Favorites")
|
||||
if [ -f "$favoritesFile" ] && [ -s "$favoritesFile" ]; then
|
||||
mapfile -t favorites < "$favoritesFile"
|
||||
decoded_lines=()
|
||||
for favorite in "''${favorites[@]}"; do
|
||||
decoded_favorite=$(echo "$favorite" | base64 --decode)
|
||||
single_line_favorite=$(echo "$decoded_favorite" | tr '\n' ' ')
|
||||
decoded_lines+=("$single_line_favorite")
|
||||
done
|
||||
selected_favorite=$(printf "%s\n" "''${decoded_lines[@]}" | rofi -dmenu -theme-str "entry { placeholder: \"Remove from Favorites...\";}" -theme-str "''${r_scale}" -theme-str "''${r_override}" -config "''${roconf}")
|
||||
if [ -n "$selected_favorite" ]; then
|
||||
index=$(printf "%s\n" "''${decoded_lines[@]}" | grep -nxF "$selected_favorite" | cut -d: -f1)
|
||||
if [ -n "$index" ]; then
|
||||
selected_encoded_favorite="''${favorites[$((index - 1))]}"
|
||||
if [ "$(wc -l < "$favoritesFile")" -eq 1 ]; then
|
||||
> "$favoritesFile"
|
||||
else
|
||||
grep -vF -x "$selected_encoded_favorite" "$favoritesFile" > "''${favoritesFile}.tmp" && mv "''${favoritesFile}.tmp" "$favoritesFile"
|
||||
fi
|
||||
notify-send "Item removed from favorites."
|
||||
else
|
||||
notify-send "Error: Selected favorite not found."
|
||||
fi
|
||||
fi
|
||||
else
|
||||
notify-send "No favorites to remove."
|
||||
fi
|
||||
;;
|
||||
"Clear All Favorites")
|
||||
if [ -f "$favoritesFile" ] && [ -s "$favoritesFile" ]; then
|
||||
confirm=$(echo -e "Yes\nNo" | rofi -dmenu -theme-str "entry { placeholder: \"Clear All Favorites?\";}" -theme-str "''${r_scale}" -theme-str "''${r_override}" -config "''${roconf}")
|
||||
if [ "$confirm" = "Yes" ]; then
|
||||
> "$favoritesFile"
|
||||
notify-send "All favorites have been deleted."
|
||||
fi
|
||||
else
|
||||
notify-send "No favorites to delete."
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Invalid action"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"Clear History")
|
||||
if [ "$(echo -e "Yes\nNo" | rofi -dmenu -theme-str "entry { placeholder: \"Clear Clipboard History?\";}" -theme-str "''${r_scale}" -theme-str "''${r_override}" -config "''${roconf}")" == "Yes" ] ; then
|
||||
cliphist wipe
|
||||
notify-send "Clipboard history cleared."
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Invalid action"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
case "''${manage_action}" in
|
||||
"Add to Favorites")
|
||||
item=$(cliphist list | rofi -dmenu -theme-str "entry { placeholder: \"Add to Favorites...\";}" -theme-str "''${r_scale}" -theme-str "''${r_override}" -config "''${roconf}")
|
||||
if [ -n "$item" ]; then
|
||||
full_item=$(echo "$item" | cliphist decode)
|
||||
encoded_item=$(echo "$full_item" | base64 -w 0)
|
||||
if grep -Fxq "$encoded_item" "$favoritesFile"; then
|
||||
notify-send "Item is already in favorites."
|
||||
else
|
||||
echo "$encoded_item" >> "$favoritesFile"
|
||||
notify-send "Added in favorites."
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
"Delete from Favorites")
|
||||
if [ -f "$favoritesFile" ] && [ -s "$favoritesFile" ]; then
|
||||
mapfile -t favorites < "$favoritesFile"
|
||||
decoded_lines=()
|
||||
for favorite in "''${favorites[@]}"; do
|
||||
decoded_favorite=$(echo "$favorite" | base64 --decode)
|
||||
single_line_favorite=$(echo "$decoded_favorite" | tr '\n' ' ')
|
||||
decoded_lines+=("$single_line_favorite")
|
||||
done
|
||||
selected_favorite=$(printf "%s\n" "''${decoded_lines[@]}" | rofi -dmenu -theme-str "entry { placeholder: \"Remove from Favorites...\";}" -theme-str "''${r_scale}" -theme-str "''${r_override}" -config "''${roconf}")
|
||||
if [ -n "$selected_favorite" ]; then
|
||||
index=$(printf "%s\n" "''${decoded_lines[@]}" | grep -nxF "$selected_favorite" | cut -d: -f1)
|
||||
if [ -n "$index" ]; then
|
||||
selected_encoded_favorite="''${favorites[$((index - 1))]}"
|
||||
if [ "$(wc -l < "$favoritesFile")" -eq 1 ]; then
|
||||
> "$favoritesFile"
|
||||
else
|
||||
grep -vF -x "$selected_encoded_favorite" "$favoritesFile" > "''${favoritesFile}.tmp" && mv "''${favoritesFile}.tmp" "$favoritesFile"
|
||||
fi
|
||||
notify-send "Item removed from favorites."
|
||||
else
|
||||
notify-send "Error: Selected favorite not found."
|
||||
fi
|
||||
fi
|
||||
else
|
||||
notify-send "No favorites to remove."
|
||||
fi
|
||||
;;
|
||||
"Clear All Favorites")
|
||||
if [ -f "$favoritesFile" ] && [ -s "$favoritesFile" ]; then
|
||||
confirm=$(echo -e "Yes\nNo" | rofi -dmenu -theme-str "entry { placeholder: \"Clear All Favorites?\";}" -theme-str "''${r_scale}" -theme-str "''${r_override}" -config "''${roconf}")
|
||||
if [ "$confirm" = "Yes" ]; then
|
||||
> "$favoritesFile"
|
||||
notify-send "All favorites have been deleted."
|
||||
fi
|
||||
else
|
||||
notify-send "No favorites to delete."
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Invalid action"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"Clear History")
|
||||
if [ "$(echo -e "Yes\nNo" | rofi -dmenu -theme-str "entry { placeholder: \"Clear Clipboard History?\";}" -theme-str "''${r_scale}" -theme-str "''${r_override}" -config "''${roconf}")" == "Yes" ] ; then
|
||||
cliphist wipe
|
||||
notify-send "Clipboard history cleared."
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Invalid action"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
'')
|
||||
];
|
||||
};
|
||||
|
||||
@ -136,15 +136,18 @@
|
||||
extensions = with inputs.firefox-addons.packages."x86_64-linux";
|
||||
[
|
||||
ublock-origin
|
||||
# Lists all possible extensions $ nix-env -f '<nixpkgs>' -qaP -A nur.repos.rycee.firefox-addons
|
||||
]
|
||||
++ (
|
||||
if (userSettings.username == "shinya")
|
||||
then [
|
||||
inputs.firefox-addons.packages."x86_64-linux".simple-translate
|
||||
inputs.firefox-addons.packages."x86_64-linux".duckduckgo-privacy-essentials
|
||||
inputs.firefox-addons.packages."x86_64-linux".return-youtube-dislikes
|
||||
inputs.firefox-addons.packages."x86_64-linux".user-agent-string-switcher
|
||||
]
|
||||
then
|
||||
with inputs.firefox-addons.packages."x86_64-linux"; [
|
||||
#enhancer-for-youtube
|
||||
simple-translate
|
||||
duckduckgo-privacy-essentials
|
||||
return-youtube-dislikes
|
||||
user-agent-string-switcher
|
||||
]
|
||||
else []
|
||||
);
|
||||
};
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
userSettings,
|
||||
...
|
||||
}: {
|
||||
|
||||
12
nixos/system/settings/bootloader.nix
Normal file
12
nixos/system/settings/bootloader.nix
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
}: {
|
||||
options = {
|
||||
sys.bootloader.systemd.enable = lib.mkEnableOption "Enable systemd-boot as the bootloader";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.sys.bootloader.systemd.enable {
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
};
|
||||
}
|
||||
@ -15,12 +15,14 @@
|
||||
./settings/loginManager.nix
|
||||
./settings/style.nix
|
||||
./settings/default-applications.nix
|
||||
./settings/bootloader.nix
|
||||
|
||||
./settings/user.nix
|
||||
];
|
||||
|
||||
sys = {
|
||||
audio.enable = lib.mkDefault true;
|
||||
bootloader.systemd-boot.enable = lib.mkDefault true;
|
||||
desktop = {
|
||||
plasma.enable =
|
||||
if userSettings.plasma == true
|
||||
|
||||
87
tsunemori/configuration.nix
Normal file
87
tsunemori/configuration.nix
Normal file
@ -0,0 +1,87 @@
|
||||
{pkgs, ...}: {
|
||||
imports = [
|
||||
../nixos/system/packages.nix
|
||||
../nixos/system/system.nix
|
||||
];
|
||||
|
||||
nix.extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
'';
|
||||
|
||||
home-manager = {
|
||||
config = ./home.nix;
|
||||
backupFileExtension = "hm-bak";
|
||||
useGlobalPkgs = true;
|
||||
};
|
||||
|
||||
sys = {
|
||||
audio.enable = false;
|
||||
bootloader.systemd-boot.enable = false;
|
||||
desktop = {
|
||||
steamdeck.enable = false;
|
||||
};
|
||||
fonts.packages = false;
|
||||
locales.enable = true;
|
||||
network.enable = false;
|
||||
bluetooth = {
|
||||
enable = false;
|
||||
blueman.enable = false;
|
||||
};
|
||||
nvidia = {
|
||||
enable = false;
|
||||
mode = "none";
|
||||
};
|
||||
printing.enable = false;
|
||||
login = {
|
||||
sddm.enable = false;
|
||||
gdm.enable = false;
|
||||
};
|
||||
style.enable = false;
|
||||
};
|
||||
|
||||
program = {
|
||||
docker.enable = true;
|
||||
podman.enable = false;
|
||||
steam.enable = false;
|
||||
proxychains.enable = false;
|
||||
tor.enable = false;
|
||||
virt-manager.enable = false;
|
||||
virtualbox.enable = false;
|
||||
yubikey = {
|
||||
enable = false;
|
||||
lock-on-remove = false;
|
||||
notify = false;
|
||||
};
|
||||
ssh.client.enable = false;
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# Simply install just the packages
|
||||
environment.packages = with pkgs; [
|
||||
# User-facing stuff that you really really want to have
|
||||
vim # or some other editor, e.g. nano or neovim
|
||||
|
||||
# Some common stuff that people expect to have
|
||||
#procps
|
||||
#killall
|
||||
#diffutils
|
||||
#findutils
|
||||
#utillinux
|
||||
#tzdata
|
||||
#hostname
|
||||
#man
|
||||
#gnugrep
|
||||
#gnupg
|
||||
#gnused
|
||||
#gnutar
|
||||
#bzip2
|
||||
#gzip
|
||||
#xz
|
||||
#zip
|
||||
#unzip
|
||||
];
|
||||
|
||||
environment.etcBackupExtension = ".bak";
|
||||
system.stateVersion = "24.05";
|
||||
}
|
||||
11
tsunemori/home.nix
Normal file
11
tsunemori/home.nix
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
# Read the changelog before changing this value
|
||||
home.stateVersion = "24.05";
|
||||
|
||||
# insert home-manager config
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user