dotfiles

My PC Dotfiles & Website
commit b53c2858f6e3dcc0ffa9c4cfd909b51e33d55654
parent 8c69e2937d52850f51cb82c044ee5e0d3ec1b2a9
Author: maydayv7 <maydayv7@gmail.com>
Date:   Sat,  8 Mar 2025 22:06:33 +0530

fix: Python Shell

Other QOL Fixes

Diffstat:

Mfiles/vscode/keybindings.json | 5+++++
Mmodules/gui/desktop/hyprland/apps/panel.nix | 11+++++++----
Mmodules/gui/desktop/hyprland/apps/settings.nix | 3++-
Mscripts/hyprutils.nix | 30++++++++++++------------------
Mshells/python.nix | 28++++++++++++++--------------
Msite/static/js/comments.js | 8+++++---
6 files changed, 45 insertions(+), 40 deletions(-)

diff --git a/files/vscode/keybindings.json b/files/vscode/keybindings.json @@ -19,5 +19,10 @@ "key": "ctrl+'", "command": "editor.action.addCommentLine", "when": "editorTextFocus && !editorReadonly" + }, + { + "key": "ctrl+shift+'", + "command": "editor.action.removeCommentLine", + "when": "editorTextFocus && !editorReadonly" } ] diff --git a/modules/gui/desktop/hyprland/apps/panel.nix b/modules/gui/desktop/hyprland/apps/panel.nix @@ -199,14 +199,17 @@ in { on-click = "pypr show bluetooth"; }; - network = { + network = let + tooltip = "Strength: <b>{signaldBm}dBm ({signalStrength}%)</b>\nFrequency: <b>{frequency}MHz</b>\nInterface: <b>{ifname}</b>\nIP: <b>{ipaddr}/{cidr}</b>\nGateway: <b>{gwaddr}</b>\nNetmask: <b>{netmask}</b>"; + in { format = "{ifname}"; format-disconnected = "󰌙"; - format-ethernet = "󰌘"; format-wifi = "{icon}"; + format-ethernet = "󰌘"; format-icons = ["󰤯" "󰤟" "󰤢" "󰤥" "󰤨"]; format-linked = "󰈁 {ifname}"; - tooltip-format = "Network: <big><b>{essid}</b></big>\nStrength: <b>{signaldBm}dBm ({signalStrength}%)</b>\nFrequency: <b>{frequency}MHz</b>\nInterface: <b>{ifname}</b>\nIP: <b>{ipaddr}/{cidr}</b>\nGateway: <b>{gwaddr}</b>\nNetmask: <b>{netmask}</b>"; + tooltip-format-wifi = "Network: <big><b>{essid}</b></big>\n${tooltip}"; + tooltip-format-ethernet = "Network: <big><b>Wired</b></big>\n${tooltip}"; tooltip-format-disconnected = "󰌙 Disconnected"; on-click = "pypr show network"; }; @@ -349,7 +352,7 @@ in { idle_inhibitor = { format = "{icon}"; - on-click = "hyprutils toggle idle"; + on-click = "hyprutils toggle service swayidle"; tooltip-format-activated = "Idle Inhibitor: On"; tooltip-format-deactivated = "Idle Inhibitor: Off"; format-icons = { diff --git a/modules/gui/desktop/hyprland/apps/settings.nix b/modules/gui/desktop/hyprland/apps/settings.nix @@ -52,7 +52,7 @@ "$mod SHIFT, slash, exec, ${toggle "kebihelp"} show -a" "$mod, slash, exec, ulauncher-toggle" "$mod, A, exec, nwg-drawer" - "$mod SHIFT, A, exec, hyprutils toggle panel" + "$mod SHIFT, A, exec, hyprutils toggle service waybar" "$mod SHIFT, C, exec, ${runOnce "hyprpicker"} -arf hex" "$mod, D, exec, pypr toggle displays" "$mod, F, exec, nemo" @@ -123,6 +123,7 @@ "immediate, class:^(.+exe)$" # Prompt Windows + "float, class:^(xdg-desktop-portal-gtk)" "dimaround, class:^(xdg-desktop-portal-gtk)" ] ++ (builtins.map (class: [ diff --git a/scripts/hyprutils.nix b/scripts/hyprutils.nix @@ -20,10 +20,9 @@ toggle  fancy - Toggle Compositor Effects float - Toggle window floating in current workspace - idle - Toggle Idle Daemon service minimize - Show minimized windows monitor - Toggle specified Monitor - panel - Toggle top Panel + service ['name'] - Toggle SystemD Service shader - Toggle Compositor Shader touchpad - Toggle touchpad ''; @@ -56,8 +55,6 @@ in hyprshade hyprland custom.hyprshellevents - swayidle - waybar alsa-utils brightnessctl @@ -272,16 +269,6 @@ in hyprctl notify 1 2000 0 "Toggled window floating on Workspace $WORKSPACE" hyprctl dispatch workspaceopt allfloat ;; - "idle") - if systemctl --user is-active swayidle - then - systemctl --user stop swayidle - notify idle -i "system-lock-screen" "Stopped Idle Daemon" - else - systemctl --user restart swayidle - notify idle -i "system-lock-screen" "Started Idle Daemon" - fi - ;; "minimize") if hyprctl workspaces | grep "${minimize}" then @@ -298,12 +285,19 @@ in hyprctl keyword monitor "$3, preferred, auto, 1" fi ;; - "panel") - if systemctl --user is-active waybar + "service") + if [ -z "$3" ] + then + error "Expected service name" "Try 'hyprutils help' for more information" + fi + + if systemctl --user is-active "$3" then - systemctl --user stop waybar + systemctl --user stop "$3" + notify service -i "system-config-services" "Stopped $3" else - systemctl --user start waybar + systemctl --user start "$3" + notify service -i "system-config-services" "Started $3" fi ;; "shader") diff --git a/shells/python.nix b/shells/python.nix @@ -1,20 +1,20 @@ pkgs: { name = "Python"; - packages = with pkgs; - with python311Packages; [ - python3 - pip + packages = [ + pkgs.python3 + (pkgs.python3.withPackages (p: + with p; [ + pip + autopep8 + pylint + ipython + poetry-core + setuptools - autopep8 - pylint - - matplotlib - numpy - pandas - - ipython - poetry-core - setuptools + matplotlib + numpy + pandas + ])) ]; shellHook = '' diff --git a/site/static/js/comments.js b/site/static/js/comments.js @@ -1,12 +1,14 @@ -var coll = document.getElementsByClassName("comments-collapsible"); -for (var i = 0; i < coll.length; i++) { - coll[i].addEventListener("click", function () { +var buttons = document.getElementsByClassName("comments-collapsible"); +for (var i = 0; i < buttons.length; i++) { + buttons[i].addEventListener("click", function () { this.classList.toggle("active"); var content = this.nextElementSibling; if (content.style.maxHeight) { content.style.maxHeight = null; + this.innerHTML = "Show Comments"; } else { content.style.maxHeight = content.scrollHeight + "px"; + this.innerHTML = "Hide Comments"; } }); }