From e44fb9a4b8a2d56568009c99129bd56f5081af0a Mon Sep 17 00:00:00 2001 From: Aargh Rai Date: Fri, 7 Aug 2026 13:12:59 +0530 Subject: tigervnc --- .gitignore | 1 + home-manager/home.nix | 1 + i3/vnc | 135 +++++++++++++++++++++++++++++++++++++++++++++++ nixos/apps.nix | 1 + scripts/battery_notif.sh | 0 scripts/vnc.sh | 32 +++++++++++ vnc/Xsession | 6 +++ 7 files changed, 176 insertions(+) create mode 100644 i3/vnc mode change 100644 => 100755 scripts/battery_notif.sh create mode 100755 scripts/vnc.sh create mode 100755 vnc/Xsession diff --git a/.gitignore b/.gitignore index 0df46c2..976ca46 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ hypr-zoom *.hm-backup *.dat *.bk +vnc/passwd diff --git a/home-manager/home.nix b/home-manager/home.nix index 44f5a3d..54357ff 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -33,6 +33,7 @@ let "nvim" "kitty" "tmux" + "vnc" "yazi" ]; diff --git a/i3/vnc b/i3/vnc new file mode 100644 index 0000000..3bae52f --- /dev/null +++ b/i3/vnc @@ -0,0 +1,135 @@ +set $mod Mod4 +font pango:Jetbrains Mono Nerd Font 8 +exec --no-startup-id dex --autostart --environment i3 +exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork +exec --no-startup-id nm-applet + +set $refresh_i3status killall -SIGUSR1 i3status +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status +bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status +bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status +bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status + +floating_modifier $mod +tiling_drag modifier titlebar + +bindsym $mod+t exec kitty +bindsym Control+Shift+Escape exec kitty -e btop --force-utf +bindsym $mod+q kill +bindsym $mod+l exec i3lock --color=282828 --ring-color=83a598 --inside-color=282828 --line-color=282828 --separator-color=282828 --keyhl-color=fabd2f --bshl-color=fb4934 --verif-color=b8bb26 --wrong-color=fb4934 --time-color=ebdbb2 --date-color=a89984 --layout-color=d3869b --clock +bindsym $mod+p exec xwd + +set $shots $HOME/Pictures/Screenshots +bindsym Print exec --no-startup-id \ + mkdir -p "$shots" && \ + scrot "$shots/%Y-%m-%d_%H-%M-%S.png" +bindsym Shift+Print exec --no-startup-id \ + mkdir -p "$shots" && \ + scrot -s "$shots/%Y-%m-%d_%H-%M-%S.png" +bindsym $mod+Print exec --no-startup-id \ + scrot -s -e 'xclip -selection clipboard -t image/png -i "$f" && rm "$f"' + +bindsym $mod+d exec --no-startup-id rofi -show drun +bindsym $mod+Shift+d exec --no-startup-id rofi -show window + +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +bindsym $mod+h split h +bindsym $mod+v split v + +bindsym $mod+f fullscreen toggle +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +bindsym $mod+Shift+f floating toggle +# change focus between tiling / floating windows +# bindsym $mod+space focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +# focus the child container +#bindsym $mod+d focus child + +set $ws1 "1" +set $ws2 "2" +set $ws3 "3" +set $ws4 "4" +set $ws5 "5" +set $ws6 "6" +set $ws7 "7" +set $ws8 "8" +set $ws9 "9" +set $ws10 "10" + +bindsym $mod+1 workspace number $ws1 +bindsym $mod+2 workspace number $ws2 +bindsym $mod+3 workspace number $ws3 +bindsym $mod+4 workspace number $ws4 +bindsym $mod+5 workspace number $ws5 +bindsym $mod+6 workspace number $ws6 +bindsym $mod+7 workspace number $ws7 +bindsym $mod+8 workspace number $ws8 +bindsym $mod+9 workspace number $ws9 +bindsym $mod+0 workspace number $ws10 + +bindsym $mod+Shift+1 move container to workspace number $ws1 +bindsym $mod+Shift+2 move container to workspace number $ws2 +bindsym $mod+Shift+3 move container to workspace number $ws3 +bindsym $mod+Shift+4 move container to workspace number $ws4 +bindsym $mod+Shift+5 move container to workspace number $ws5 +bindsym $mod+Shift+6 move container to workspace number $ws6 +bindsym $mod+Shift+7 move container to workspace number $ws7 +bindsym $mod+Shift+8 move container to workspace number $ws8 +bindsym $mod+Shift+9 move container to workspace number $ws9 +bindsym $mod+Shift+0 move container to workspace number $ws10 + +bindsym $mod+Shift+c reload +bindsym $mod+Shift+r restart +bindsym $mod+Shift+l exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" + +mode "resize" { + bindsym j resize shrink width 10 px or 10 ppt + bindsym k resize grow height 10 px or 10 ppt + bindsym l resize shrink height 10 px or 10 ppt + bindsym semicolon resize grow width 10 px or 10 ppt + + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym $mod+r mode "default" +} + +bar { + status_command i3status +} + +exec --no-startup-id xrandr --auto + +set $bg #282828 +set $red #cc241d +set $green #98971a +set $yellow #d79921 +set $blue #458588 +set $purple #b16286 +set $aqua #689d68 +set $gray #a89984 +set $darkgray #1d2021 + +# class border|backgr|text|indicator|child_border +client.focused $green $green $darkgray $purple $darkgray +client.focused_inactive $darkgray $darkgray $yellow $purple $darkgray +client.unfocused $darkgray $darkgray $yellow $purple $darkgray +client.urgent $red $red $white $red $red diff --git a/nixos/apps.nix b/nixos/apps.nix index 8b40c68..0c7b451 100644 --- a/nixos/apps.nix +++ b/nixos/apps.nix @@ -15,6 +15,7 @@ calibre libreoffice-qt6-fresh kdePackages.dolphin + tigervnc winePackages.stableFull winetricks vlc diff --git a/scripts/battery_notif.sh b/scripts/battery_notif.sh old mode 100644 new mode 100755 diff --git a/scripts/vnc.sh b/scripts/vnc.sh new file mode 100755 index 0000000..ad9fefd --- /dev/null +++ b/scripts/vnc.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +set -eou + +cleanup() { + echo "Stopping VNC and i3..." + + kill -INT "$i3_pid" 2>/dev/null || true + kill -INT "$vnc_pid" 2>/dev/null || true + + wait "$i3_pid" 2>/dev/null || true + wait "$vnc_pid" 2>/dev/null || true +} + +trap cleanup INT TERM EXIT + +Xvnc :1 \ + -geometry 1920x1080 \ + -depth 24 \ + -rfbauth ~/.config/vnc/passwd & + +vnc_pid=$! + +sleep 1 + +DISPLAY=:1 \ +I3SOCK=/tmp/i3-vnc.sock \ +i3 -c ~/.config/i3/vnc & + +i3_pid=$! + +wait "$vnc_pid" "$i3_pid" diff --git a/vnc/Xsession b/vnc/Xsession new file mode 100755 index 0000000..4393d4c --- /dev/null +++ b/vnc/Xsession @@ -0,0 +1,6 @@ +#!/bin/sh + +unset SESSION_MANAGER +unset DBUS_SESSION_BUS_ADDRESS + +exec i3 -- cgit v1.2.3