Skip to content

Instantly share code, notes, and snippets.

@Nyubis
Nyubis / .zshrc.local
Last active September 26, 2018 14:05
# .zshrc.local, assuming ~/.zshrc is from the grml project
# get better up-search
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bind2maps emacs viins vicmd -- Up up-line-or-beginning-search
bind2maps emacs viins vicmd -- Down down-line-or-beginning-search
# Make ctrl-backspace work
@Nyubis
Nyubis / fw
Created August 9, 2017 09:07
fullwidth shell script
#!/bin/bash
# script for converting text to fullwidth characters on the clipboard
# don't try to enter anything that doesn't have a fullwidth equivalent
# usage: fw test
# result: the clipboard now contains test
words=$*
for (( i=0; i<${#words}; i++ )); do
char="${words:$i:1}"
if [[ "${char}" == " " ]]; then
@Nyubis
Nyubis / terminal-bell.md
Last active March 28, 2017 22:07
Fixing the jarring terminal bell

Fixing the jarring terminal bell

Assuming Cinnamon on Debian Sid, the terminal bell by default is a coarse, jarring sound that startles you whenever it goes off. This sound can be tested with echo -ne 'x07'. By default, Cinnamon's terminal bell is disabled, and it's the system bell you hear. Turning on Cinnamon's bell can be done as such:

  1. Open dconf-editor
  2. Navigate to org.cinnamon.desktop.wm.preferences
  3. Make sure that audible-bell is enabled
  4. Make sure that bell-sound is set to something that sounds pleasant (check /usr/share/sounds/freedesktop/stereo/bell.oga)

Keybase proof

I hereby claim:

  • I am nyubis on github.
  • I am nyubis (https://keybase.io/nyubis) on keybase.
  • I have a public key ASCw0io1SCCBHEnCTz_ChEpXghMuWhU24L1TNdWFXNiabQo

To claim this, I am signing this object:

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
#!/usr/bin/env python
from ctypes import *
from sys import argv
X11 = cdll.LoadLibrary("libX11.so.6")
display = X11.XOpenDisplay(None)
val = 0 if len(argv) < 2 or argv[1].lower() == "off" else 2
X11.XkbLockModifiers(display, c_uint(0x0100), c_uint(2), c_uint(val))
X11.XCloseDisplay(display)
@Nyubis
Nyubis / .vimrc
Last active January 9, 2018 07:37
""Plugins
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'wting/rust.vim'
@Nyubis
Nyubis / .fonts.conf
Created October 20, 2015 12:51
fontconfig with Noto fallback
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<alias>
<family>monospace</family>
<prefer>
<family>Source Code Pro</family>
<family>PowerlineSymbols</family>
</prefer>
</alias>
@Nyubis
Nyubis / .vimrc
Created October 4, 2014 12:25
Minimum viable .vimrc
"" General
set nocompatible
set showcmd
syntax on
filetype plugin indent on
cmap w!! w !sudo tee % > /dev/null
"" Whitespace
set tabstop=4
set shiftwidth=4