Skip to content

Instantly share code, notes, and snippets.

View CouldBeThis's full-sized avatar

CouldBeThis CouldBeThis

  • lol nope
View GitHub Profile
@CouldBeThis
CouldBeThis / create-multiple-riectories-at-once.md
Created November 26, 2021 04:44
create multiple directories at once

make multiple directories

mkdir -p {dir,dir2}

tree
.
├── dir
└── dir2
@CouldBeThis
CouldBeThis / create-file-with-yyy-mm-dd-date-in-filename.md
Created December 7, 2021 01:41
how to create a file with YYY-MM-DD set in the filename
touch "$(date +%F) filename.txt"

creates file named 2021-12-06 filename.txt

touch "$(date) filename.txt"

lsd: config.yaml

a bunch of options for lsd config

# == Date ==
# This specifies the date format for the date column. The freeform format
# accepts an strftime like string.
# When "classic" is set, this is set to "date".
# Possible values: date, relative, '+<date_format>'
@CouldBeThis
CouldBeThis / shellcolors.sh
Created March 8, 2022 12:02 — forked from connorjan/shellcolors.sh
Definitions for the shell colors (and other attributes) through tput
# Text color - normal
fgblack="$(tput setaf 0)" # Black
fgred="$(tput setaf 1)" # Red
fggreen="$(tput setaf 2)" # Green
fgyellow="$(tput setaf 3)" # Yellow
fgblue="$(tput setaf 4)" # Blue
fgpurple="$(tput setaf 5)" # Purple
fgcyan="$(tput setaf 6)" # Cyan
fgwhite="$(tput setaf 7)" # White
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@CouldBeThis
CouldBeThis / geanywl
Created March 26, 2022 18:29 — forked from gkatev/geanywl
Geany editor: Wrapper for per-workspace instances, opening in most recently focused window, and more
#!/bin/bash
GEANY_PATH="/usr/bin/geany"
if [ -z "$XDG_RUNTIME_DIR" ]; then
[ -z "$XDG_CACHE_HOME" ] &&
XDG_CACHE_HOME="$HOME/.cache"
XDG_RUNTIME_DIR="$XDG_CACHE_HOME"
fi
@CouldBeThis
CouldBeThis / color-converstion.md
Last active April 16, 2022 13:22
convert colors from hex to HSL (source = list in text file)

uses pastel to take a text file with a list of colors (in hex) and convert them to HSL. my purpose in this is to replace hardcoded hex color codes in GTK themes with named variables.

this gets less and less useful and finished as it goes on. incomplete and infunctional.

NOTE: the # needs to be removed from the hex code for this to work

basic

cat INPUT.txt | xargs -I {} sh -c "echo \#{}; pastel format hsl  {}" > OUTPUT.txt
@CouldBeThis
CouldBeThis / convert-xpm-window-decorations.md
Created April 16, 2022 14:21
convert `.xpm` images (used in gtk 2 theme)

convert .xpm images (used in gtk 2 theme)

from the base directory of the theme:

magick mogrify -path converstion/png -format png xfwm4/*.xpm

relevant links: