aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gitconfig1
-rw-r--r--shellrc16
-rwxr-xr-xsystem/etc/pm/sleep.d/10lock4
3 files changed, 19 insertions, 2 deletions
diff --git a/gitconfig b/gitconfig
index 9c489ba..7bbfd72 100644
--- a/gitconfig
+++ b/gitconfig
@@ -12,6 +12,7 @@
ci = commit
st = status
br = branch
+ wt = worktree
hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
type = cat-file -t
dump = cat-file -p
diff --git a/shellrc b/shellrc
index be99e18..1c274db 100644
--- a/shellrc
+++ b/shellrc
@@ -4,6 +4,9 @@
# Continue only if this is interactive shell
[[ $- != *i* ]] && return
+#################################################################################
+# Aliases
+
if [ "$(uname -s)" = "FreeBSD" ]; then
alias ls='ls -G'
else
@@ -42,8 +45,21 @@ if pidof systemd >/dev/null 2>/dev/null; then
alias ujrn='jrn --user'
fi
+#################################################################################
+# Utility functions
+
+# Generate random password (optionally takes length of password as first argument)
genpasswd() {
local l=$1
if [ "$l" = "" ]; then l=16; fi
tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs
}
+
+# Run given command every second
+dorepeat() {
+ while true; do
+ "$@"
+ sleep 1
+ echo
+ done
+}
diff --git a/system/etc/pm/sleep.d/10lock b/system/etc/pm/sleep.d/10lock
index 4f67652..baddcb4 100755
--- a/system/etc/pm/sleep.d/10lock
+++ b/system/etc/pm/sleep.d/10lock
@@ -4,8 +4,8 @@
case "$1" in
hibernate|suspend)
- for socket in `find /tmp/i3-* -name ipc-socket*`; do
- i3-msg -s $socket "exec i3lock -c 000000"
+ for socket in `find /tmp/i3-* -name ipc-socket.*`; do
+ i3-msg -s $socket "exec i3lock -d -c 000000"
done
;;
*) exit $NA