Skip to content

Instantly share code, notes, and snippets.

View appleseedexm's full-sized avatar

Roman appleseedexm

View GitHub Profile
@appleseedexm
appleseedexm / set_hyprland_instance_signature.sh
Created July 15, 2024 11:17
Set Hyprland instance signature based of found instances
#!/bin/sh
get_instance_line() {
hyprctl instances | grep -i instance
}
INSTANCE_COUNT=$(get_instance_line | grep -c instance)
if [ $INSTANCE_COUNT -eq "1" ]; then
export HYPRLAND_INSTANCE_SIGNATURE=$(get_instance_line | grep -o -E '[a-zA-Z0-9_]+')
@appleseedexm
appleseedexm / yabairc
Created May 15, 2024 06:43
yabai config to get a little bit of i3 on macOS
# default layout (can be bsp, stack or float)
yabai -m config layout bsp
# New window spawns to the right if vertical split, or bottom if horizontal split
yabai -m config window_placement second_child
# padding set to 12px
yabai -m config bottom_padding 4
yabai -m config right_padding 4
yabai -m config left_padding 4
yabai -m config top_padding 4
@appleseedexm
appleseedexm / skhdrc
Created May 15, 2024 06:35
skhd keybindings for yabai
# This needs a hyper key to be defined, i.e. in Karabiner-Elements
#
#
# -- Changing Window Focus --
#
# change window focus within space
hyper - j : yabai -m window --focus south
hyper - k : yabai -m window --focus north
hyper - h : yabai -m window --focus west
hyper - l : yabai -m window --focus east
@appleseedexm
appleseedexm / wireplumber-mute.sh
Last active May 27, 2024 19:42
Bash util to toggle mute for wireplumber audio sources and notify with dunstify
#!/bin/bash
# Change this line with the souce's name from `wpctl status`
MICROPHONE_SOURCE_NAME="RØDE NT-USB+"
MICROPHONE_SOURCE_DEFAULT_VOLUME="0.75"
get_volume_line() {
wpctl status | grep "$MICROPHONE_SOURCE_NAME" | grep -i vol
}
@appleseedexm
appleseedexm / utilreg.md
Last active September 12, 2023 05:12
UtilReg

Process tree list, i.e. to spot unusual sub-processes

$ ps -fauwwx
@appleseedexm
appleseedexm / formatWithIntelliJ.sh
Created January 28, 2022 15:42
Small shell script that uses the IntelliJ command line formatter to format all staged java files. Workaround when you don't want to work with IntelliJ but need it's formatter.
#!/bin/sh
# script is inspired by https://github.com/michalrus/git-hooks-code-autoformat
patterns="\.java$"
intellijFormatter="/Applications/IntelliJ IDEA.app/Contents/bin/format.sh"
configpath="/Users/path/to/your/config.xml"
root="$(git rev-parse --show-toplevel)"
[ -d "$root" ] || exit 1
@appleseedexm
appleseedexm / GetNotUsedIds.sql
Last active January 28, 2022 16:05
get all unused ids of an oracle db table
select min_a - 1 + level
from ( select min(id) min_a
, max(id) max_a
from tabledata
)
connect by level <= max_a - min_a + 1
minus
select id
from tabledata
@appleseedexm
appleseedexm / tmux.conf
Created November 29, 2017 09:21 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000