Skip to content

Instantly share code, notes, and snippets.

// ---- Types ----
export interface StatuslineInput {
model?: { display_name?: string };
workspace?: { current_dir?: string };
cwd?: string;
context_window?: {
context_window_size?: number;
current_usage?: {
input_tokens?: number;
@takagiy
takagiy / xmonad.hs
Last active September 13, 2023 06:02
import XMonad
import XMonad.Util.EZConfig (additionalKeysP, removeKeysP)
import XMonad.Util.SpawnOnce
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks
import XMonad.Layout.Spacing
import XMonad.Layout.ToggleLayouts
import qualified XMonad.StackSet as W
main = xmonad $ docks $ ewmh $ ewmhFullscreen $ def
# See https://rust-lang.github.io/rustfmt/ for details on the options.
unstable_features = true
imports_granularity = "Crate"
group_imports = "One"
normalize_comments = true
wrap_comments = true
comment_width = 100 # Same as the default value of `max_width`.
@takagiy
takagiy / server_bot.py
Last active October 10, 2021 12:44
leak my global IP address on discord while the minecraft server is running
#!/bin/python
import discord
import requests
import subprocess
import asyncio
import signal
import sys
client = discord.Client()
@takagiy
takagiy / eduroam.8021x
Created August 5, 2021 05:25
`/var/lib/iwd/eduroam.8021x`
[Security]
EAP-Method=PEAP
EAP-Identity=anonymous@kyoto-u.f.eduroam.jp
EAP-PEAP-Phase2-Method=MSCHAPV2
EAP-PEAP-Phase2-Identity=<ENTER YOUR EDUROAM ID HERE>@kyoto-u.f.eduroam.jp
EAP-PEAP-Phase2-Password=<ENTER YOUR EDUROAM PASSWORD HERE>
[Settings]
AutoConnect=true
@takagiy
takagiy / local-form.satyh
Created January 11, 2020 05:50
Personal satysfi formula
@require: math
let-block ctx +math label math =
let indent = inline-skip 1.5cm in
let math = embed-math ctx math in
let label = read-inline ctx label in
line-break true true ctx (indent ++ math ++ inline-fil ++ label ++ indent)
let-mutable form-num <- 0
@takagiy
takagiy / local-form.satyh
Created January 11, 2020 05:50
Personal satysfi formula
@require: math
let-block ctx +math label math =
let indent = inline-skip 1.5cm in
let math = embed-math ctx math in
let label = read-inline ctx label in
line-break true true ctx (indent ++ math ++ inline-fil ++ label ++ indent)
let-mutable form-num <- 0
@takagiy
takagiy / local-table.satyh
Created January 11, 2020 05:48
Personal satysfi tabular
@require: color
@require: list
@require: gr
@require: table
type head-kind =
| Text of inline-text
| Value of inline-text
let-rec head-cell
@takagiy
takagiy / net-status.sh
Created December 22, 2019 05:21
i3blocks wlan status indicator script
#!/bin/bash
print_stat() {
{ [ ${1,,} = 'up' ] && echo '.oO' || echo '___'; } | sed -n 's/^/ /p'
}
get_interface() {
INTERFACE=$(ip route | sed -n '0,/.* dev \([^ ]*\) .*/s//\1/p')
[ -z ${INTERFACE} ] && return 1 || return 0
@takagiy
takagiy / player.py
Last active March 30, 2020 02:09
i3blocks Spotify indicator with Playerctl
#!/bin/python3
import gi
gi.require_version('Playerctl', '2.0')
from gi.repository import Playerctl, GLib
PLAYING = ''
PAUSED = ''
class Player: