Skip to content

Instantly share code, notes, and snippets.

@Surzhko
Surzhko / toggletp
Last active November 4, 2017 15:51
Touchpad Toggle, window tilling and lock session key bindings for Lubuntu
#!/bin/bash
synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')
@Surzhko
Surzhko / .bash_profile
Last active October 12, 2023 07:56
colorized git ps1
#...
# Colorized output of git branch in prompt
# WORKING_TREE_CLEAN_MESSAGE must be changed due to git version and localization (git status)
# COLOR_DIRTY, COLOR_CLEAN and PS1 must be tweaked due to used OS
__git_color_ps1 ()
{
if [ -n "$(__git_ps1)" ]; then
local WORKING_TREE_CLEAN_MESSAGE="working tree clean"
local COLOR_DIRTY="\e[1;31m"
local COLOR_CLEAN="\e[1;37m"
@Surzhko
Surzhko / togglekb
Last active August 29, 2015 14:06
togglekb
You can use xinput to float the input device under X.
1 Execute the command `xinput list` to list your input devices.
2 Locate `AT Translated Set 2 keyboard` and take note of its `id` number; this will be used to disable the keyboard. Also, take note of the number at the end, `[slave keyboard (#)]`; this is the id number of the master, which will be used to re-enable your keyboard.
3 To disable the keyboard, execute the command `xinput float <id#>`, where `<id#>` is your keyboard's id number. For example, if the id was 10, then the command would be `xinput float 10`.
4 To re-enable the keyboard, execute the command `xinput reattach <id#> <master#>`, where master is that second number we noted down. So if the number was 3, you would do `xinput reattach 10 3`.
@Surzhko
Surzhko / .bash_profile (xubuntu)
Last active July 7, 2023 10:11
Installation bash script
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile"
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
alias gg='git gui'
alias gw='github_workflow'
alias be='bundle exec'
__git_color_ps1 ()