Skip to content

Instantly share code, notes, and snippets.

#include <clight/public.h>
#include <stdlib.h>
#include <time.h>
/**
* Small example custom module for Clight.
*
* It just hooks on INHIBIT state updates and:
* -> when entering INHIBIT state (eg: start watching a movie), disables automatic calibration,
* set low kbd brightness and timeout, and pauses any gamma adjustment
var menuOpts = {
a:{
"Reboot Userspace":()=>{
shellrun("launchctl reboot userspace")
},
Respring:()=>{
device.respring()
},
"Safe Mode":()=>{
shellrun("killall -SEGV SpringBoard")
#include <clight/public.h>
#include <stdlib.h>
#include <pwd.h>
#include <sys/stat.h>
CLIGHT_MODULE("TRENDLOG");
/*
* Rename to: trendlog.c
*
@NICHOLAS85
NICHOLAS85 / brl-all
Last active May 1, 2020 21:04
brl all concept script
#!/bedrock/libexec/busybox sh
#
# brl all
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# Copyright (c) 2012-2019 Daniel Thau <danthau@bedrocklinux.org>
#
function FindProxyForURL(url, host)
{
return "SOCKS localhost:6060";
}
#!/usr/bin/env bash
# Script that can be run daily to autocommit /bedrock/* changes
bedotcmd(){ git --git-dir=/bedrock/.git --work-tree=/bedrock "${@}"; }
sedotcmd(){ /bedrock/bin/strat -r "$1" git --git-dir=/etc/.git --work-tree=/etc "${@:2}"; }
mapfile -t bedotmod < <(bedotcmd ls-files --modified --exclude-standard)
bedotdel="$(bedotcmd ls-files --deleted --exclude-standard)"
strata=( debian arch )
for stratum in "${strata[@]:1}"; do
@NICHOLAS85
NICHOLAS85 / refindhibernate.sh
Created March 3, 2020 18:10
Automatically boot into OS after hibernation when using rEFInd
#!/bin/sh
dir="/boot/efi/EFI/refind/timeout.conf"
timeout="5"
if [ "$2" = "hibernate" ]; then
case "$1" in
pre)
echo "refindhibernate.sh: Setting timeout to -1"
sed 's/timeout.*/timeout -1/g' "$dir" > "$dir"~
@NICHOLAS85
NICHOLAS85 / brl-who
Last active February 28, 2020 02:46
List strata which provide input command
#!/usr/bin/env sh
[ -n "$1" ] && input=$1 || return
for stratum in $(brl list -ei); do
/bedrock/bin/strat -r $stratum /usr/bin/env sh -c "command -v $input 1>/dev/null && printf \"$stratum provides $input\"\\\n" || true
done
@NICHOLAS85
NICHOLAS85 / xdg-desktop-menu.hook
Last active March 16, 2020 00:00
pacman hook to rebuild the desktop file system configuration cache on app installations for Arch strata under Bedrock
[Trigger]
Type = File
Operation = Install
Operation = Upgrade
Operation = Remove
Target = usr/share/applications/*.desktop
[Action]
Description = Running update-desktop-database...
When = PostTransaction