-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbash
executable file
·30 lines (25 loc) · 970 Bytes
/
bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
## By Davoud Arsalani
## https://github.com/davoudarsalani/scripts
## https://github.com/davoudarsalani/scripts/blob/master/bash
## https://raw.githubusercontent.com/davoudarsalani/scripts/master/bash
## https://davoudarsalani.ir
source "$HOME"/main/scripts/gb
title="${0##*/}"
heading "$title"
main_items=( 'disable history temporarily' 'enable history' 'current tty' 'current session' 'paths' 'exports' )
main_item="$(pipe_to_fzf "${main_items[@]}")" && wrap_fzf_choice "$main_item" || exit 37
case "$main_item" in
'disable history temporarily' )
set +o history && accomplished ;;
'enable history' )
set -o history && accomplished ;;
'current tty' )
printf '%s\n' "$XDG_VTNR" && accomplished ;;
'current session' )
printf '%s\n' "$XDG_SESSION_ID" && accomplished ;;
paths )
printf '%s\n' "$PATH" && accomplished ;;
exports )
export -p && accomplished ;;
esac