Skip to content

Instantly share code, notes, and snippets.

View madprops's full-sized avatar

madprops madprops

View GitHub Profile
/**
* rofi -dump-theme output.
* Rofi version: 1.7.5
**/
* {
red: rgba ( 220, 50, 47, 100 % );
selected-active-foreground: rgba ( 249, 249, 249, 100 % );
lightfg: rgba ( 88, 104, 117, 100 % );
separatorcolor: rgba ( 29, 31, 33, 100 % );
urgent-foreground: rgba ( 204, 102, 102, 100 % );
configuration {
/* modes: "window,drun,run,ssh";*/
font: "hack 14";
/* location: 0;*/
/* yoffset: 0;*/
/* xoffset: 0;*/
/* fixed-num-lines: true;*/
/* show-icons: false;*/
/* terminal: "rofi-sensible-terminal";*/
/* ssh-client: "ssh";*/
@madprops
madprops / runcmd.py
Last active September 21, 2024 19:07
command palette for terminals
import time
from subprocess import Popen, PIPE
from pathlib import Path
info = "Pick a command"
items = Path("~/.config/awesome/scripts/data/commands.data").expanduser().read_text().split("\n")
selected = 0
rofi_cmd = f"""
rofi -dmenu -i -format i
@madprops
madprops / netcheck.sh
Last active March 3, 2024 21:36
Bash script to check for network status
#!/usr/bin/env bash
status="down"
while true; do
ping -w 10 -c 1 8.8.8.8 > /dev/null 2>&1
ping_status=$?
if [ $ping_status -eq 0 ] && [ "$status" == "down" ]; then
timestamp=$(date +"%H:%M:%S")
#!/usr/bin/sh
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
[ -x "$f" ] && . "$f"
done
unset f
fi
export QT_QPA_PLATFORMTHEME=qt5ct
export XDG_SESSION_TYPE=x11
@madprops
madprops / png_to_jpg.sh
Last active August 20, 2023 23:04
Add this to a dolphin actions .desktop file
#!/usr/bin/env bash
input="$1"
output="${input%.*}.jpg"
counter=1
while [ -e "$output" ]; do
output="${input%.*}($counter).jpg"
counter=$((counter + 1))
done
@madprops
madprops / timer.rb
Last active July 19, 2023 09:28
Timer manager ruby script
#!/usr/bin/env ruby
require "open3"
# Get input information using rofi
def get_input(prompt, data)
cmd = "rofi -dmenu -p '#{prompt}' -i"
stdin, stdout, stderr, wait_thr = Open3.popen3(cmd)
stdin.puts(data)
stdin.close
return stdout.read.strip
@madprops
madprops / zshrc
Last active December 10, 2022 02:44
autoload -U colors && colors
PS1="%{$fg[green]%}%d%{$reset_color%} %{$fg[blue]%}$%{$reset_color%} "
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line
bindkey "^[[3~" delete-char
alias get="sudo pacman -S"
alias update="sudo pacman -Syy"
@madprops
madprops / timer.rb
Created September 1, 2022 09:16
Script to start timers
#!/usr/bin/env ruby
require "open3"
# Get input information using rofi
def get_input(prompt, data)
cmd = "rofi -dmenu -p '#{prompt}'"
stdin, stdout, stderr, wait_thr = Open3.popen3(cmd)
stdin.puts(data)
stdin.close
return stdout.read.strip
@madprops
madprops / bckgit.py
Created August 9, 2022 01:27
Backup your public repos. Usernames/Orgs as arguments
import os
import sys
import requests
from pathlib import Path
def main():
usernames = sys.argv[1:]
for user in usernames:
userdir = Path(user)