aboutsummaryrefslogtreecommitdiffstats
path: root/zsh/profile.org
blob: df55971dbf6ed85e33ff8c6d741c3976e26da05e (plain)
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
* Variables

Here we set some important variables that are used by other parts of the
configuration.

** Guix

Set up my Guix profile so that I can use all the right tools.

#+begin_src sh
  export GUIX_PROFILE="/home/chelys/.guix-profile"
  source "$GUIX_PROFILE/etc/profile"
#+end_src

Add the system's data directories to =XDG_DATA_DIRS=. Guix will set the =XDG_DATA_DIRS= environment variable, but this will prevent the rest of the system from using the default ones. This causes a crash in Firefox when I try to upload or download files (well, open a file dialog). According to the [[https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html][XDG Base Directory Specification]]:

#+begin_quote
If =$XDG_DATA_DIRS= is either not set or empty, a value equal to =/usr/local/share/:/usr/share/= should be used.
#+end_quote

#+begin_src sh
  export XDG_DATA_DIRS="${XDG_DATA_DIRS}${XDG_DATA_DIRS:+:}/usr/local/share/:/usr/share/"
#+end_src

** XDG

  I keep my XDG files in the normal place, but specifying them in an
  environment variable makes things a little easier/clearer.

  Set the config home.

  #+BEGIN_SRC sh
    export XDG_CONFIG_HOME="${HOME}/.config"
  #+END_SRC

  Set the data home.

  #+BEGIN_SRC sh
    export XDG_DATA_HOME="${HOME}/.local/share"
  #+END_SRC

** PATH

  Add composer binaries to PATH.

  #+BEGIN_SRC sh
    PATH="${XDG_CONFIG_HOME}/composer/vendor/bin:${PATH}"
  #+END_SRC

  Add =$HOME/usr/bin= to =$PATH= because that is where I keep all of
  my personal utilities and helper commands.

  #+BEGIN_SRC sh
    PATH="${HOME}/usr/bin:${PATH}"
  #+END_SRC

  Export it so programs and subshells know about it.

  #+BEGIN_SRC sh
    export PATH
  #+END_SRC

** Dbus

  Make the session bus address fixed so other processes can know where
  to find it.

  #+BEGIN_SRC sh
    DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(id -u)/bus"
  #+END_SRC

  Export it so programs and subshells know about it.

  #+BEGIN_SRC sh
    export DBUS_SESSION_BUS_ADDRESS
  #+END_SRC

** .Net

I don't want to send any telemetry to Microsoft about my usage of the ~dotnet~ tool.

#+begin_src sh
  export DOTNET_CLI_TELEMETRY_OPTOUT=1
#+end_src

** SCSH

Add a directory in my home to the list where scsh will try to load libraries from when using =-ll=. This variable is treated as a list of s-exps, so each element needs to be quoted. And =#f= means to insert the default list of directories there. scsh doesn't understand what =~/= means, so we need to use escaped quotes instead of wrapping everything in single quotes.

#+begin_src sh
  export SCSH_LIB_DIRS="#f \"${HOME}/usr/share/scsh/\""
#+end_src

** Askpass

#+begin_src sh
  export SUDO_ASKPASS="${HOME}/usr/bin/askpass-rofi"
#+end_src

* Systemd

  Import some variables into the systemd environment so that services
  started after this know about them.

  #+BEGIN_SRC sh
    systemctl --user import-environment PATH
  #+END_SRC