-
Notifications
You must be signed in to change notification settings - Fork 0
/
programs
executable file
·131 lines (103 loc) · 3.03 KB
/
programs
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/bin/bash
# lf integration
lf () {
LF_TEMPDIR="$(mktemp -d -t lf-tempdir-XXXXXX)"
LF_TEMPDIR="$LF_TEMPDIR" lf-run -last-dir-path="$LF_TEMPDIR/lastdir" "$@"
if [ "$(cat "$LF_TEMPDIR/cdtolastdir" 2>/dev/null)" = "1" ]; then
cd "$(cat "$LF_TEMPDIR/lastdir")" || exit ;
fi
rm -r "$LF_TEMPDIR"
unset LF_TEMPDIR
}
# session_name="${PWD##*/}"
# 1. First you check if a tmux session exists with a given name.
# tmux has-session -t=$session_name 2> /dev/null
# 2. Create the session if it doesn't exists.
# if [ ! "$TMUX" ]; then
# TMUX='' tmux new-session -d -s "tmux new -s ${PWD##*/}"
# tmux attach -t main || tmux new -s main
#fi
# if [[ $? -ne 0 ]]; then
# TMUX='' tmux new-session -d -s "tmux new -s ${PWD##*/}"
# # "$session_name"
# fi
# 3. Attach if outside of tmux, switch if you are in tmux.
# if [[ -z "$TMUX" ]]; then
# tmux attach -t "$session_name"
# else
# tmux switch-client -t "$session_name"
# fi
# width=${2:-90%}
# height=${2:-90%}
# if [ "$(tmux display-message -p -F "#{session_name}")" = "popup" ];then
# tmux detach-client
# else
# tmux popup -d '#{pane_current_path}' -xC -yC -w"$width" -h"$height" -E "tmux attach -t popup || tmux new -s popup"
# fi
if [ "$(tmux display-message -p -F "#{session_name}")" = "popup" ];then
tmux detach-client
else
tmux popup -d '#{pane_current_path}' -xC -yC -w80% -h75% -E "tmux attach -t popup || tmux new -s popup"
fi
tmux source-file ~/.config/tmux/tmux.conf
function StarshipThemes
{
case "$(printf "TokyoNight\nPastelPowerline\nGruvboxRainbow" | dmenu -l 3 -i -p "Themes:")" in
"TokyoNight") (starship preset tokyo-night -o ~/.config/starship.toml &) &>/dev/null 2>&1 ;;
"PastelPowerline") (starship preset pastel-powerline -o ~/.config/starship.toml &) &>/dev/null 2>&1 ;;
"GruvboxRainbow") (starship preset gruvbox-rainbow -o ~/.config/starship.toml &) &>/dev/null 2>&1 ;;
*) exit 1 ;;
esac
}
# function getinstalledprograms
# {
# aptitude search ;
# }
function startdalai
{
npx dalai serve;
}
function getdefaultprograms
{ bat /usr/share/applications/defaults.list; }
function getprograms
{
case "$(printf "Guake\nKeePass\nDropBox\nObsidian\n" | dmenu -l 10 -i -p "Programs:")" in
"Guake") (guake &) &>/dev/null 2>&1 ;;
"KeePass") (keepass2 &) &>/dev/null 2>&1 ;;
"DropBox") (flatpak run com.dropbox.Client &) &>/dev/null 2>&1 ;;
"Obsidian") flatpak run md.obsidian.Obsidian &>/dev/null 2>&1 ;;
*) exit 1 ;;
esac
}
function addnewsboaturl
{
vim $HOME/snap/newsboat/6660/.newsboat/urls;
}
function TerminalGuake
{
(guake &) &>/dev/null 2>&1
}
function start
{
(xdg-open . &) &>/dev/null 2>&1
}
function keepass
{
(keepass2 &) &>/dev/null 2>&1
}
function dropbox
{
(flatpak run com.dropbox.Client &) &>/dev/null 2>&1
}
function PdfZathura
{
zathura $1 -P $2
}
function obsidian
{
( /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=obsidian.sh --file-forwarding md.obsidian.Obsidian @@u %u @@ </dev/null &>/dev/null & )
}
function programs
{
dmenu_run -i -l 20;
}