update: misc

This commit is contained in:
FabricSoul 2025-07-02 17:25:32 -04:00
parent 391159f8f3
commit 5339994df8
10 changed files with 100 additions and 185 deletions

View file

@ -1,6 +1,6 @@
{
nixvim,
hyprpanel,
# hyprpanel,
pkgs,
pkgsUnstable,
config,
@ -126,7 +126,7 @@
zsh
pavucontrol
wofi
hyprpanel
# hyprpanel
alejandra
rustup
tmuxPlugins.sensible

View file

@ -1,6 +1,70 @@
{...}: {
{pkgs, ...}: let
# 1. Define the smart launcher script for QQ
qq-launcher = pkgs.writeShellScriptBin "launch-qq.sh" ''
#!/bin/sh
# Define the name for our persistent container
CONTAINER_NAME="qq-persistent"
# Ensure the host directory for QQ's config exists
mkdir -p "$HOME/.config/qq-docker"
# Check if the container is already running
if [ "$(${pkgs.docker}/bin/docker ps -q -f name=$CONTAINER_NAME)" ]; then
echo "Container is running. Sending activation signal via D-Bus..."
# This command asks the QQ application's D-Bus service to execute its 'show' method.
# The service name and path are educated guesses based on common Qt app behavior.
${pkgs.docker}/bin/docker exec --user user "$CONTAINER_NAME" \
qdbus com.tencent.QQ /MainApplication show
exit 0
fi
# Check if the container exists but is stopped
if [ "$(${pkgs.docker}/bin/docker ps -a -q -f name=$CONTAINER_NAME)" ]; then
# If stopped, just start it
echo "Starting existing, stopped QQ container..."
${pkgs.docker}/bin/docker start "$CONTAINER_NAME"
exit 0
fi
# If the container does not exist at all, create it for the first time
echo "Container not found. Creating and starting new QQ container..."
${pkgs.docker}/bin/docker run \
-d \
--name "$CONTAINER_NAME" \
--user $(id -u):$(id -g) \
--network=default \
-e DISPLAY \
-e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \
-e XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR \
-e QT_QPA_PLATFORM=wayland \
-e DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS \
-e GTK_IM_MODULE=fcitx \
-e QT_IM_MODULE=fcitx \
-e XMODIFIERS=@im=fcitx \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=$DISPLAY \
-e XDG_SESSION_TYPE=wayland \
--ipc=host \
-v "$HOME/.config/qq-docker:/home/user/.config" \
-v "$XDG_RUNTIME_DIR:$XDG_RUNTIME_DIR:rw" \
-v "/dev/dri:/dev/dri:rw" \
-v "$HOME/xdg-open-proxy:/usr/bin/xdg-open:ro" \
-v "/etc/machine-id:/etc/machine-id:ro" \
--security-opt="no-new-privileges" \
--cap-drop="ALL" \
qq-isolated
'';
in {
home.packages = [qq-launcher];
xdg.desktopEntries = {
# The name of the entry. This becomes the filename, e.g., "firefox-private.desktop"
# 2. Declaratively create the .desktop file
"qq-docker" = {
name = "QQ (Docker)";
comment = "Run QQ inside a secure Docker container";
exec = "launch-qq.sh";
type = "Application";
};
discord = {
# The name that will appear in Wofi
name = "Discord";

View file

@ -92,6 +92,7 @@
];
monitor = [
"DP-3, 3440x1440@144.00HZ, 0x0, 1"
"DP-5, 3440x1440@144.00HZ, 0x0, 1"
];
};
};

View file

@ -1,16 +1,11 @@
# home/fabric/desktop/hyprpanel.nix
{
config,
pkgs,
hyprpanel,
...
}: {
{pkgs, ...}: {
# Wayland settings for hyprpanel
wayland.windowManager.hyprland.settings = {
exec-once = [
"${pkgs.hyprpanel}/bin/hyprpanel"
];
};
# wayland.windowManager.hyprland.settings = {
# exec-once = [
# "${pkgs.hyprpanel}/bin/hyprpanel"
# ];
# };
programs.hyprpanel = {
# Enable the module.
@ -19,9 +14,6 @@
# Add to Hyprland config
# hyprland.enable = true;
# Fix the overwrite issue
overwrite.enable = false;
# Configure and theme options
settings = {
# Configure bar layouts for monitors