Skip to content

Instantly share code, notes, and snippets.

View xPMo's full-sized avatar

Gamma xPMo

View GitHub Profile
@xPMo
xPMo / _rbw
Last active February 3, 2021 16:45
Zsh completion for doy/rbw
_rbw.zsh
@xPMo
xPMo / vi-mode-plugins.md
Last active May 18, 2020 16:09
Comparison of Vi-mode plugins for Zsh
@xPMo
xPMo / sway-launcher-desktop.sh
Last active October 15, 2019 07:37 — forked from Biont/sway-launcher-desktop.sh
sway-launcher-desktop
#!/usr/bin/env bash
# terminal application launcher for sway, using fzf
# Based on: https://gitlab.com/FlyingWombat/my-scripts/blob/master/sway-launcher
shopt -s nullglob
if [[ "$1" = 'describe' ]]; then
shift
if [[ $2 == 'command' ]]; then
title=$1
readarray arr < <(whatis -l "$1" 2>/dev/null)
@xPMo
xPMo / LICENSE
Last active October 3, 2024 12:16
POSIX sh mako menu selection, without jq
MIT License
Copyright (c) 2019 xPMo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@xPMo
xPMo / strawb-wayland-debug.log.gz
Last active August 28, 2019 01:55
Strawberry Crash.

The following is the ordered list of files Zsh will source for each shell type:

  • L: Login
  • I: Interactive
Shell type: LI L_ _I __
~/.zshenv
${ZDOTDIR:-$HOME}/.zprofile
${ZDOTDIR:-$HOME}/.zshrc
zip_and_transpose() {
# for convenience, we zip our leading spaces (which provide the offset for diagonal cases) here
# Using ^^ will wrap to previous entries until "argv" is exhausted (this is only useful in the first call)
for s line (${spaces:^^argv})
s+=$line && # concatenate the spaces onto the start of the line
for (( i=0 ; i++ < $#s; ))
a[i]+=$s[i]
}
spaces=(+) # we need to declare this an an array from the start for the zip to work correctly
@xPMo
xPMo / bash-ref-dark.css
Last active January 26, 2019 17:05
Dark theming for local bash reference manual
@-moz-document url-prefix("file:///usr/share/doc/bash/bashref.html") {
body {
background: #002b36;
color: #eee8d5;
font-size: 1.2em;
line-height: 1.4;
max-width: 1200px;
padding: 0.5em;
margin: auto;
}
@xPMo
xPMo / workflow.md
Last active January 18, 2019 03:14
Planning out a /r/unixporn post

I have a fair amount of custom scripts, but I'm not a "do everything in the terminal" person. Instead, I prefer things like dunst(ify) actions and custom program wrappers. This customized, but not-so-terminal-centric workflow is what I want to highlight in my post.

i3

  • focus/launch mode
  • xfce4-appfinder
  • rofi
  • scratchpad
  • $mod+F1 hint notifications
@xPMo
xPMo / term-link.c
Last active July 30, 2018 04:59
OSC 8 hyperlink implementation in C using libcurl