Skip to content

Instantly share code, notes, and snippets.

View pa-0's full-sized avatar

Peter Abbasi pa-0

View GitHub Profile
@pa-0
pa-0 / powertoys.ahk
Created October 2, 2025 00:25 — forked from liberize/powertoys.ahk
AutoHotKey2 helper script for PowerToys
#NoTrayIcon
SendMode("Input")
SetWorkingDir(A_ScriptDir)
; -----------------------------------------------------------------------
; 1. PowerToys Peek
; Use only space key to trigger PowerToys Peek
; Credit: https://github.com/deanmongel/use-space-in-peek-of-powertoys
@pa-0
pa-0 / AntiAKF-UI.ahk
Created October 2, 2025 00:24 — forked from tdolan21/AntiAKF-UI.ahk
AutoHotKey v2 Anti-AFK tool with unique mouse movement pattern and small transparent overlay
; Requires AutoHotkey v2.0
; Download the gist and double click to run
; Enhanced Anti-AFK Script with Window Controls & Styling
; This script prevents AFK detection by performing mouse movements
; Press Ctrl+Alt+S to start/stop the anti-AFK feature
; Press Ctrl+Alt+X to exit the script completely
; Global variables
@pa-0
pa-0 / KeyboardClean.ahk
Created October 2, 2025 00:22 — forked from Nightblade/KeyboardClean.ahk
Block keyboard input so you can clean it while it's plugged in.
#Requires AutoHotkey v2
/*
KeyboardClean.ahk
------------------
Temporarily disables keyboard input to allow cleaning while plugged in.
Version History:
v2.2 - 2025-02-24 (Re-enable keyboard on exit as a precaution)
v2.1 - 2025-02-22 (Merged enable/disable functions into a toggle)
v2.0 - 2025-01-14
@pa-0
pa-0 / CircleClock.ahk
Created September 24, 2025 20:34 — forked from fischgeek/CircleClock.ahk
CircleProgress.ahk
#Include Gdip.ahk
#Include CircleProgressClass.ahk
#SingleInstance, Force
SysGet, mon, MonitorWorkArea
thickness := 15
spacing := thickness*2
hrDiam := thickness+spacing
minDiam := hrDiam+spacing
@pa-0
pa-0 / main.rs
Created August 25, 2025 21:18 — forked from MoAlyousef/main.rs
Compact packed expandable multiple tree
use fltk::{prelude::*, *};
static COFACTOR: utils::oncelock::Lazy<i32> = utils::oncelock::Lazy::new(|| (app::font_size() as f64 * 2.0) as i32);
fn prep_tree(t: &mut tree::Tree) {
if let Some(root) = t.next(&t.first().unwrap()) {
if root.is_open() {
let elems = root.children();
t.resize(t.x(), t.y(), t.w(), (elems + 1) * *COFACTOR);
} else {
@pa-0
pa-0 / main.rs
Created August 25, 2025 21:16 — forked from MoAlyousef/main.rs
fltk-sys example
#![feature(concat_idents)]
use fltk_sys::{fl::*, frame::*, window::*, group::*, button::{self, *}};
use std::os::raw::*;
macro_rules! fstr {
($s:literal) => {
concat!($s, "\0").as_ptr() as _
}
}
@pa-0
pa-0 / custom_dialog.rs
Created August 25, 2025 21:15 — forked from MoAlyousef/custom_dialog.rs
custom dialog using fltk-rs
use fltk::{
app, button,
enums::{Color, Font, FrameType},
frame, group, input,
prelude::*,
window,
};
fn style_button(btn: &mut button::Button) {
btn.set_color(Color::Cyan);
@pa-0
pa-0 / hover_button.rs
Created August 25, 2025 21:15 — forked from MoAlyousef/hover_button.rs
Example of Hover support for buttons, it basically requires handling the Event::Enter and Event::Leave events.
use fltk::{
app, button,
enums::{Color, Event, FrameType},
prelude::*,
window,
};
const COLOR: u32 = 0xB39DDB;
const SELECTION_COLOR: u32 = 0x9575CD;
const HOVER_COLOR: u32 = 0xD1C4E9;
@pa-0
pa-0 / resize_override.rs
Created August 25, 2025 21:02 — forked from MoAlyousef/resize_override.rs
Override FLTK's resizing defaults
#![allow(unused_variables)]
use fltk::{
app::App,
button::Button,
enums::Event,
group::Group,
prelude::{GroupExt, WidgetBase, WidgetExt, WindowExt},
window::Window,
};
@pa-0
pa-0 / popup_hack.rs
Created August 25, 2025 21:00 — forked from MoAlyousef/popup_hack.rs
A popup hack allowing to use dynamic strings, basically by creating a hidden Choice widget then getting the MenuItem using the `MenuExt::at(0)` method.
use fltk::{prelude::*, *};
fn main() {
let mut choice = menu::Choice::default();
choice.add_choice("File/New");
choice.add_choice(&format!("{}\t", "Edit/Cut"));
choice.add_choice("File/Open");
choice.add_choice(&format!("Edit/{}", "Copy"));
choice.add_choice("Other|Option");