Skip to content

Instantly share code, notes, and snippets.

View naranyala's full-sized avatar

naranyala naranyala

View GitHub Profile
@naranyala
naranyala / make-dotdesktop-for-nixpkgs.sh
Last active August 6, 2025 15:18
in context nix packages outside nixos, this script will make the packages have global ".desktop", making it globally available (cli and gui executable); to make every nix packages available in terminal (bash/zsh/etc) use this script: https://gist.github.com/naranyala/2203f889a3cb89c5cfe4599788bea915
#!/usr/bin/env bash
set -euo pipefail
# chmod +x make-dotdesktop-for-nixpkgs.sh
STORE_DIR="/nix/store"
DESKTOP_DIR="$HOME/.local/share/applications"
ICON_DIR="$HOME/.local/share/icons"
LOG_FILE="$HOME/nix-desktopify.log"
@naranyala
naranyala / make-global-symlinks-nixpkgs.sh
Last active August 6, 2025 16:27
the modern package manager for all linux distro, use `nix-shell -p <pkgname>`, then execute this script; for gui specific package use this script to create global shortcuts: https://gist.github.com/naranyala/312271a325d3c4fbd5fe33e07045cf7c
@naranyala
naranyala / switch-linux-login-manager.sh
Created August 6, 2025 06:08
easy to switch login manager, testing purposes only
#!/usr/bin/env bash
# Emergency Display Manager Recovery Script
set -euo pipefail
### EMERGENCY RECOVERY ###
emergency_recovery() {
echo "🚨 EMERGENCY RECOVERY MODE"
echo "This will attempt to restore a working display manager"
# Stop all display manager services
@naranyala
naranyala / install-nixshell-outside-nixos.sh
Created August 6, 2025 04:22
enable your non-nixos linux distro experience nix-shell, then visit: https://search.nixos.org/packages
#!/usr/bin/env bash
set -euo pipefail
# 🧾 Config
DEFAULT_NIX_FILE="$HOME/.default-nix-shell.nix"
SHELL_WRAPPER_FLAG="IN_NIX_SHELL"
BASHRC="$HOME/.bashrc"
ZSHRC="$HOME/.zshrc"
# 📦 Step 1: Install Nix if missing
#!/bin/bash
# /usr/local/bin/set-brightness-menu.sh
set -euo pipefail
# 🧪 Check for brightnessctl
if ! command -v brightnessctl &>/dev/null; then
echo "🔧 brightnessctl not found. Attempting to install..."
if command -v pacman &>/dev/null; then
#!/usr/bin/env bash
set -euo pipefail
# 🧰 Configuration
ARCH="$(uname -m)"
SWIFTLY_URL="https://download.swift.org/swiftly/linux/swiftly-${ARCH}.tar.gz"
SWIFTLY_TAR="swiftly-${ARCH}.tar.gz"
SWIFTLY_DIR="${SWIFTLY_HOME_DIR:-$HOME/.local/share/swiftly}"
# 📥 Download the Swiftly archive
@naranyala
naranyala / jester_htmx_bootstrap_starter.nim
Created August 1, 2025 02:25
your ready-to-go nim web server with jester, htmx, and bootstrap.css
# nimble install jester
# nimble install sqlite3_abi
import jester
import sqlite3_abi
import strutils
import os
import locks
import logging
@naranyala
naranyala / jester_sqlite3abi_htmx_starter.nim
Created August 1, 2025 02:11
your simple and fast web server with nim programming: jester and sqlite3_abi (we use HTMX btw)
# nimble install jester
# nimble install sqlite3_abi
import jester
import sqlite3_abi
import strutils
import os
import locks
import logging
@naranyala
naranyala / raylib_dashboard_layout.nim
Created July 29, 2025 13:30
for the community, a dashboard layout using nim programming and raylib
import raylib as rl
import strformat
# Configuration constants
const
ScreenWidth = 1280
ScreenHeight = 720
ToggleKey = rl.KeyboardKey.F1
# Panel type definition
@naranyala
naranyala / getter_setting_demo.nim
Last active July 28, 2025 16:28
for the community, a getter setter implementation of nim programming
type
Person* = object
name*: string
# Getter and setter procedures
proc getName*(p: Person): string =
## Getter for person's name
p.name
proc setName*(p: var Person, value: string): bool =