mirror of
https://github.com/frebib/dotfiles.git
synced 2024-06-14 12:57:23 +00:00
Compare commits
5 Commits
b87cf96ff2
...
master
Author | SHA1 | Date | |
---|---|---|---|
1da55a29c4 | |||
2cc93a1649
|
|||
787008fdb7
|
|||
79dc6a7389
|
|||
fede67c22a
|
43
aliases
43
aliases
@ -110,9 +110,20 @@ alias ginit='git init'
|
|||||||
alias gignore='$EDITOR .gitignore'
|
alias gignore='$EDITOR .gitignore'
|
||||||
alias gitc='$EDITOR $XDG_CONFIG_HOME/git/config'
|
alias gitc='$EDITOR $XDG_CONFIG_HOME/git/config'
|
||||||
alias ggignore='$EDITOR $XDG_CONFIG_HOME/git/gitignore'
|
alias ggignore='$EDITOR $XDG_CONFIG_HOME/git/gitignore'
|
||||||
alias gcl="git clone --recursive"
|
|
||||||
alias gco="git checkout"
|
alias gco="git checkout"
|
||||||
alias gcom="git checkout \"\$(git defbranch)\""
|
alias gcom="git checkout \"\$(git defbranch)\""
|
||||||
|
alias gsw="git switch"
|
||||||
|
alias gswm="git switch \"\$(git defbranch)\""
|
||||||
|
alias gbr="git branch"
|
||||||
|
alias gtg="git tag"
|
||||||
|
alias gbl="git blame"
|
||||||
|
alias gt="git tag"
|
||||||
|
alias gst="git status"
|
||||||
|
alias grl="git reflog"
|
||||||
|
alias gfp="git format-patch"
|
||||||
|
alias gcl="git clone --recursive"
|
||||||
|
|
||||||
alias ga="git add"
|
alias ga="git add"
|
||||||
alias gap="git add -p"
|
alias gap="git add -p"
|
||||||
alias gau="git add -u"
|
alias gau="git add -u"
|
||||||
@ -120,17 +131,17 @@ alias gaN="git add -N"
|
|||||||
alias gaa="ga -A"
|
alias gaa="ga -A"
|
||||||
alias grm="git rm"
|
alias grm="git rm"
|
||||||
alias gmv="git mv"
|
alias gmv="git mv"
|
||||||
alias gc="git commit -s"
|
|
||||||
alias gcm="git commit -s -em"
|
alias gc="git commit -sv"
|
||||||
alias gca="git commit -s --amend --date=\"\$(date -R)\""
|
alias gcm="git commit -sv -em"
|
||||||
alias gcn="git commit -s --no-edit"
|
alias gca="git commit -sv --amend --date=\"\$(date -R)\""
|
||||||
alias gcan="gca -s --no-edit"
|
alias gcn="git commit -sv --no-edit"
|
||||||
alias gcam="gca -s -m"
|
alias gcan="gca --no-edit"
|
||||||
alias gst="git status"
|
alias gcam="gca -m"
|
||||||
alias grl="git reflog"
|
|
||||||
|
|
||||||
alias gm="git merge"
|
alias gm="git merge"
|
||||||
alias gma="git merge --abort"
|
alias gma="git merge --abort"
|
||||||
|
alias gmc="git merge --continue"
|
||||||
|
|
||||||
alias grb="git rebase"
|
alias grb="git rebase"
|
||||||
alias grbi="grb -i"
|
alias grbi="grb -i"
|
||||||
@ -166,10 +177,10 @@ alias gpsuom="git push --set-upstream origin \"\$(git defbranch)\""
|
|||||||
alias gpall="git remote | xargs -L1 git push"
|
alias gpall="git remote | xargs -L1 git push"
|
||||||
alias gl="git pull --rebase"
|
alias gl="git pull --rebase"
|
||||||
alias glp="gl && gp"
|
alias glp="gl && gp"
|
||||||
alias gd="git diff --patch-with-stat"
|
alias gd="git diff --patch-with-stat --no-prefix"
|
||||||
alias gdni="gd --no-index"
|
alias gdni="gd --no-index --no-prefix"
|
||||||
alias gds="gd --staged"
|
alias gds="gd --staged --no-prefix"
|
||||||
alias gsh="git show --format=fuller --patch-with-stat"
|
alias gsh="git show --format=fuller --patch-with-stat --no-prefix"
|
||||||
alias glg="git log --color --format=fuller --stat --no-merges --graph"
|
alias glg="git log --color --format=fuller --stat --no-merges --graph"
|
||||||
alias glgp="git log --color --format=fuller --patch-with-stat --no-merges --graph"
|
alias glgp="git log --color --format=fuller --patch-with-stat --no-merges --graph"
|
||||||
alias glog="git log --color --oneline --decorate --graph"
|
alias glog="git log --color --oneline --decorate --graph"
|
||||||
@ -178,10 +189,8 @@ alias grst="git reset"
|
|||||||
alias gundo="git reset --keep @~1"
|
alias gundo="git reset --keep @~1"
|
||||||
alias gclean="git clean"
|
alias gclean="git clean"
|
||||||
alias gclm="git cleanmerged"
|
alias gclm="git cleanmerged"
|
||||||
alias gbr="git branch"
|
|
||||||
alias gbrl="git for-each-ref --sort=committerdate refs/heads/ --format=\"%(refname:short)\" | fzf -x --ansi --multi --preview-window=right:70% --preview=\"git log --format=fuller --stat --color=always {} | head -n\$((\$(tput lines)*10))\""
|
alias gbrl="git for-each-ref --sort=committerdate refs/heads/ --format=\"%(refname:short)\" | fzf -x --ansi --multi --preview-window=right:70% --preview=\"git log --format=fuller --stat --color=always {} | head -n\$((\$(tput lines)*10))\""
|
||||||
alias gtg="git tag"
|
|
||||||
alias gbl="git blame"
|
|
||||||
alias gr="git remote"
|
alias gr="git remote"
|
||||||
alias gra="gr add"
|
alias gra="gr add"
|
||||||
alias grr="gr rm"
|
alias grr="gr rm"
|
||||||
@ -192,7 +201,7 @@ alias gsta='git stash'
|
|||||||
alias gstd='gsta drop'
|
alias gstd='gsta drop'
|
||||||
alias gstl='gsta list --stat --color'
|
alias gstl='gsta list --stat --color'
|
||||||
alias gstp='gsta pop'
|
alias gstp='gsta pop'
|
||||||
alias gstv="gsta show -p stash@{0}"
|
alias gstv="gsta show --patch-with-stat stash@{0}"
|
||||||
|
|
||||||
# Docker aliases
|
# Docker aliases
|
||||||
alias d=docker
|
alias d=docker
|
||||||
|
@ -44,8 +44,7 @@ line-colour = #f00
|
|||||||
|
|
||||||
modules-left = i3
|
modules-left = i3
|
||||||
modules-center =
|
modules-center =
|
||||||
# modules-right = volume updates weather xkeyboard wlan gateway eth memory cpu xbacklight battery cputemp gputemp date
|
modules-right = volume updates weather wifi ethernet memory cpu cputemp backlight battery date
|
||||||
modules-right = volume updates weather wlan eth memory cpu xbacklight battery cputemp gputemp date
|
|
||||||
|
|
||||||
tray-position = right
|
tray-position = right
|
||||||
tray-detached = false
|
tray-detached = false
|
||||||
@ -132,8 +131,9 @@ label-urgent-foreground = ${colours.urgent}
|
|||||||
label-urgent-padding = ${self.label-focused-padding}
|
label-urgent-padding = ${self.label-focused-padding}
|
||||||
|
|
||||||
|
|
||||||
[module/xbacklight]
|
[module/backlight]
|
||||||
type = internal/xbacklight
|
type = internal/backlight
|
||||||
|
card = intel_backlight
|
||||||
|
|
||||||
label = %percentage%
|
label = %percentage%
|
||||||
format = <label>
|
format = <label>
|
||||||
@ -141,12 +141,6 @@ format-prefix = " "
|
|||||||
format-prefix-foreground = ${colours.icon}
|
format-prefix-foreground = ${colours.icon}
|
||||||
|
|
||||||
|
|
||||||
[module/backlight-acpi]
|
|
||||||
inherit = module/xbacklight
|
|
||||||
type = internal/backlight
|
|
||||||
card = intel_backlight
|
|
||||||
|
|
||||||
|
|
||||||
[module/cpu]
|
[module/cpu]
|
||||||
type = internal/cpu
|
type = internal/cpu
|
||||||
interval = 2
|
interval = 2
|
||||||
@ -164,9 +158,9 @@ format-prefix-foreground = ${colours.icon}
|
|||||||
label = %percentage_used%%
|
label = %percentage_used%%
|
||||||
|
|
||||||
|
|
||||||
[module/wlan]
|
[module/wifi]
|
||||||
type = internal/network
|
type = internal/network
|
||||||
interface = wlp1s0
|
interface-type = wireless
|
||||||
interval = 3.0
|
interval = 3.0
|
||||||
|
|
||||||
format-connected = <ramp-signal> <label-connected>
|
format-connected = <ramp-signal> <label-connected>
|
||||||
@ -185,9 +179,9 @@ ramp-signal-2 =
|
|||||||
ramp-signal-foreground = ${colours.icon}
|
ramp-signal-foreground = ${colours.icon}
|
||||||
|
|
||||||
|
|
||||||
[module/eth]
|
[module/ethernet]
|
||||||
type = internal/network
|
type = internal/network
|
||||||
interface = lan
|
interface-type = wired
|
||||||
interval = 10.0
|
interval = 10.0
|
||||||
|
|
||||||
label-connected = %local_ip% & %local_ip6%
|
label-connected = %local_ip% & %local_ip6%
|
||||||
|
31
scripts/otp
31
scripts/otp
@ -1,4 +1,12 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
NOTIF_PERSIST=30000
|
||||||
|
NOTIF_INFORM=5000
|
||||||
|
|
||||||
|
stdout=
|
||||||
|
caller=
|
||||||
|
notif=
|
||||||
|
|
||||||
while getopts "on:" o; do
|
while getopts "on:" o; do
|
||||||
case "${o}" in
|
case "${o}" in
|
||||||
@ -19,24 +27,19 @@ if [ $# -lt 1 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$caller" ]; then
|
if [ -n "$caller" ]; then
|
||||||
notif="$(notify-send -p "Touch your Yubikey" "$caller is requesting otp for $1")"
|
notif="$(notify-send -p -t $NOTIF_PERSIST "Touch your Yubikey" "$caller is requesting otp for $1")"
|
||||||
|
trap 'notify-send -r $notif -t 1 "Touch your Yubikey" "$caller is requesting otp for $1"' EXIT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ykman oath accounts code -s "$1" 2>&1 |
|
code=$(ykman oath accounts code -s "$1")
|
||||||
while read -r x; do
|
|
||||||
if grep -Pqw '[0-9]{6}' <<< "$x"; then
|
|
||||||
if [ -z "$stdout" ]; then
|
if [ -z "$stdout" ]; then
|
||||||
echo "$x" | tee >(xclip -i)
|
echo "$code" | tee >(xclip -i)
|
||||||
xdotool type "$x"
|
xdotool type "$code"
|
||||||
else
|
else
|
||||||
echo "$x"
|
echo "$code"
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
if [ -z "$stdout" ]; then
|
|
||||||
notify-send "$x";
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -n "$notif" ]; then
|
if [ -n "$code" ] && [ -n "$notif" ]; then
|
||||||
notify-send -r "$notif" -t 1000 "Touch your Yubikey" "otp generated for $caller"
|
trap : EXIT
|
||||||
|
notify-send -r "$notif" -t $NOTIF_INFORM "Yubikey Touched" "otp generated for $caller"
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user