Skip to content

Instantly share code, notes, and snippets.

View vlad-shatskyi's full-sized avatar

Volodymyr Shatskyi vlad-shatskyi

View GitHub Profile
@ihashacks
ihashacks / notifyosd.zsh
Last active November 7, 2021 18:01
pseudo undistract-me implementation in zsh Original undistract-me: http://mumak.net/undistract-me/
# commands to ignore
cmdignore=(htop tmux top vim)
# end and compare timer, notify-send if needed
function notifyosd-precmd() {
retval=$?
if [[ ${cmdignore[(r)$cmd_basename]} == $cmd_basename ]]; then
return
else
if [ ! -z "$cmd" ]; then
@vlad-shatskyi
vlad-shatskyi / notifyosd.zsh
Last active December 15, 2015 11:49 — forked from ihashacks/notifyosd.zsh
Displays a notification when a command, that takes over 10 seconds to execute, finishes and only if the current window isn't the terminal. Add to your .zshrc: [ -e path/to/notifyosd.zsh ] && . path/to/notifyosd.zsh
function active-window-id {
echo `xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}'`
}
# end and compare timer, notify-send if needed
function notifyosd-precmd() {
if [ ! -z "$cmd" ]; then
cmd_end=`date +%s`
((cmd_time=$cmd_end - $cmd_start))
fi
@havenwood
havenwood / gemfile.rb
Created March 30, 2013 17:50
Create a Gemfile (irc)
abort 'Aborting. Gemfile already exists.' if File.exists? 'Gemfile'
@requires = []
files = Dir['*.rb']
files.each do |file|
open file do |file|
file.each do |line|
@requires << line.chomp if line.start_with? 'require '
end