-
Notifications
You must be signed in to change notification settings - Fork 0
/
dmwork
executable file
·95 lines (80 loc) · 2.35 KB
/
dmwork
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
#!/usr/bin/env bash
#
# Script name: dmconf
# Description: Choose from a list of configuration files to edit.
# Dependencies: dmenu
# GitLab: https://www.gitlab.com/dwt1/dmscripts
# License: https://www.gitlab.com/dwt1/dmscripts/LICENSE
# Contributors: Derek Taylor
# Defining the text editor to use.
# DMENUEDITOR="st -e vim"
# DMENUEDITOR="st -e nvim"
DMEDITOR="emacsclient -c -a emacs"
# An array of options to choose.
# You can edit this list to add/remove config files.
declare -a options=(
"Rammeavtale"
"Kravspesifikasjon"
"ESAVE-prosjekt"
"Energioppfølging"
"quit"
"Parameterkontroll"
)
# right pane first
# left pane second
# Middle pane third
ramma () {
zathura $HOME/Documents/Hjemmekontor/Rammeavtaler/Notater/spørgesmål.md.pdf &
libreoffice $HOME/Documents/Hjemmekontor/Rammeavtaler/Tilbudsinnbydelse_Kopi.docx &
alacritty -e nvim $HOME/Documents/Hjemmekontor/Rammeavtaler/Notater/spørgesmål.md
}
parameter_kontroll () {
alacritty --working-directory $HOME/Dev/TK/ &
alacritty -e nvim $HOME/Dev/TK/check.py &
alacritty -e nvim $HOME/Dev/TK/split.sh &
/bin/bash $HOME/Scripts/Programs/assorted-scripts/workhours.sh
}
kravan () {
libreoffice $HOME/Documents/Hjemmekontor/Kravspesifikasjon/Kravspesifikasjon\ for\ SD\ 2.docx
}
esave () {
echo "test esave"
}
energi () {
echo "test energi"
}
problemer () {
echo "test energi"
}
prosjekt () {
echo "test energi"
}
# Piping the above array into dmenu.
# We use "printf '%s\n'" to format the array one item to a line.
#choice=$(printf '%s\n' "${options[@]}" | dmenu -i -l 20 -p 'Edit config:')
choice=$(printf '%s\n' "${options[@]}" | dmenu -i -l 20 -p 'Work enviroment:')
# What to do when/if we choose 'quit'.
#if [[ "$choice" == "quit" ]]; then
# echo "Program terminated." && exit 0
# What to do when/if we choose a file to edit.
#elif [ "$choice" ]; then
case "$choice" in
"Rammeavtale")
ramma
;;
"Parameterkontroll")
parameter_kontroll
;;
"Kravspesifikasjone")
kravan
;;
"quit")
exit
;;
esac
# cfg=$(printf '%s\n' "${choice}" | awk '{print $NF}')
# $DMEDITOR "$cfg"
# What to do if we just escape without choosing anything.
#else
# echo "Program terminated." && exit 0
#fi