├── .gitignore
├── .gitlab-ci.yml
├── .gitmodules
├── Makefile
├── README.md
├── afterburner
└── Profiles
│ ├── MSIAfterburner.cfg
│ ├── Profile1.cfg
│ ├── VEN_10DE&DEV_1F08&SUBSYS_3FC11458&REV_A1&BUS_0&DEV_8&FN_0.cfg
│ └── VEN_1B36&DEV_0100&SUBSYS_11001AF4&REV_05&BUS_0&DEV_2&FN_0.cfg
├── altdrag
└── AltSnap.ini
├── archlinux
└── etc
│ ├── pacman.conf
│ └── pacman.d
│ └── hooks
│ └── nvidia.hook
├── bashrc
├── bash_profile
├── bashrc
├── bashrc_custom
├── inputrc_linux
├── inputrc_macos
└── modules
│ ├── aliases
│ ├── colours
│ ├── command_not_found
│ ├── env_var
│ ├── functions
│ └── prompt
├── bspwm
├── bspwmrc
├── float
└── resize
├── firefox
├── chrome
│ ├── userChrome.css
│ └── userContent.css
└── user.js
├── fontconfig
├── conf.d
│ └── 00-blacklist_nimbus.conf
└── fonts.conf
├── freebsd
└── ThinkPad-X220
│ ├── loader.conf
│ ├── rc.conf
│ └── xorg.conf.d
│ ├── card.conf
│ ├── flags.conf
│ └── keyboard.conf
├── gitconfig
└── gitconfig
├── htop
└── htoprc
├── iterm2
└── com.googlecode.iterm2.plist
├── looking-glass-client
└── looking-glass-client.ini
├── mpv
└── mpv.conf
├── neofetch
├── config.conf
└── navyseals.conf
├── npm
└── npmrc
├── picom
└── picom.conf
├── plasma
├── color-schemes
│ └── BreezeDarkOld.colors
├── desktoptheme
│ └── breeze-dark-transparent
│ │ ├── colors
│ │ ├── metadata.desktop
│ │ └── widgets
│ │ └── plasmoidheading.svgz
├── dolphin
│ ├── dolphin.shortcuts
│ └── dolphinrc
├── gwenview
│ └── gwenviewrc
└── konsole
│ ├── konsolerc
│ └── profile
│ ├── Profile.profile
│ ├── base16-tomorrow-night.colorscheme
│ └── readme.txt
├── polybar
├── config
├── polybar_bspwm
└── reload
├── qutebrowser
├── base16-tomorrow-night.config.py
└── config.py
├── screenshots
└── macos.png
├── scripts
├── color
│ ├── coins.bash
│ ├── coins.py
│ └── ntsc_color_bars.bash
├── info
│ ├── show_bat
│ ├── show_cpu
│ ├── show_disk
│ ├── show_mem
│ ├── show_net
│ └── show_song
└── utils
│ ├── android_debloat
│ ├── count_lines
│ ├── feh-wal
│ ├── iommu
│ ├── nvidia_toggle
│ ├── open_iterm2
│ ├── ozbargain-cli
│ ├── update-git-repos
│ ├── vim-plugins
│ ├── wal
│ └── xfce-wal
├── skhd
└── skhdrc
├── st
└── config.h
├── sxhkd
└── sxhkdrc
├── systemd
├── wallpaper.service
└── wallpaper.timer
├── tmux
├── info.bash
└── tmux.conf
├── ubersicht
├── bar.jsx
├── config.json
├── lib
│ ├── style.jsx
│ └── util.jsx
├── spaces.jsx
├── status.jsx
└── widget.json
├── vimrc
├── after
│ └── ftplugin
│ │ ├── go.vim
│ │ └── markdown.vim
└── vimrc
└── yabai
└── yabairc
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | *.swp
3 | st/st*
4 | qutebrowser/*[!.py]
5 | vimrc/.netrwhist
6 | mpv/watch_later
7 |
--------------------------------------------------------------------------------
/.gitlab-ci.yml:
--------------------------------------------------------------------------------
1 | variables:
2 | PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
3 |
4 | cache:
5 | paths:
6 | - .cache/pip
7 | - venv/
8 |
9 | stages:
10 | - lint
11 |
12 | shellcheck:
13 | image: ubuntu:latest
14 | stage: lint
15 | before_script:
16 | - apt --yes update && apt --yes install shellcheck
17 | - shellcheck --version
18 | script:
19 | - shopt -s globstar
20 | - shopt -s extglob
21 | - |
22 | shellcheck \
23 | bashrc/bash* \
24 | bashrc/modules/* \
25 | bspwm/* \
26 | polybar/polybar_bspwm \
27 | polybar/reload \
28 | scripts/color/*.bash \
29 | scripts/info/* \
30 | scripts/utils/count_lines \
31 | scripts/utils/feh-wal \
32 | scripts/utils/iommu \
33 | scripts/utils/nvidia_toggle \
34 | scripts/utils/open_iterm2 \
35 | scripts/utils/ozbargain-cli \
36 | scripts/utils/vim-plugins \
37 | scripts/utils/wal \
38 | scripts/utils/xfce-wal \
39 | tmux/info.bash \
40 | yabai/yabairc
41 | rules:
42 | - changes:
43 | - bashrc/bash*
44 | - bashrc/modules/*
45 | - bspwm/*
46 | - polybar/polybar_bspwm
47 | - polybar/reload
48 | - scripts/color/*.bash
49 | - scripts/info/*
50 | - scripts/utils/android_debloat
51 | - scripts/utils/count_lines
52 | - scripts/utils/feh-wal
53 | - scripts/utils/iommu
54 | - scripts/utils/nvidia_toggle
55 | - scripts/utils/open_iterm2
56 | - scripts/utils/ozbargain-cli
57 | - scripts/utils/vim-plugins
58 | - scripts/utils/wal
59 | - scripts/utils/xfce-wal
60 | - tmux/info.bash
61 | - yabai/yabairc
62 |
63 | python-lint:
64 | image: python:slim
65 | stage: lint
66 | before_script:
67 | - python -V
68 | - type -p python
69 | - pip install virtualenv
70 | - virtualenv venv
71 | - source venv/bin/activate
72 | - pip install pylint flake8
73 | script:
74 | - |
75 | python -m pylint ./scripts/color/coins.py \
76 | ./scripts/utils/update-git-repos
77 | - |
78 | python -m flake8 ./scripts/color/coins.py \
79 | ./scripts/utils/update-git-repos
80 | rules:
81 | - changes:
82 | - scripts/color/coins.py
83 | - scripts/utils/update-git-repos
84 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "vimrc/bundle/lightline.vim"]
2 | path = vimrc/pack/plugin/start/lightline.vim
3 | url = https://github.com/itchyny/lightline.vim
4 | [submodule "vimrc/bundle/indentLine"]
5 | path = vimrc/pack/plugin/start/indentLine
6 | url = https://github.com/Yggdroot/indentLine.git
7 | [submodule "vimrc/bundle/vim-surround"]
8 | path = vimrc/pack/plugin/start/vim-surround
9 | url = https://github.com/tpope/vim-surround
10 | [submodule "vimrc/bundle/vim-repeat"]
11 | path = vimrc/pack/plugin/start/vim-repeat
12 | url = https://github.com/tpope/vim-repeat
13 | [submodule "vimrc/bundle/tabular"]
14 | path = vimrc/pack/plugin/start/tabular
15 | url = https://github.com/godlygeek/tabular.git
16 | [submodule "vimrc/pack/plugin/start/vim-lsc"]
17 | path = vimrc/pack/plugin/start/vim-lsc
18 | url = https://github.com/natebosch/vim-lsc
19 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | MODE ?= install
2 | DRY ?= no
3 | LINK_CONFIGS = \
4 | bash_profile \
5 | bashrc \
6 | inputrc_linux \
7 | inputrc_macos \
8 | looking-glass-client \
9 | mpv \
10 | neofetch \
11 | npm \
12 | picom \
13 | qutebrowser \
14 | bspwm \
15 | sxhkd \
16 | systemd-wallpaper-service \
17 | systemd-wallpaper-timer \
18 | polybar \
19 | yabai \
20 | skhd \
21 | ubersicht \
22 | tmux \
23 | vim
24 |
25 | COPY_CONFIGS = \
26 | bashrc_custom \
27 | dolphin \
28 | fontconfig \
29 | gwenview \
30 | htop \
31 | konsole
32 |
33 | .PHONY: $(LINK_CONFIGS) $(COPY_CONFIGS)
34 |
35 | DOTFILES_DIR ?= ${PWD}
36 | HOME_DIR ?= ${HOME}
37 | CONFIG_DIR ?= $(HOME_DIR)/.config
38 |
39 | .DEFAULT:;
40 | all:;
41 |
42 | $(LINK_CONFIGS):
43 | $(eval $@_DEST := $(strip $(subst $<,,$^)))
44 | $(eval $@_BASEDIR := $(shell dirname "$($@_DEST)"))
45 | ifeq ($(MODE),install)
46 | ifeq ($(DRY),yes)
47 | @printf "[dry] '%s' -> '%s'\\n" "$($@_DEST)" "$<"
48 | else
49 | @# Remove previous link if it exists
50 | @if [ -L "$($@_DEST)" ]; then \
51 | rm -f "$($@_DEST)"; \
52 | fi
53 |
54 | @# Create parent directory if it does not exist
55 | @mkdir -p "$($@_BASEDIR)"
56 |
57 | @# Link the source to the destination
58 | @ln -svf "$<" "$($@_DEST)"
59 | endif # ifeq ($(DRY),yes)
60 | endif # ifeq ($(MODE),install)
61 | ifeq ($(MODE),uninstall)
62 | ifeq ($(DRY),yes)
63 | @printf "[dry] removed '%s'\\n" "$($@_DEST)"
64 | else
65 | @if [ -L "$($@_DEST)" ]; then \
66 | rm -rfv "$($@_DEST)"; \
67 | fi
68 | endif # ifeq ($(DRY),yes)
69 | endif # ifeq ($(MODE),uninstall)
70 | ifneq ($(MODE),uninstall)
71 | ifneq ($(MODE),install)
72 | @printf "%s: unknown mode: %s\\n" "$@" "$(MODE)"
73 | @exit 1
74 | endif # ifneq ($(MODE),install)
75 | endif # ifneq ($(MODE),uninstall)
76 |
77 |
78 | $(COPY_CONFIGS):
79 | $(eval $@_DEST := $(strip $(subst $<,,$^)))
80 | $(eval $@_BASEDIR := $(shell dirname "$($@_DEST)"))
81 | ifeq ($(MODE),install)
82 | ifeq ($(DRY),yes)
83 | @printf "[dry] '%s' -> '%s'\\n" "$<" "$($@_DEST)"
84 | else
85 | @# If source is a file, destination should also be a file
86 | @# If destination is a directory, the source file will be copied into the
87 | @# destination directory. Exit if that's the case
88 | @if [ -e "$($@_DEST)" ] && [ -d "$($@_DEST)" ] && [ -f "$<" ]; then \
89 | printf "Source '%s' is a file. " "$<"; \
90 | printf "Target '%s' is a directory. " "$($@_DEST)"; \
91 | printf "Copying to this directory breaks the path.\\n" "$($@_DEST)"; \
92 | printf "Exiting...\\n"; \
93 | exit 1; \
94 | fi
95 |
96 | @# Overwrite the destination directory if the source is a directory
97 | @if [ -e "$($@_DEST)" ] && [ -d "$<" ]; then \
98 | rm -rf "$($@_DEST)"; \
99 | fi
100 |
101 | @# Create parent directory if it does not exist
102 | @mkdir -p "$($@_BASEDIR)"
103 |
104 | @# Copy the source to the destination
105 | @cp -r -v "$<" "$($@_DEST)"
106 | endif # ifeq ($(DRY),yes)
107 | endif # ifeq ($(MODE),install)
108 | ifeq ($(MODE),uninstall)
109 | ifeq ($(DRY),yes)
110 | @printf "[dry] removed '%s'\\n" "$($@_DEST)"
111 | else
112 | @if [ -e "$($@_DEST)" ]; then \
113 | rm -rfv "$($@_DEST)"; \
114 | fi
115 | endif # ifeq ($(DRY),yes)
116 | endif # ifeq ($(MODE),uninstall)
117 | ifneq ($(MODE),uninstall)
118 | ifneq ($(MODE),install)
119 | @printf "%s: unknown mode: %s\\n" "$@" "$(MODE)"
120 | @exit 1
121 | endif # ifneq ($(MODE),install)
122 | endif # ifneq ($(MODE),uninstall)
123 |
124 | # format:
125 | # application-config: \
126 | # source-file \
127 | # destination-file
128 |
129 |
130 | ### LINK_CONFIGS
131 |
132 | # Bash configuration files is os dependant.
133 | # It also includes .bash_profile, .bashrc and .inputrc
134 | bash_linux: bash inputrc_linux
135 | bash_macos: bash inputrc_macos
136 | bash: bash_profile bashrc
137 |
138 | # Systemd services and timers requires linking multiple files
139 | systemd-wallpaper: systemd-wallpaper-service systemd-wallpaper-timer
140 |
141 | bash_profile: \
142 | $(DOTFILES_DIR)/bashrc/bash_profile \
143 | $(HOME_DIR)/.bash_profile
144 |
145 | bashrc: \
146 | $(DOTFILES_DIR)/bashrc/bashrc \
147 | $(HOME_DIR)/.bashrc
148 |
149 | inputrc_linux: \
150 | $(DOTFILES_DIR)/bashrc/inputrc_linux \
151 | $(HOME_DIR)/.inputrc
152 |
153 | inputrc_macos: \
154 | $(DOTFILES_DIR)/bashrc/inputrc_macos \
155 | $(HOME_DIR)/.inputrc
156 |
157 | looking-glass-client: \
158 | $(DOTFILES_DIR)/looking-glass-client/looking-glass-client.ini \
159 | $(HOME_DIR)/.looking-glass-client.ini
160 |
161 | mpv: \
162 | $(DOTFILES_DIR)/mpv \
163 | $(CONFIG_DIR)/.mpv
164 |
165 | neofetch: \
166 | $(DOTFILES_DIR)/neofetch \
167 | $(CONFIG_DIR)/neofetch
168 |
169 |
170 | npm: \
171 | $(DOTFILES_DIR)/npm/npmrc \
172 | $(HOME_DIR)/.npmrc
173 |
174 | picom: \
175 | $(DOTFILES_DIR)/picom \
176 | $(CONFIG_DIR)/picom
177 |
178 | qutebrowser: \
179 | $(DOTFILES_DIR)/qutebrowser \
180 | $(CONFIG_DIR)/qutebrowser
181 |
182 | bspwm: \
183 | $(DOTFILES_DIR)/bspwm \
184 | $(CONFIG_DIR)/bspwm
185 |
186 | sxhkd: \
187 | $(DOTFILES_DIR)/sxhkd \
188 | $(CONFIG_DIR)/sxhkd
189 |
190 | systemd-wallpaper-service: \
191 | $(DOTFILES_DIR)/systemd/wallpaper.service \
192 | $(CONFIG_DIR)/systemd/user/wallpaper.service
193 |
194 | systemd-wallpaper-timer: \
195 | $(DOTFILES_DIR)/systemd/wallpaper.timer \
196 | $(CONFIG_DIR)/systemd/user/wallpaper.timer
197 |
198 | polybar: \
199 | $(DOTFILES_DIR)/polybar \
200 | $(CONFIG_DIR)/polybar
201 |
202 | yabai: \
203 | $(DOTFILES_DIR)/yabai/yabairc \
204 | $(HOME_DIR)/.yabairc
205 |
206 | skhd: \
207 | $(DOTFILES_DIR)/skhd/skhdrc \
208 | $(HOME_DIR)/.skhdrc
209 |
210 | ubersicht: \
211 | $(DOTFILES_DIR)/ubersicht \
212 | $(HOME_DIR)/Library/Application\ Support/Übersicht/widgets/dotfiles-bar
213 |
214 | tmux: \
215 | $(DOTFILES_DIR)/tmux/tmux.conf \
216 | $(HOME_DIR)/.tmux.conf
217 |
218 | vim: \
219 | $(DOTFILES_DIR)/vimrc \
220 | $(HOME_DIR)/.vim
221 |
222 |
223 | ### COPY_CONFIGS
224 |
225 | bashrc_custom:\
226 | $(DOTFILES_DIR)/bashrc/bashrc_custom \
227 | $(HOME_DIR)/.bashrc_custom
228 |
229 | dolphin: \
230 | $(DOTFILES_DIR)/plasma/dolphin/dolphinrc \
231 | $(CONFIG_DIR)/dolphinrc
232 |
233 | fontconfig: \
234 | $(DOTFILES_DIR)/fontconfig \
235 | $(CONFIG_DIR)/fontconfig
236 |
237 | gwenview: \
238 | $(DOTFILES_DIR)/plasma/gwenview/gwenviewrc \
239 | $(CONFIG_DIR)/gwenviewrc
240 |
241 | htop: \
242 | $(DOTFILES_DIR)/htop \
243 | $(CONFIG_DIR)/htop
244 |
245 | konsole: \
246 | $(DOTFILES_DIR)/plasma/konsole/konsolerc \
247 | $(CONFIG_DIR)/konsolerc
248 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Dotfiles
2 |
3 | 
4 |
5 | This repository contains all of the dotfiles that I use across multiple
6 | machines. It is platform agnostic and works on Linux, macOS and FreeBSD. The
7 | repo resides in the `~/.dotfiles` folder because some scripts and
8 | configurations have this path hard coded in them. However, if you're like me
9 | and like to keep all of your git repositories in one folder, then you can
10 | symlink `~/.dotfiles` to where ever you clone this repository.
11 |
12 | ## Usage
13 | ### Install
14 | ```sh
15 | $ git clone https://gitlab.com/julian-heng/dotfiles.git ~/.dotfiles --recursive
16 | $ cd ~/.dotfiles
17 | $ make DRY=yes [targets] # Dry run
18 | $ make [targets]
19 | ```
20 |
21 | Note: For FreeBSD, you need to install `gmake` as a dependency because the
22 | Makefile uses the GNU extensions
23 |
24 | ### Uninstall
25 | ```sh
26 | $ cd ~/.dotfiles
27 | $ make DRY=yes MODE=uninstall [targets] # Dry run
28 | $ make MODE=uninstall [targets]
29 | ```
30 |
31 | ## Makefile
32 | Installation of the dotfiles is done through a Makefile.
33 |
34 | It is very important to note that by installing these configurations, they will
35 | overwrite the current configuration that you are currently using. If you are
36 | going to use this Makefile and have configurations that you want to keep,
37 | please make a backup before installing.
38 |
39 | ### Options
40 | Setting the environment variable `MODE` and `DRY` changes the actions applied
41 | to the targets. Other environment variables also exists, like `DOTFILES_DIR`,
42 | `HOME_DIR` and `CONFIG_DIR` exists as well, but it is not recommended to change
43 | these.
44 |
45 | | Option | Valid Values | Default |
46 | |--------|--------------------|---------|
47 | | MODE | install, uninstall | install |
48 | | DRY | yes, no | no |
49 |
50 | ### Link and Copy
51 | Some configuration files are not modified by the program at runtime, thus we
52 | are able to simply link these files to where they are normally stored. However,
53 | some configuration files are modified as the program is running, meaning that
54 | we cannot link the file or else the file will get modified in the repository.
55 | To circumvent this, we just copy the file to where it should be in order to
56 | keep the clean copy in the repo.
57 |
58 | The targets that are copied to the destination are stored in `COPY_CONFIGS`,
59 | whilst targets that are symlinked are stored in `LINK_CONFIGS`.
60 |
61 | ## Dotfiles Details
62 | ### BASH
63 | #### Aliases
64 | ##### update
65 | The `update` alias uses the `distro` variable that is set in `.bashrc` in order
66 | to determine which command it uses to update the system packages. If it is run
67 | on an unknown distribution, `update` will not be set.
68 |
69 | #### Environment Variables
70 | ##### PATH
71 | The script directory `scripts/info` and `scripts/utils` is appended to the
72 | `PATH` environment variable to allow running these scripts anywhere. On macOS,
73 | `~/Library/Python/*/bin` and `/usr/local/opt/qt/bin` will be added if they
74 | exists. Otherwise, `~/.local/bin` will be added instead.
75 |
76 | ##### DISPLAY
77 | On macOS, if Xquartz is installed, the `DISPLAY` environment variable will be set
78 | and exported.
79 |
80 | #### ~/.inputrc
81 | BASH is generally portable in that the configurations will work across
82 | different operating systems. However, the `.inputrc` file works differently
83 | between Linux and macOS/FreeBSD. As such, in order to install the BASH
84 | configurations, use `bash_linux` for Linux and `bash_macos` for macOS/FreeBSD.
85 | To install just the BASH configurations without the `.inputrc` file, use the
86 | `bash` target.
87 |
88 | #### ~/.bashrc_custom
89 | If `~/.bashrc_custom` exists, `~/.bashrc` will automatically source this file.
90 | This is useful if you need to add your own custom BASH configuration after
91 | sourcing the main configuration. For example, after logging in on `tty1`, start
92 | an X session, otherwise go to the `tty` console. `~/.bashrc_custom` would check
93 | the current `tty` is `tty1` and executes `xinit`.
94 |
95 | ### Scripts
96 | #### Info
97 | Polybar, Tmux and Übersicht uses
98 | [sys-line](https://www.gitlab.com/julian-heng/sys-line) in order to fetch
99 | system information. If `sys-line` is not installed, the output will be
100 | incomplete. The Tmux configuration does use the info scripts in `scripts/info`
101 | as a fallback if `sys-line` is not installed.
102 |
103 | #### Utils
104 | `scripts/utils` contains simple BASH and Python scripts. Some of these are
105 | written just for fun, while some are written because I needed to automate a
106 | task.
107 |
108 | ##### iommu
109 | Prints the IOMMU groups and the PCI devices under that group. Used to determine
110 | if it is possible to pass through PCI devices into a QEMU/KVM virtual machine.
111 |
112 | ##### nvidia_toggle
113 | Toggles between the `vfio_pci` and the `nvidia` kernel module.
114 |
115 | ##### update-git-repos
116 | Performs a `git pull` in a directory containing multiple git repositories.
117 |
118 | ##### feh-wal, xfce-wal and wal
119 | These scripts changes the wallpaper, with `wal` and `feh-wal` using feh, while
120 | `xfce-wal` uses `xfconf-query`. `wal` was written first before being rewritten
121 | to `feh-wal`.
122 |
123 | ### Vim
124 | The plugin manager is Vim's builtin plugin manager.
125 |
126 | The list of plugins used are as follows:
127 |
128 | | Plugin | Author | Repository |
129 | |----------------------|----------------|--------------------------------------------------|
130 | | indentLine | Yggdroot | [link](https://github.com/Yggdroot/indentLine) |
131 | | lightline | itchyny | [link](https://github.com/itchyny/lightline.vim) |
132 | | tabular | Matt Wozniski | [link](https://github.com/godlygeek/tabular) |
133 | | vim-repeat | Tim Pope | [link](https://github.com/tpope/vim-repeat) |
134 | | vim-surround | Tim Pope | [link](https://github.com/tpope/vim-surround) |
135 | | vim-lsc | natebosch | [link](https://github.com/natebosch/vim-lsc) |
136 |
--------------------------------------------------------------------------------
/afterburner/Profiles/MSIAfterburner.cfg:
--------------------------------------------------------------------------------
1 | [Settings]
2 | Views=
3 | LastUpdateCheck=61596A00h
4 | UpdateCheckingPeriod=0
5 | LowLevelInterface=1
6 | MMIOUserMode=1
7 | HAL=1
8 | Driver=1
9 | Skin=Default3.usf
10 | StartWithWindows=1
11 | StartMinimized=1
12 | HwPollPeriod=1000
13 | LockProfiles=0
14 | ShowHints=1
15 | ShowTooltips=1
16 | LCDFont=font4x6.dat
17 | RememberSettings=0
18 | FirstRun=0
19 | FirstUserDefineClick=1
20 | FirstServerRun=0
21 | CurrentGpu=0
22 | Sync=1
23 | Link=1
24 | LinkThermal=1
25 | FanSync=1
26 | CurrentFan=0
27 | ShowOSDTime=0
28 | CaptureOSD=1
29 | Profile1Hotkey=00000000h
30 | Profile2Hotkey=00000000h
31 | Profile3Hotkey=00000000h
32 | Profile4Hotkey=00000000h
33 | Profile5Hotkey=00000000h
34 | OSDToggleHotkey=00000000h
35 | OSDOnHotkey=00000000h
36 | OSDOffHotkey=00000000h
37 | OSDServerBlockHotkey=00000000h
38 | LimiterToggleHotkey=00000000h
39 | LimiterOnHotkey=00000000h
40 | LimiterOffHotkey=00000000h
41 | ScreenCaptureHotkey=00000000h
42 | VideoCaptureHotkey=00000000h
43 | VideoPrerecordHotkey=00000000h
44 | PTTHotkey=00000000h
45 | PTT2Hotkey=00000000h
46 | BeginRecordHotkey=00000000h
47 | EndRecordHotkey=00000000h
48 | BeginLoggingHotkey=00000000h
49 | EndLoggingHotkey=00000000h
50 | ClearHistoryHotkey=00000000h
51 | BenchmarkPath=%ABDir%\Benchmark.txt
52 | AppendBenchmark=1
53 | ScreenCaptureFormat=bmp
54 | ScreenCaptureFolder=
55 | ScreenCaptureQuality=100
56 | VideoCaptureFolder=
57 | VideoCaptureFormat=MJPG
58 | VideoCaptureQuality=85
59 | VideoCaptureFramerate=30
60 | VideoCaptureFramesize=00000002h
61 | VideoCaptureThreads=FFFFFFFFh
62 | AudioCaptureFlags=00000003h
63 | VideoCaptureFlagsEx=00000000h
64 | AudioCaptureFlags2=00000000h
65 | VideoCaptureContainer=avi
66 | VideoPrerecordSizeLimit=256
67 | VideoPrerecordTimeLimit=600
68 | AutoPrerecord=0
69 | WindowX=485
70 | WindowY=315
71 | ProfileContents=1
72 | Profile2D=-1
73 | Profile3D=-1
74 | SwAutoFanControl=1
75 | SwAutoFanControlFlags=00000008h
76 | SwAutoFanControlPeriod=5000
77 | SwAutoFanControlCurve=0000010004000000000000000000704200000000000082420000E84100008C42000048420000B4420000A0420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
78 | RestoreAfterSuspendedMode=1
79 | PauseMonitoring=0
80 | ShowPerformanceProfilerStatus=0
81 | ShowPerformanceProfilerPanel=0
82 | AttachMonitoringWindow=1
83 | HideMonitoring=0
84 | MonitoringWindowOnTop=1
85 | LogPath=%ABDir%\HardwareMonitoring.hml
86 | EnableLog=0
87 | RecreateLog=0
88 | LogLimit=10
89 | OSDLayout=1
90 | UnlockVoltageControl=0
91 | UnlockVoltageMonitoring=0
92 | OEM=0
93 | ForceConstantVoltage=0
94 | SingleTrayIconMode=0
95 | Fahrenheit=0
96 | Time24=1
97 | LCDGraph=0
98 | Language=
99 | LayeredWindowMode=1
100 | LayeredWindowAlpha=244
101 | ScaleFactor=100
102 | Sources=+GPU1 temperature,+GPU1 usage,-GPU2 usage,-GPU1 FB usage,-GPU1 VID usage,-GPU1 BUS usage,+GPU1 memory usage,-GPU2 memory usage,+GPU1 core clock,+GPU1 memory clock,+GPU1 power percent,+GPU1 power,+GPU1 fan speed,+GPU1 fan tachometer,-GPU1 temp limit,-GPU1 power limit,-GPU1 voltage limit,-GPU1 no load limit,-CPU1 temperature,-CPU2 temperature,-CPU3 temperature,-CPU4 temperature,-CPU5 temperature,-CPU6 temperature,-CPU7 temperature,-CPU8 temperature,-CPU9 temperature,-CPU10 temperature,-CPU11 temperature,-CPU12 temperature,-CPU temperature,-CPU1 usage,-CPU2 usage,-CPU3 usage,-CPU4 usage,-CPU5 usage,-CPU6 usage,-CPU7 usage,-CPU8 usage,-CPU9 usage,-CPU10 usage,-CPU11 usage,-CPU12 usage,+CPU usage,+RAM usage,-Commit charge
103 | [ATIADLHAL]
104 | UnofficialOverclockingMode=0
105 | UnofficialOverclockingDrvReset=1
106 | UnifiedActivityMonitoring=0
107 | EraseStartupSettings=0
108 | [Source GPU1 temperature]
109 | ShowInOSD=0
110 | ShowInLCD=0
111 | ShowInTray=0
112 | AlarmThresholdMin=
113 | AlarmThresholdMax=
114 | AlarmFlags=0
115 | AlarmTimeout=5000
116 | AlarmApp=
117 | AlarmAppCmdLine=
118 | EnableDataFiltering=0
119 | MaxLimit=100
120 | MinLimit=0
121 | Group=
122 | Name=
123 | TrayTextColor=FF0000h
124 | TrayIconType=0
125 | OSDItemType=0
126 | GraphColor=00FF00h
127 | Formula=
128 | [Source GPU1 VID usage]
129 | ShowInOSD=0
130 | ShowInLCD=0
131 | ShowInTray=0
132 | AlarmThresholdMin=
133 | AlarmThresholdMax=
134 | AlarmFlags=0
135 | AlarmTimeout=5000
136 | AlarmApp=
137 | AlarmAppCmdLine=
138 | EnableDataFiltering=0
139 | MaxLimit=100
140 | MinLimit=0
141 | Group=
142 | Name=
143 | TrayTextColor=FF0000h
144 | TrayIconType=0
145 | OSDItemType=0
146 | GraphColor=00FF00h
147 | Formula=
148 | [Source CPU temperature]
149 | ShowInOSD=0
150 | ShowInLCD=0
151 | ShowInTray=0
152 | AlarmThresholdMin=
153 | AlarmThresholdMax=
154 | AlarmFlags=0
155 | AlarmTimeout=5000
156 | AlarmApp=
157 | AlarmAppCmdLine=
158 | EnableDataFiltering=0
159 | MaxLimit=100
160 | MinLimit=0
161 | Group=
162 | Name=
163 | TrayTextColor=FF0000h
164 | TrayIconType=0
165 | OSDItemType=0
166 | GraphColor=00FF00h
167 | Formula=
168 |
--------------------------------------------------------------------------------
/afterburner/Profiles/Profile1.cfg:
--------------------------------------------------------------------------------
1 | [Settings]
2 | ProfileContents=1
3 |
--------------------------------------------------------------------------------
/afterburner/Profiles/VEN_10DE&DEV_1F08&SUBSYS_3FC11458&REV_A1&BUS_0&DEV_8&FN_0.cfg:
--------------------------------------------------------------------------------
1 | [Startup]
2 | Format=2
3 | PowerLimit=
4 | ThermalLimit=
5 | ThermalPrioritize=
6 | CoreClkBoost=
7 | VFCurve=
8 | MemClkBoost=
9 | FanMode=
10 | FanSpeed=
11 | [Defaults]
12 | Format=2
13 | PowerLimit=100
14 | ThermalLimit=
15 | ThermalPrioritize=0
16 | CoreClkBoost=0
17 | VFCurve=0000020080000000000000000000E1430000E143000000000020E4430000E143000000000040E7430000E143000000000060EA430000E143000000000080ED430000E1430000000000A0F0430000E1430000000000C0F3430000E1430000000000E0F6430000E143000000000000FA430000E143000000000020FD430000E14300000000002000440080E8430000000000B001440080F7430000000000400344004003440000000000D0044400000744000000000060064400800E440000000000F0074400401244000000000080094400C019440000000000100B44004021440000000000A00C4400802C440000000000300E44000034440000000000C00F4400803B440000000000501144000043440000000000E0124400804A440000000000701444000052440000000000001644008059440000000000901744000061440000000000201944008068440000000000B01A44000070440000000000401C44008077440000000000D01D4400007F440000000000601F44004083440000000000F0204400008744000000000080224400C08A44000000000010244400808E440000000000A02544004092440000000000302744000096440000000000C0284400C099440000000000502A4400809D440000000000E02B4400609F440000000000702D440020A3440000000000002F4400E0A644000000000090304400A0AA4400000000002032440080AC440000000000B033440040B04400000000004035440020B2440000000000D036440000B444000000000060384400E0B5440000000000F0394400C0B7440000000000803B4400A0B9440000000000103D440080BB440000000000A03E440060BD4400000000003040440040BF440000000000C041440040BF4400000000005043440020C1440000000000E044440000C344000000000070464400E0C444000000000000484400C0C644000000000090494400A0C8440000000000204B440080CA440000000000B04C440060CC440000000000404E440060CC440000000000D04F440040CE4400000000006051440020D0440000000000F052440000D244000000000080544400E0D344000000000010564400E0D3440000000000A0574400C0D544000000000030594400A0D7440000000000C05A4400A0D7440000000000505C440080D9440000000000E05D440060DB440000000000705F440060DB4400000000000061440040DD4400000000009062440020DF4400000000002064440020DF440000000000B065440000E14400000000004067440000E1440000000000D0684400E0E2440000000000606A4400C0E4440000000000F06B4400C0E4440000000000806D4400A0E6440000000000106F4400A0E6440000000000A070440080E84400000000003072440080E8440000000000C073440060EA4400000000005075440060EA440000000000E076440060EA4400000000007078440040EC440000000000007A440040EC440000000000907B440020EE440000000000207D440020EE440000000000B07E440020EE4400000000002080440000F0440000000000E880440000F0440000000000B081440000F044000000000078824400E0F144000000000040834400E0F144000000000008844400E0F1440000000000D0844400E0F144000000000098854400E0F144000000000060864400E0F144000000000028874400E0F1440000000000F0874400E0F1440000000000B8884400E0F144000000000080894400E0F1440000000000488A4400E0F1440000000000108B4400E0F1440000000000D88B4400E0F1440000000000A08C4400E0F1440000000000688D4400E0F1440000000000308E4400E0F1440000000000F88E4400E0F1440000000000C08F4400E0F144000000000088904400E0F144000000000050914400E0F144000000000018924400E0F1440000000000E0924400E0F1440000000000A8934400E0F144000000000070944400E0F144000000000038954400E0F144000000000000964400E0F1440000000000C8964400E0F144000000000090974400E0F144000000000058984400E0F144000000000020994400E0F1440000000000E8994400E0F1440000000000B09A4400E0F1440000000000789B4400E0F14400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000060DB440000A6420060DB440000A6420060DB440000AA420060DB440000AA4200A0AA440000AE4200A0AA440000AE4200000000000000000000000000000000
18 | MemClkBoost=0
19 | FanMode=1
20 | FanSpeed=71
21 | [Settings]
22 | CaptureDefaults=0
23 | [Profile1]
24 | Format=2
25 | PowerLimit=100
26 | ThermalLimit=
27 | ThermalPrioritize=0
28 | CoreClkBoost=0
29 | VFCurve=0000020080000000000000000000E1430000E143000000000020E4430000E143000000000040E7430000E143000000000060EA430000E143000000000080ED430000E1430000000000A0F0430000E1430000000000C0F3430000E1430000000000E0F6430000E143000000000000FA430000E143000000000020FD430000E14300000000002000440080E8430000000000B001440000F04300000000004003440000FF430000000000D0044400400344000000000060064400C00A440000000000F0074400800E44000000000080094400C019440000000000100B44004021440000000000A00C4400C028440000000000300E44004030440000000000C00F4400C03744000000000050114400403F440000000000E0124400804A440000000000701444000052440000000000001644008059440000000000901744000061440000000000201944008068440000000000B01A44000070440000000000401C44008077440000000000D01D4400007F440000000000601F44004083440000000000F0204400008744000000000080224400C08A44000000000010244400808E440000000000A02544004092440000000000302744000096440000000000C0284400C099440000000000502A4400809D440000000000E02B440040A1440000000000702D440020A3440000000000002F4400E0A64400000000009030440080AC4400000000002032440060AE440000000000B033440040B04400000000004035440020B2440000000000D036440000B444000000000060384400E0B5440000000000F0394400C0B7440000000000803B4400A0B9440000000000103D440080BB440000000000A03E440060BD4400000000003040440040BF440000000000C041440020C14400000000005043440000C3440000000000E0444400E0C444000000000070464400C0C644000000000000484400A0C84400000000009049440080CA440000000000204B440060CC440000000000B04C440040CE440000000000404E440040CE440000000000D04F440020D04400000000006051440000D2440000000000F0524400E0D344000000000080544400C0D544000000000010564400C0D5440000000000A0574400A0D74400000000003059440080D9440000000000C05A440060DB440000000000505C440060DB440000000000E05D440040DD440000000000705F440020DF4400000000000061440020DF4400000000009062440000E144000000000020644400E0E2440000000000B0654400E0E244000000000040674400C0E4440000000000D0684400A0E6440000000000606A4400A0E6440000000000F06B440080E8440000000000806D440080E8440000000000106F440060EA440000000000A070440060EA4400000000003072440040EC440000000000C073440040EC4400000000005075440020EE440000000000E076440020EE4400000000007078440000F0440000000000007A440000F0440000000000907B4400E0F1440000000000207D4400E0F1440000000000B07E4400E0F144000000000020804400C0F3440000000000E8804400C0F3440000000000B0814400A0F544000000000078824400A0F544000000000040834400A0F544000000000008844400A0F5440000000000D0844400A0F544000000000098854400A0F544000000000060864400A0F544000000000028874400A0F5440000000000F0874400A0F5440000000000B8884400A0F544000000000080894400A0F5440000000000488A4400A0F5440000000000108B440080F7440000000000D88B440080F7440000000000A08C440080F7440000000000688D440080F7440000000000308E440080F7440000000000F88E440080F7440000000000C08F440080F74400000000008890440080F74400000000005091440080F74400000000001892440080F7440000000000E092440080F7440000000000A893440080F74400000000007094440080F74400000000003895440080F74400000000000096440080F7440000000000C896440080F74400000000009097440080F74400000000005898440080F74400000000002099440080F7440000000000E899440080F7440000000000B09A440080F7440000000000789B440080F74400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000060DB440000A6420060DB440000A6420060DB440000AA420060DB440000AA4200A0AA440000AE4200A0AA440000AE4200000000000000000000000000000000
30 | MemClkBoost=0
31 | FanMode=1
32 | FanSpeed=49
33 |
--------------------------------------------------------------------------------
/afterburner/Profiles/VEN_1B36&DEV_0100&SUBSYS_11001AF4&REV_05&BUS_0&DEV_2&FN_0.cfg:
--------------------------------------------------------------------------------
1 | [Startup]
2 | Format=2
3 | [Defaults]
4 | Format=2
5 | [Settings]
6 | CaptureDefaults=0
7 | [Profile1]
8 | Format=2
9 |
--------------------------------------------------------------------------------
/altdrag/AltSnap.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/julian-heng/dotfiles/5a0f853d0d86660ecf5cdc6570d418fdaf215788/altdrag/AltSnap.ini
--------------------------------------------------------------------------------
/archlinux/etc/pacman.conf:
--------------------------------------------------------------------------------
1 | #
2 | # /etc/pacman.conf
3 | #
4 | # See the pacman.conf(5) manpage for option and repository directives
5 |
6 | #
7 | # GENERAL OPTIONS
8 | #
9 | [options]
10 | # The following paths are commented out with their default values listed.
11 | # If you wish to use different paths, uncomment and update the paths.
12 | #RootDir = /
13 | #DBPath = /var/lib/pacman/
14 | #CacheDir = /var/cache/pacman/pkg/
15 | #LogFile = /var/log/pacman.log
16 | #GPGDir = /etc/pacman.d/gnupg/
17 | #HookDir = /etc/pacman.d/hooks/
18 | HoldPkg = pacman glibc
19 | #XferCommand = /usr/bin/curl -L -C - -f -o %o %u
20 | #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
21 | #CleanMethod = KeepInstalled
22 | Architecture = auto
23 |
24 | # Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
25 | #IgnorePkg = nvidia nvidia-settings nvidia-utils
26 | #IgnoreGroup =
27 |
28 | #NoUpgrade =
29 | #NoExtract =
30 |
31 | # Misc options
32 | #UseSyslog
33 | Color
34 | #NoProgressBar
35 | CheckSpace
36 | VerbosePkgLists
37 | #ParallelDownloads = 5
38 |
39 | # By default, pacman accepts packages signed by keys that its local keyring
40 | # trusts (see pacman-key and its man page), as well as unsigned packages.
41 | SigLevel = Required DatabaseOptional
42 | LocalFileSigLevel = Optional
43 | #RemoteFileSigLevel = Required
44 |
45 | # NOTE: You must run `pacman-key --init` before first using pacman; the local
46 | # keyring can then be populated with the keys of all official Arch Linux
47 | # packagers with `pacman-key --populate archlinux`.
48 |
49 | #
50 | # REPOSITORIES
51 | # - can be defined here or included from another file
52 | # - pacman will search repositories in the order defined here
53 | # - local/custom mirrors can be added here or in separate files
54 | # - repositories listed first will take precedence when packages
55 | # have identical names, regardless of version number
56 | # - URLs will have $repo replaced by the name of the current repo
57 | # - URLs will have $arch replaced by the name of the architecture
58 | #
59 | # Repository entries are of the format:
60 | # [repo-name]
61 | # Server = ServerName
62 | # Include = IncludePath
63 | #
64 | # The header [repo-name] is crucial - it must be present and
65 | # uncommented to enable the repo.
66 | #
67 |
68 | # The testing repositories are disabled by default. To enable, uncomment the
69 | # repo name header and Include lines. You can add preferred servers immediately
70 | # after the header, and they will be used before the default mirrors.
71 |
72 | #[testing]
73 | #Include = /etc/pacman.d/mirrorlist
74 |
75 | [core]
76 | Include = /etc/pacman.d/mirrorlist
77 |
78 | [extra]
79 | Include = /etc/pacman.d/mirrorlist
80 |
81 | #[community-testing]
82 | #Include = /etc/pacman.d/mirrorlist
83 |
84 | [community]
85 | Include = /etc/pacman.d/mirrorlist
86 |
87 | # If you want to run 32 bit applications on your x86_64 system,
88 | # enable the multilib repositories as required here.
89 |
90 | #[multilib-testing]
91 | #Include = /etc/pacman.d/mirrorlist
92 |
93 | #[multilib]
94 | #Include = /etc/pacman.d/mirrorlist
95 |
96 | # An example of a custom package repository. See the pacman manpage for
97 | # tips on creating your own repositories.
98 | #[custom]
99 | #SigLevel = Optional TrustAll
100 | #Server = file:///home/custompkgs
101 |
--------------------------------------------------------------------------------
/archlinux/etc/pacman.d/hooks/nvidia.hook:
--------------------------------------------------------------------------------
1 | [Trigger]
2 | Operation = Install
3 | Operation = Upgrade
4 | Operation = Remove
5 | Type = Package
6 | Target = nvidia
7 | Target = linux
8 |
9 | [Action]
10 | Description = Update Nvidia module in initcpio
11 | Depends = mkinitcpio
12 | When = PostTransaction
13 | NeedsTargets
14 | Exec=/bin/sh -c 'while read -r trg; do case $trg in linux) exit 0; esac; done; /usr/bin/mkinitcpio -P'
15 |
--------------------------------------------------------------------------------
/bashrc/bash_profile:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ########################
4 | ##### Bash Profile #####
5 | ########################
6 | # shellcheck disable=1090,1091,2148
7 | # vim: syntax=bash
8 |
9 | if [[ -f "${HOME}/.bashrc" ]]; then
10 | source "${HOME}/.bashrc"
11 | elif [[ -f /etc/bash.bashrc ]]; then
12 | source /etc/bash.bashrc
13 | else
14 | source /etc/bashrc
15 | fi
16 |
--------------------------------------------------------------------------------
/bashrc/bashrc:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##########################
4 | ##### Sourcing files #####
5 | ##########################
6 | # shellcheck disable=1090,2148,2154
7 | # vim: syntax=bash
8 |
9 | __secure_source()
10 | {
11 | [[ ! -f "${1}" ]] && \
12 | return 1
13 | source "${1}"
14 | return 0
15 | }
16 |
17 |
18 | secure_source()
19 | {
20 | if ! __secure_source "${1}"; then
21 | printf "%s\\n" "${fb[1]}Error:${reset} \"${1}\" is missing"
22 | fi
23 | }
24 |
25 | get_distro()
26 | {
27 | case "${OSTYPE:-$(uname -s)}" in
28 | "Darwin"|"darwin"*)
29 | distro="MacOS"
30 | ;;
31 |
32 | "Linux"|"linux"*)
33 | if [[ -f "/etc/lsb-release" ]]; then
34 | while read -r line && [[ ! "${distro}" ]]; do
35 | [[ "${line}" =~ 'DISTRIB_ID' ]] && \
36 | distro="${line/'DISTRIB_ID='}"
37 | done < /etc/lsb-release
38 | elif [[ -f "/etc/os-release" ]]; then
39 | while read -r line && [[ ! "${distro}" ]]; do
40 | [[ "${line}" =~ ^'NAME' ]] && \
41 | distro="${line/'NAME='}"
42 | done < /etc/os-release
43 | fi
44 | ;;
45 |
46 | "FreeBSD"|"freebsd"*)
47 | distro="FreeBSD"
48 | ;;
49 |
50 | "MSYS"*|"msys")
51 | distro="Windows"
52 | ;;
53 |
54 | "")
55 | printf "%s\\n" "Error: Cannot detect os" >&2
56 | ;;
57 | esac
58 |
59 | distro="${distro//\"}"
60 | printf "%s" "${distro}"
61 | }
62 |
63 | get_full_path()
64 | {
65 | target="$1"
66 |
67 | if [[ -f "${target}" ]]; then
68 | filename="${target##*/}"
69 | [[ "${filename}" == "${target}" ]] && \
70 | target="./${target}"
71 | target="${target%/*}"
72 | cd "${target}" || exit
73 | full_path="${PWD}/${filename}"
74 | elif [[ -d "${target}" ]]; then
75 | cd "${target}" || exit
76 | full_path="${PWD}"
77 | fi
78 |
79 | printf "%s" "${full_path%/}"
80 | }
81 |
82 | get_module_dir()
83 | {
84 | if type -p readlink > /dev/null 2>&1; then
85 | exe="readlink"
86 | elif type -p greadlink > /dev/null 2>&1; then
87 | exe="greadlink"
88 | elif type -p realpath > /dev/null 2>&1; then
89 | exe="realpath"
90 | fi
91 |
92 | if [[ "${exe}" ]]; then
93 | module_dir="$({ "${exe}" -f "${BASH_SOURCE[0]}" || "${exe}" "${BASH_SOURCE[0]}"; } 2> /dev/null)"
94 | module_dir="${module_dir%/*}/modules"
95 | else
96 | module_dir="${HOME}/.dotfiles/bashrc/modules"
97 | fi
98 |
99 | printf "%s" "${module_dir}"
100 | }
101 |
102 | main()
103 | {
104 | distro="$(get_distro)"
105 | module_dir="$(get_module_dir)"
106 |
107 | # Default modules
108 | modules=(
109 | "${module_dir}/colours"
110 | "${module_dir}/aliases"
111 | "${module_dir}/env_var"
112 | "${module_dir}/functions"
113 | "${module_dir}/prompt"
114 | )
115 |
116 | # Load bash-completion module if not already sourced
117 | ! type -p __load_completion > /dev/null && \
118 | if [[ -f "/usr/local/share/bash-completion/bash_completion" ]]; then
119 | modules+=("/usr/local/share/bash-completion/bash_completion")
120 | elif [[ -f "/usr/share/bash-completion/bash_completion" ]]; then
121 | modules+=("/usr/share/bash-completion/bash_completion")
122 | fi
123 |
124 | # Load command_not_found module if command_not_found_handle is not set
125 | ! type -p command_not_found_handle > /dev/null && \
126 | [[ -f "${module_dir}/command_not_found" ]] && \
127 | modules+=("${module_dir}/command_not_found")
128 |
129 | # Source .venv/bin/activate if it exists
130 | [[ -e "./.venv/bin/activate" ]] && \
131 | modules+=("./.venv/bin/activate")
132 |
133 | for i in "${modules[@]}"; do
134 | secure_source "${i}"
135 | done
136 |
137 | # Load custom bashrc
138 | __secure_source "${HOME}/.bashrc_custom"
139 | }
140 |
141 | [[ "$-" == *"i"* ]] && main
142 |
143 | unset __secure_source
144 | unset secure_source
145 | unset get_distro
146 | unset get_full_path
147 | unset get_module_dir
148 | unset main
149 |
--------------------------------------------------------------------------------
/bashrc/bashrc_custom:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # Insert custom bash settings here
3 |
--------------------------------------------------------------------------------
/bashrc/inputrc_linux:
--------------------------------------------------------------------------------
1 | ###################
2 | ##### inputrc #####
3 | ###################
4 |
5 | # Move through full words
6 | "\e[1;3D": backward-word # alt + left
7 | "\e[1;3C": forward-word # alt + right
8 |
9 | # Search through history using partial command
10 | "\e[A": history-search-backward
11 | "\e[B": history-search-forward
12 |
13 | # Fixing home and end keys for tmux
14 | "\e[1~": beginning-of-line
15 | "\e[4~": end-of-line
16 |
17 | # Cycle through completions
18 | TAB: menu-complete
19 | "\e[Z": menu-complete-backward
20 |
21 | set skip-completed-text on
22 | set completion-ignore-case on
23 |
24 | set input-meta on
25 | set output-meta on
26 | set convert-meta off
27 |
28 | set show-all-if-ambiguous on
29 | set visible-stats on
30 |
31 | set colored-stats on
32 | set colored-completion-prefix on
33 | set menu-complete-display-prefix on
34 |
--------------------------------------------------------------------------------
/bashrc/inputrc_macos:
--------------------------------------------------------------------------------
1 | ###################
2 | ##### inputrc #####
3 | ###################
4 |
5 | # Move through full words
6 | "\e\e[D": backward-word # alt + left
7 | "\e\e[C": forward-word # alt + right
8 |
9 | # Search through history using partial command
10 | "\e[A": history-search-backward
11 | "\e[B": history-search-forward
12 |
13 | # Cycle through completions
14 | TAB: menu-complete
15 | "\e[Z": menu-complete-backward
16 |
17 | set skip-completed-text on
18 | set completion-ignore-case on
19 |
20 | set input-meta on
21 | set output-meta on
22 | set convert-meta off
23 |
24 | set show-all-if-ambiguous on
25 | set visible-stats on
26 |
27 | set colored-stats on
28 | set colored-completion-prefix on
29 | set menu-complete-display-prefix on
30 |
--------------------------------------------------------------------------------
/bashrc/modules/aliases:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ###################
4 | ##### Aliases #####
5 | ###################
6 | # vim: syntax=bash
7 |
8 | alias cb="cd - > /dev/null 2>&1"
9 |
10 | alias gp="git pull"
11 | alias gpp="git push"
12 | alias grm="git rm"
13 | alias gcl="git clone"
14 | alias gstat="git status --branch"
15 | alias gdiff="git diff --color=always"
16 |
17 | alias grep="grep --color=always"
18 | alias yt2mp3="youtube-dl --extract-audio --audio-format=mp3 --audio-quality=0"
19 | alias l="ls"
20 |
21 | case "${distro:-}" in
22 | "MacOS"|"FreeBSD")
23 | alias ls="ls -G"
24 | alias ll="ls -G -l"
25 | alias la="ls -G -a"
26 | alias lal="ls -G -a -l"
27 | ;;
28 |
29 | *)
30 | alias ls="ls --color --classify"
31 | alias ll="ls --color --classify -l"
32 | alias la="ls --color --classify -a"
33 | alias lal="ls --color --classify -a -l"
34 | ;;
35 | esac
36 |
37 |
38 | [[ "${OSTYPE:-$(uname -s)}" =~ (L|l)inux ]] && \
39 | alias open="xdg-open"
40 |
41 | case "${distro:-}" in
42 | "Arch"*)
43 | if type -p yay > /dev/null; then
44 | alias update="yay"
45 | else
46 | alias update="sudo pacman -Syu"
47 | fi
48 | ;;
49 |
50 | "Fedora"*|"CentOS"*)
51 | if type -p dnf > /dev/null; then
52 | alias update="sudo dnf update"
53 | elif type -p yum > /dev/null; then
54 | alias update="sudo yum update"
55 | else
56 | printf "%sError%s: Cannot find dnf or yum, 'update' alias not set\\n" "${fb[1]:-}" "${reset:-}" >&2
57 | fi
58 | ;;
59 |
60 | "Gentoo")
61 | alias update='
62 | printf "%s\\n" "Do it yourself"
63 | printf "%s\\n" "=============="
64 | printf "%s\\n" "# emerge --sync"
65 | printf "%s\\n" "# emerge-webrsync"
66 | printf "%s\\n" "# emerge --update --changed-use --deep --ask --with-bdeps=y @world"
67 | printf "%s\\n" "# emerge --ask --verbose --depclean"'
68 | ;;
69 |
70 | "Ubuntu"*|"Debian"*|"Raspbian"*|"LinuxMint"*) alias update="sudo apt update && sudo apt upgrade" ;;
71 | "MacOS") alias update="brew update && brew upgrade && brew upgrade --casks" ;;
72 | "VoidLinux") alias update="sudo xbps-install -Su" ;;
73 | "FreeBSD") alias update="sudo pkg update && sudo pkg upgrade" ;;
74 | "Windows") alias update="choco upgrade all" ;;
75 | "") printf "%sError%s: Cannot detect distro, 'update' alias not set\\n" "${fb[1]:-}" "${reset:-}" >&2 ;;
76 | *) printf "%sError%s: Unknown distro, 'update' alias not set\\n" "${fb[1]:-}" "${reset:-}" >&2 ;;
77 | esac
78 |
--------------------------------------------------------------------------------
/bashrc/modules/colours:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##################
4 | ##### colours #####
5 | ##################
6 | # shellcheck disable=SC2034
7 | # vim: syntax=bash
8 |
9 | bold=$'\e[1m'
10 | reset=$'\e[0m'
11 |
12 | for i in {0..7}; do
13 | printf -v "f[$i]" "%s" $'\e[3'"$i"'m' && : "${reset}"
14 | printf -v "b[$i]" "%s" $'\e[4'"$i"'m' && : "${reset}"
15 | printf -v "fb[$i]" "%s" $'\e[1m\e[3'"$i"'m' && : "${reset}"
16 | printf -v "bb[$i]" "%s" $'\e[1m\e[4'"$i"'m' && : "${reset}"
17 | done
18 |
--------------------------------------------------------------------------------
/bashrc/modules/command_not_found:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | #############################
4 | ##### command not found #####
5 | #############################
6 | # vim: syntax=bash
7 |
8 | command_not_found_handle()
9 | {
10 | local package_manager
11 | local -a pkgs
12 | local pkg
13 | local cmd
14 |
15 | cmd="$1"
16 |
17 | printf "bash: %s: command not found\\n" "${cmd}" 1>&2
18 |
19 | case "${distro:-}" in
20 | "Ubuntu"*|"Debian"*|"Raspbian"*)
21 | package_manager="sudo apt install"
22 | type -p apt-file > /dev/null 2>&1 && \
23 | mapfile -t pkgs < <(apt-file --package-only search -- "bin/${cmd}")
24 | ;;
25 |
26 | "Arch"*)
27 | package_manager="sudo pacman -S"
28 | if type -p pkgfile > /dev/null 2>&1; then
29 | mapfile -t pkgs < <(pkgfile --binaries -- "${cmd}")
30 | else
31 | while IFS="" read -r line; do
32 | [[ ! "${line}" =~ ^' ' ]] && \
33 | pkgs+=("${line%% *}")
34 | done < <(pacman -Fs -- "${cmd}")
35 | fi
36 | ;;
37 | esac
38 |
39 | [[ "${pkgs[*]}" ]] && {
40 | printf "\\n%s\\n" "${cmd} can be installed by running:"
41 | for pkg in "${pkgs[@]}"; do
42 | printf " %s\\n" "${package_manager} ${pkg}"
43 | done
44 | printf "\\n"
45 | }
46 |
47 | return 127
48 | }
49 |
--------------------------------------------------------------------------------
/bashrc/modules/env_var:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | #########################
4 | ##### Env Variables #####
5 | #########################
6 | # shellcheck disable=2034,2163
7 | # vim: syntax=bash
8 |
9 | # Helper function
10 | append_path() { [[ -d "${1}" ]] && PATH="${PATH}:${1}"; }
11 | prepend_path() { [[ -d "${1}" ]] && PATH="${1}:${PATH}"; }
12 | is_installed() { type -p "${1}" > /dev/null 2>&1; }
13 | export_if_set() { [[ "${!1}" ]] && export "${1}"; }
14 |
15 | # Custom scripts
16 | mod_dir="${module_dir:?}"
17 | script_dir="${mod_dir/'bashrc/modules'/'scripts'}"
18 | append_path "${script_dir}/info"
19 | append_path "${script_dir}/utils"
20 |
21 | if [[ "${distro:-}" == "MacOS" ]]; then
22 | # Python binaries
23 | shopt -s nullglob
24 | for dir in "${HOME}/Library/Python/"*"/bin"; do
25 | append_path "${dir}"
26 | done
27 | shopt -u nullglob
28 |
29 | # Qt binaries
30 | prepend_path "/usr/local/opt/qt/bin"
31 | else
32 | # Local binaries
33 | append_path "${HOME}/.local/bin"
34 | fi
35 |
36 | is_installed "go" && {
37 | # Go binaries
38 | append_path "${HOME}/.go/bin"
39 |
40 | # Go environment
41 | GOPATH="${HOME}/.go"
42 | }
43 |
44 |
45 | is_installed "npm" && {
46 | # Npm binaries
47 | append_path "${HOME}/.npm/bin"
48 | }
49 |
50 | is_installed "cargo" && {
51 | # Cargo binaries
52 | append_path "${HOME}/.cargo/bin"
53 | }
54 |
55 | HISTTIMEFORMAT="%m/%d - %H:%M:%S: "
56 | HISTCONTROL="ignoreboth"
57 | HISTSIZE="-1"
58 | HISTFILESIZE="-1"
59 | EDITOR="vim"
60 | PS4='+${BASH_SOURCE:+${BASH_SOURCE}:}${LINENO:+${LINENO}:}${FUNCNAME:+${FUNCNAME}:} '
61 | GPG_TTY="$(tty)"
62 |
63 | [[ ! "${MAKEFLAGS}" ]] && {
64 | case "${OSTYPE:-$(uname -s)}" in
65 | "Darwin"|"darwin"*)
66 | cores="$(sysctl -n hw.logicalcpu_max)"
67 | ;;
68 |
69 | "Linux"|"linux"*|"MSYS"*|"msys")
70 | [[ -f "/proc/cpuinfo" ]] && {
71 | while read -r i; do
72 | [[ "$i" =~ ^processor ]] && \
73 | ((cores++))
74 | done < /proc/cpuinfo
75 | }
76 | ;;
77 |
78 | "FreeBSD"|"freebsd"*)
79 | cores="$(sysctl -n hw.ncpu)"
80 | ;;
81 | esac
82 | MAKEFLAGS="-j${cores:-1}"
83 | }
84 |
85 | [[ "${distro}" == "MacOS" ]] && is_installed "Xquartz" && {
86 | shopt -s nullglob
87 | while [[ ! "${DISPLAY}" ]] && read -r line; do
88 | [[ -e "${line}" ]] && DISPLAY="${line}"
89 | done < <(printf "%s\\n" /private/tmp/com.apple.launchd.**/*xquartz*)
90 | shopt -u nullglob
91 | }
92 |
93 | _GIT_LOG_FORMAT=(
94 | "┌[%C(bold blue)%H%C(reset)]%C(auto)%d%C(reset)%n"
95 | "└──[%C(bold cyan)%aD%C(reset)]: %C(bold green)%ar%C(reset)%n%n"
96 | "%w(0,4,4)Author: %an %C(dim white)<%ae>%C(reset)%n"
97 | "%w(0,4,4)Subject: %s%n"
98 | "%w(0,4,4)%+b%n"
99 | )
100 |
101 | IFS="" GIT_LOG_FORMAT="${_GIT_LOG_FORMAT[*]}"
102 |
103 | #####################
104 | ##### Man Pages #####
105 | #####################
106 |
107 | LESS_TERMCAP_mb="${fb[1]:-}" # enter blinking mode - red
108 | LESS_TERMCAP_md="${fb[5]:-}" # enter double-bright mode - bold, magenta
109 | LESS_TERMCAP_me="${reset:-}" # turn off all appearance modes (mb, md, so, us)
110 | LESS_TERMCAP_se="${reset:-}" # leave standout mode
111 | LESS_TERMCAP_so="${fb[3]:-}" # enter standout mode - yellow
112 | LESS_TERMCAP_ue="${reset:-}" # leave underline mode
113 | LESS_TERMCAP_us="${fb[6]:-}" # enter underline mode - cyan
114 | : "${reset}" # reset colours for debugging
115 |
116 | ###################
117 | ##### Exports #####
118 | ###################
119 |
120 | export_if_set "PATH"
121 | export_if_set "HISTCONTROL"
122 | export_if_set "HISTTIMEFORMAT"
123 | export_if_set "HISTSIZE"
124 | export_if_set "HISTFILESIZE"
125 | export_if_set "EDITOR"
126 | export_if_set "PS4"
127 | export_if_set "GPG_TTY"
128 |
129 | export_if_set "GOPATH"
130 | export_if_set "MAKEFLAGS"
131 |
132 | [[ "${distro}" == "MacOS" ]] && \
133 | export_if_set "DISPLAY"
134 |
135 | export_if_set "GIT_LOG_FORMAT"
136 |
137 | export_if_set "LESS_TERMCAP_mb"
138 | export_if_set "LESS_TERMCAP_md"
139 | export_if_set "LESS_TERMCAP_me"
140 | export_if_set "LESS_TERMCAP_se"
141 | export_if_set "LESS_TERMCAP_so"
142 | export_if_set "LESS_TERMCAP_ue"
143 | export_if_set "LESS_TERMCAP_us"
144 |
145 | unset exist_and_is_dir
146 | unset append_path
147 | unset prepend_path
148 | unset is_installed
149 | unset export_if_set
150 |
--------------------------------------------------------------------------------
/bashrc/modules/functions:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | #####################
4 | ##### Functions #####
5 | #####################
6 | # vim: syntax=bash
7 |
8 | gcll()
9 | {
10 | local -a args
11 | local -a repo_list
12 | local repo
13 |
14 | while (($# > 0)); do
15 | case "$1" in
16 | "http"*) repo_list+=("$1") ;;
17 | *) args+=("$1") ;;
18 | esac
19 | shift
20 | done
21 |
22 | for repo in "${repo_list[@]}"; do
23 | git clone "${repo}" "${args[@]}"
24 | done
25 | }
26 |
27 | glog()
28 | {
29 | [[ ! ${GIT_LOG_FORMAT} ]] && {
30 | _GIT_LOG_FORMAT=(
31 | "┌[%C(bold blue)%H%C(reset)]%C(auto)%d%C(reset)%n"
32 | "└──[%C(bold cyan)%aD%C(reset)]: %C(bold green)%ar%C(reset)%n%n"
33 | "%w(0,4,4)Author: %an %C(dim white)<%ae>%C(reset)%n"
34 | "%w(0,4,4)Subject: %s%n"
35 | "%w(0,4,4)%+b%n"
36 | )
37 |
38 | IFS="" GIT_LOG_FORMAT="${_GIT_LOG_FORMAT[*]}"
39 | export GIT_LOG_FORMAT
40 | }
41 |
42 | git log --color=always --graph --format=format:"${GIT_LOG_FORMAT}" "$@"
43 | }
44 |
45 | gppo()
46 | {
47 | git push -u origin "$(git rev-parse --abbrev-ref HEAD)"
48 | }
49 |
50 | man()
51 | {
52 | MANWIDTH="$((${COLUMNS:-100} > 100 ? 100 : COLUMNS))" command man "$@"
53 | }
54 |
55 | catm()
56 | {
57 | (("$#" == 0)) && return
58 | [[ ! "${COLUMNS}" ]] && \
59 | shopt -s checkwinsize; (:;:)
60 |
61 | local line
62 | eval printf -v line "%0.s=" "{1..${COLUMNS:-$(tput cols)}}"
63 |
64 | printf "%s\\n" "${line}"
65 | printf "%s\\n" "$1"
66 | printf "%s\\n" "${line}"
67 | cat "$1"
68 | printf "%s\\n" "${line}"
69 |
70 | for i in "${@:1}"; do
71 | printf "\\n%s\\n" "${line}"
72 | printf "%s\\n" "$i"
73 | printf "%s\\n" "${line}"
74 | cat "$i"
75 | printf "\\n%s\\n" "${line}"
76 | done
77 | }
78 |
79 | mpv-loop()
80 | {
81 | (($# > 2)) && \
82 | if (($# > 3)); then
83 | mpv "$1" --start "$2" \
84 | --ab-loop-a "$2" \
85 | --ab-loop-b "$3" \
86 | --audio-pitch-correction=no \
87 | --af-add=scaletempo=speed=both \
88 | --speed="$4" \
89 | "${@:4}"
90 | else
91 | mpv "$1" --start "$2" --ab-loop-a "$2" --ab-loop-b "$3" "${@:3}"
92 | fi
93 | }
94 |
95 | mpv-speed()
96 | {
97 | (($# > 1)) && \
98 | mpv "$1" --audio-pitch-correction=no \
99 | --af-add=scaletempo=speed=both \
100 | --speed="$2" \
101 | "${@:2}"
102 | }
103 |
104 | pdfmerge()
105 | {
106 | gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE="$1" -dBATCH "${@:2}"
107 | }
108 |
109 | mp42gif()
110 | {
111 | palette="$(mktemp).png"
112 | infile="$1"
113 | outfile="$2"
114 | height="${3:-$(ffprobe \
115 | -i "${infile}" \
116 | -v error \
117 | -select_streams v \
118 | -show_entries stream=height \
119 | -of csv=p=0:s=x)}"
120 | common_filters="fps=24,scale=-1:${height}"
121 | ffmpeg \
122 | -i "${infile}" \
123 | -vf "${common_filters}:flags=lanczos,palettegen" \
124 | -y "${palette}"
125 | ffmpeg \
126 | -i "${infile}" \
127 | -i "${palette}" \
128 | -lavfi "${common_filters}:flags=lanczos [x]; [x][1:v] paletteuse" \
129 | -y "${outfile}"
130 | [[ -f "${palette}" ]] && \
131 | rm "${palette}"
132 | }
133 |
--------------------------------------------------------------------------------
/bashrc/modules/prompt:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##################
4 | ##### Prompt #####
5 | ##################
6 | # vim: syntax=bash
7 |
8 | prompter()
9 | {
10 | local exit="$?"
11 |
12 | __get_git_branch_status()
13 | {
14 | [[ "$1" == *"$2 "[[:digit:]]* ]] && {
15 | status="${1##*"$2"}"
16 | status="${status%%,*}"
17 | status="${status/]}"
18 | status="${status//[[:space:]]}"
19 | printf "%s" "${status}"
20 | }
21 | }
22 |
23 | __get_git_branch()
24 | {
25 | case "$1" in
26 | *"No commits"*|*"Initial commit"*)
27 | branch="master"
28 | ;;
29 |
30 | *"no branch"*)
31 | branch="$(git rev-parse --short HEAD)"
32 | ;;
33 |
34 | *)
35 | branch="${1%%\...*}"
36 | branch="${branch//#}"
37 | branch="${branch//[[:space:]]}"
38 | ;;
39 | esac
40 | printf "%s" "${branch}"
41 | }
42 |
43 | _git_prompt()
44 | {
45 | # Skip if in .git directory
46 | local cwd
47 | local -a parts
48 |
49 | cwd="\\w"
50 | cwd="${cwd@P}"
51 | cwd="${cwd#/}"
52 |
53 | IFS='/' read -ra parts <<< "${cwd:-/}"
54 | [[ "${parts[-1]}" == ".git" ]] && \
55 | return
56 |
57 | local _git_branch
58 | local _git_prompt
59 | local num_staged
60 | local num_changed
61 | local num_conflicts
62 | local num_untracked
63 | local git_prompt
64 |
65 | # Git status symbols and algorithm referenced from
66 | # - https://github.com/magicmonty/bash-git-prompt/blob/master/gitstatus.sh
67 | # - https://git-scm.com/docs/git-status
68 |
69 | { [[ -d ".git" ]] || git rev-parse --git-dir > /dev/null 2>&1; } && {
70 | while IFS=$'\n' read -r i; do
71 | status="${i:0:2}"
72 | while [[ -n "${status}" ]]; do
73 | case "${status}" in
74 | "##")
75 | _git_branch="$(__get_git_branch "${i}")"
76 | _git_behind="$(__get_git_branch_status "${i}" "behind")"
77 | _git_ahead="$(__get_git_branch_status "${i}" "ahead")"
78 | break
79 | ;;
80 |
81 | "??") ((num_untracked++)); break ;;
82 | "U"?|?"U"|\
83 | "DD"|"AA") ((num_conflicts++)); break ;;
84 | ?"M"|?"D") ((num_changed++)) ;;
85 | ?" ") ;;
86 | "U") ((num_conflicts++)) ;;
87 | " ") ;;
88 | *) ((num_staged++)) ;;
89 | esac
90 | status="${status:0:${#status} - 1}"
91 | done
92 | done < <(git status --porcelain --branch)
93 |
94 | _git_branch="${_git_branch:+-[${c2}${_git_branch}${reset}}"
95 | _git_prompt=(
96 | "${_git_behind:+${fb[7]}↓${_git_behind}}"
97 | "${_git_ahead:+${fb[7]}↑${_git_ahead}}"
98 | "${num_conflicts:+${f[1]}✖${num_conflicts}}"
99 | "${num_changed:+${f[4]}✚${num_changed}}"
100 | "${num_staged:+${f[6]}●${num_staged}}"
101 | "${num_untracked:+${reset}${bold}…${num_untracked}}"
102 | )
103 |
104 | IFS="" git_prompt="${_git_prompt[*]}"
105 |
106 | ((BASH_VERSINFO[0] < 5)) && \
107 | git_prompt="${git_prompt//$'\n'}"
108 |
109 | IFS="" \
110 | git_prompt="${_git_branch}${git_prompt:+|${git_prompt}}${reset}]"
111 | }
112 |
113 | printf "%s" "${git_prompt}"
114 | }
115 |
116 | _dir_prompt()
117 | {
118 | local _PWD
119 | local cwd
120 | local -a parts
121 |
122 | cwd="\\w"
123 | cwd="${cwd@P}"
124 | cwd="${cwd#/}"
125 |
126 | IFS='/' read -ra parts <<< "${cwd:-/}"
127 |
128 | for part in "${parts[@]:0:${#parts[@]}-1}"; do
129 | unset in_PWD
130 | unset in_part
131 | IFS=" " read -ra in_part <<< "${part}"
132 | for i in "${in_part[@]}"; do
133 | [[ "$i" == "."* ]] && in_PWD="${in_PWD}${i:0:2}" || in_PWD="${in_PWD}${i:0:1}"
134 | done
135 | _PWD="${_PWD}/${in_PWD}"
136 | done
137 |
138 | _PWD="${_PWD}/${parts[-1]}"
139 |
140 | [[ "${_PWD}" =~ ^"/~" ]] && \
141 | _PWD="${_PWD:1}"
142 |
143 | ((${#_PWD} > 24)) && \
144 | _PWD="${parts[-1]}"
145 |
146 | printf "%s" "${_PWD:-/}"
147 | }
148 |
149 | local dir
150 | local git
151 | local c1
152 | local c2
153 | local head
154 | local -a prompt_line
155 |
156 | unset prompt_line
157 | unset PS1
158 |
159 | if ((EUID == 0)); then
160 | c1="${fb[1]}"
161 | c2="${fb[1]}"
162 | head="#"
163 | else
164 | c1="${fb[2]}"
165 | c2="${fb[4]}"
166 | head="$"
167 | fi
168 |
169 | ((exit != 0)) && \
170 | head="[\[${fb[1]}\]${exit}\[${reset}\]]${head}"
171 |
172 | [[ ! "${userhost}" ]] && {
173 | user="${USER:-\\u}"
174 | host="${HOSTNAME:-\\w}"
175 | host="${host%%.*}"
176 | userhost="${c1}${user}${reset}@${c1}${host}${reset}"
177 | export userhost
178 | }
179 |
180 | dir="${c2}$(_dir_prompt)${reset}"
181 | git="$(_git_prompt)"
182 |
183 | [[ "${VIRTUAL_ENV}" ]] && \
184 | other=" (${c2}venv${reset})"
185 |
186 | prompt_line+=("┌[${userhost}]: (${dir})${git}${other}")
187 | prompt_line+=("└${head} ")
188 | IFS=$'\n' PS1="${prompt_line[*]}"
189 | export PS1
190 |
191 | unset -f __get_git_branch_status
192 | unset -f __get_git_branch
193 | unset -f _git_prompt
194 | unset -f _dir_prompt
195 | }
196 |
197 | PROMPT_COMMAND="prompter; history -a"
198 |
--------------------------------------------------------------------------------
/bspwm/bspwmrc:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | border="2"
4 | gaps="2"
5 | focus_color="808080"
6 | normal_color="1d1f21"
7 |
8 | ! pgrep -x sxhkd > /dev/null 2>&1 && \
9 | sxhkd &
10 |
11 | [[ -f "${HOME}/.fehbg" ]] && \
12 | bash "${HOME}/.fehbg"
13 |
14 | type -p polybar > /dev/null 2>&1 && {
15 | pgrep -x polybar > /dev/null 2>&1 && \
16 | pkill -x polybar
17 |
18 | polybar bar
19 | } &
20 |
21 | type -p compton > /dev/null 2>&1 && \
22 | compton -b
23 |
24 | bspc monitor -d I II III IV V VI VII VIII IX X
25 |
26 | bspc config focused_border_color "#${focus_color}"
27 | bspc config normal_border_color "#${normal_color}"
28 |
29 | bspc config border_width "${border}"
30 | bspc config window_gap "${gaps}"
31 | bspc config top_padding 0
32 |
33 | bspc config split_ratio 0.5
34 | bspc config borderless_monocle true
35 | bspc config gapless_monocle true
36 | bspc config focus_follows_pointer false
37 |
38 | bspc config pointer_modifier mod1
39 | bspc config pointer_action1 move
40 | bspc config pointer_action2 move
41 |
--------------------------------------------------------------------------------
/bspwm/float:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | main()
4 | {
5 | node="$(bspc query --nodes -n)"
6 | bspc_out="$(bspc query --tree -n "${node}")"
7 | bspc_out="${bspc_out##*'state":"'}"
8 | bspc_out="${bspc_out%%\"*}"
9 |
10 | case "${bspc_out}" in
11 | "tiled") bspc node "${node}" -t floating ;;
12 | "floating") bspc node "${node}" -t tiled ;;
13 | esac
14 | }
15 |
16 | main "$@"
17 |
--------------------------------------------------------------------------------
/bspwm/resize:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | get_screen_res()
4 | {
5 | if type -p xrandr > /dev/null 2>&1; then
6 | regex='([0-9]+)x([0-9]+)\+[0-9]\+[0-9]'
7 | while [[ ! "${screen_width}" && ! "${screen_length}" ]] && read -r line; do
8 | [[ "${line}" == *"connected"* && "${line}" != *"disconnected"* ]] && {
9 | [[ "${line}" =~ ${regex} ]] && {
10 | screen_width="${BASH_REMATCH[1]}"
11 | screen_length="${BASH_REMATCH[2]}"
12 | }
13 | }
14 | done < <(xrandr --nograb --current)
15 |
16 | elif type -p xwininfo > /dev/null 2>&1; then
17 | read -r screen_width \
18 | screen_length \
19 | < <(xwininfo -root |\
20 | awk -F':' '/Width|Height/ { printf $2 }')
21 |
22 | elif type -p xdpyinfo > /dev/null 2>&1; then
23 | IFS="x" \
24 | read -r screen_width \
25 | screen_length \
26 | < <(xdpyinfo |\
27 | awk '/dimesions:/ { printf $2 }')
28 | fi
29 | }
30 |
31 | get_coords()
32 | {
33 | node="$(bspc query --nodes -n)"
34 | bspc_out="$(bspc query --tree -n "${node}")"
35 | bspc_out="${bspc_out##*'rectangle":{'}"
36 | bspc_out="${bspc_out%%\}*}"
37 | IFS=':,' read -r _ x _ y _ width _ height <<< "${bspc_out//\"}"
38 |
39 | ((a = x, b = a + width, c = y, d = y + height))
40 | }
41 |
42 | main()
43 | {
44 | dir="$1"
45 | size="${2:-20}"
46 |
47 | [[ ! "${dir}" ]] && \
48 | exit 1
49 |
50 | { ! pgrep -x bspwm || ! type -p bspc; } > /dev/null 2>&1 && \
51 | exit 1
52 |
53 | get_screen_res
54 | [[ ! "${screen_width}" || ! "${screen_length}" ]] && \
55 | exit 1
56 |
57 | get_coords
58 |
59 | case "${dir}:$((a < screen_width - b)):$((c < screen_length - d))" in
60 | "left:1"*|"right:0"*)
61 | args1=("left" "${size}" "0")
62 | args2=("right" "-${size}" "0")
63 | ;;
64 |
65 | "left:0"*|"right:1"*)
66 | args1=("right" "${size}" "0")
67 | args2=("left" "-${size}" "0")
68 | ;;
69 |
70 | "down:"*":1"|"up:"*":0")
71 | args1=("top" "0" "-${size}")
72 | args2=("bottom" "0" "${size}")
73 | ;;
74 |
75 | "down:"*":0"|"up:"*":1")
76 | args1=("bottom" "0" "-${size}")
77 | args2=("top" "0" "${size}")
78 | ;;
79 | esac
80 |
81 | bspc node -z "${args1[@]}"
82 | bspc node -z "${args2[@]}"
83 | }
84 |
85 | main "$@"
86 |
--------------------------------------------------------------------------------
/firefox/chrome/userChrome.css:
--------------------------------------------------------------------------------
1 | /*
2 | * From Lepton
3 | * https://github.com/black7375/Firefox-UI-Fix
4 | **/
5 |
6 | :root {
7 | /* Compatibility for accent color
8 | https://github.com/mozilla/gecko-dev/commit/4c5f20179e8d3b963dc588efb9dc2c7b49e7bb31
9 | */
10 | --uc-accent-color: AccentColor;
11 | --uc-accent-text-color: AccentColorText;
12 | }
13 |
14 | @supports -moz-bool-pref("userChrome.compatibility.accent_color") {
15 | :root {
16 | --uc-accent-color: -moz-accent-color;
17 | --uc-accent-text-color: AccentColorText;
18 | }
19 | }
20 |
21 | @media (-moz-os-version: windows-win10), (-moz-platform: windows-win10) {
22 | :root[sizemode="normal"][tabsintitlebar]:-moz-window-inactive #navigator-toolbox {
23 | border-top-color: #aaaaaa !important;
24 | }
25 |
26 | @media (-moz-windows-accent-color-in-titlebar) {
27 | /* Tab Bar */
28 | :root[tabsintitlebar]:not(:-moz-window-inactive, :-moz-lwtheme) .titlebar-color, :root[tabsintitlebar][lwt-default-theme-in-dark-mode]:not(:-moz-window-inactive) .titlebar-color {
29 | color: var(--uc-accent-text-color);
30 | background-color: var(--uc-accent-color);
31 | }
32 |
33 | :root[tabsintitlebar]:not(:-moz-window-inactive, :-moz-lwtheme) .toolbar-items, :root[tabsintitlebar][lwt-default-theme-in-dark-mode]:not(:-moz-window-inactive) .toolbar-items {
34 | --toolbarbutton-icon-fill: currentColor;
35 | --toolbarbutton-hover-background: color-mix(in srgb, var(--uc-accent-text-color) 10%, transparent);
36 | --toolbarbutton-active-background: color-mix(in srgb, var(var(--uc-accent-text-color)) 15%, transparent);
37 | }
38 |
39 | :root[tabsintitlebar]:-moz-window-inactive .titlebar-color, :root[tabsintitlebar][lwt-default-theme-in-dark-mode]:-moz-window-inactive .titlebar-color {
40 | color: #000;
41 | background-color: #c9c9c9;
42 | }
43 |
44 | :root[tabsintitlebar]:not(:-moz-window-inactive, :-moz-lwtheme) .toolbar-items, :root[tabsintitlebar][lwt-default-theme-in-dark-mode]:not(:-moz-window-inactive) .toolbar-items {
45 | --toolbarbutton-icon-fill: currentColor;
46 | --toolbarbutton-hover-background: color-mix(in srgb, var(--uc-accent-text-color) 10%, transparent);
47 | --toolbarbutton-active-background: color-mix(in srgb, var(var(--uc-accent-text-color)) 15%, transparent);
48 | }
49 | }
50 | }
--------------------------------------------------------------------------------
/firefox/chrome/userContent.css:
--------------------------------------------------------------------------------
1 | @-moz-document url(about:newtab) {
2 | main {
3 | max-width: 786px !important;
4 | }
5 | .hide-for-narrow {
6 | display : none !important;
7 | }
8 | }
9 |
10 | @-moz-document domain(twitch.tv) {
11 | * {
12 | font-family: roboto, "Helvetica Neue", Helvetica, Arial, sans serif !important;
13 | }
14 | }
15 |
16 | html > body > img:only-child {
17 | image-rendering: -moz-crisp-edges;
18 | image-rendering: crisp-edges;
19 | }
20 |
--------------------------------------------------------------------------------
/firefox/user.js:
--------------------------------------------------------------------------------
1 | // userchrome.css usercontent.css activate
2 | user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true);
3 |
4 | // Fill SVG Color
5 | user_pref("svg.context-properties.content.enabled", true);
6 |
7 | // CSS Blur Filter - 88 Above
8 | user_pref("layout.css.backdrop-filter.enabled", true);
9 |
10 | // Restore Compact Mode - 89 Above
11 | user_pref("browser.compactmode.show", true);
12 |
13 | user_pref("browser.newtabpage.activity-stream.topSitesCount", 30);
14 | user_pref("browser.newtabpage.pinned", "[{\"url\":\"https://mail.google.com\",\"label\":\"Mail\"},{\"url\":\"https://drive.google.com\",\"label\":\"Google Drive\"},{\"url\":\"https://www.ozbargain.com.au\",\"label\":\"OzBargain\"},{\"url\":\"https://github.com\",\"label\":\"Github\"},{\"url\":\"https://www.facebook.com\",\"label\":\"Facebook\"},{\"url\":\"https://www.messenger.com\",\"label\":\"Messenger\"},{\"url\":\"https://www.twitter.com\",\"label\":\"Twitter\"},{\"url\":\"https://deviantart.com\",\"label\":\"Deviantart\"},{\"url\":\"https://tumblr.com\",\"label\":\"Tumblr\"},{\"url\":\"http://www.pixiv.net/\",\"label\":\"Pixiv\"},{\"url\":\"https://www.youtube.com/feed/subscriptions\",\"label\":\"Youtube\"},{\"url\":\"https://www.netflix.com/\",\"label\":\"Netflix\"},{\"url\":\"https://soundcloud.com/\",\"label\":\"SoundCloud\"},{\"url\":\"https://app.plex.tv/web/app#\",\"label\":\"Plex\"},{\"url\":\"https://whosampled.com\",\"label\":\"Whosampled\"},{\"url\":\"http://192.168.1.1\",\"label\":\"Router\"},{\"url\":\"http://192.168.1.240\",\"label\":\"FreeNAS\"},{\"url\":\"http://192.168.1.240:9091\",\"label\":\"Transmission\"},{\"url\":\"http://192.168.1.240/aria2\",\"label\":\"Aria2\"},{\"url\":\"http://192.168.1.105/admin\",\"label\":\"Pihole\"},{\"url\":\"https://old.reddit.com/r/linux\",\"label\":\"r/linux\"},{\"url\":\"https://old.reddit.com/r/unixporn\",\"label\":\"r/unixporn\"},{\"url\":\"https://old.reddit.com/r/pcmasterrace\",\"label\":\"r/pcmasterrace\"},{\"url\":\"https://old.reddit.com/r/games\",\"label\":\"r/games\"},{\"url\":\"https://boards.4chan.org/g/catalog\",\"label\":\"/g/\"},{\"url\":\"https://boards.4chan.org/co/catalog\",\"label\":\"/co/\"},{\"url\":\"https://oasis.curtin.edu.au/\",\"label\":\"Oasis\"},{\"url\":\"https://estudent.curtin.edu.au/eStudent\",\"label\":\"eStudent\"},{\"url\":\"https://lms.curtin.edu.au/\",\"label\":\"Blackboard\"},{\"url\":\"https://oasis.curtin.edu.au/LiveEdu/Email\",\"label\":\"School Email\"}]");
15 |
--------------------------------------------------------------------------------
/fontconfig/conf.d/00-blacklist_nimbus.conf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Nimbus Sans
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | Nimbus Roman
19 |
20 |
21 |
22 |
23 |
24 |
25 |
28 |
--------------------------------------------------------------------------------
/fontconfig/fonts.conf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
--------------------------------------------------------------------------------
/freebsd/ThinkPad-X220/loader.conf:
--------------------------------------------------------------------------------
1 | autoboot_delay="2"
2 |
3 | legal.realtek.license_ack="1"
4 | if_rtwn_pci_load="YES"
5 |
--------------------------------------------------------------------------------
/freebsd/ThinkPad-X220/rc.conf:
--------------------------------------------------------------------------------
1 | clear_tmp_enable="YES"
2 | hostname="ThinkPad-X220"
3 | sshd_enable="YES"
4 | powerd_enable="YES"
5 | # Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
6 | dumpdev="AUTO"
7 |
8 | wlans_rtwn0="wlan0"
9 | ifconfig_wlan0="WPA SYNCDHCP"
10 |
11 | kld_list="${kld_list} drm2"
12 | kld_list="${kld_list} i915kms"
13 | kld_list="${kld_list} coretemp"
14 |
15 | moused_enable="YES"
16 | moused_flags="-VH"
17 |
--------------------------------------------------------------------------------
/freebsd/ThinkPad-X220/xorg.conf.d/card.conf:
--------------------------------------------------------------------------------
1 | # /usr/local/etc/X11/xorg.conf.d/card.conf
2 |
3 | Section "Device"
4 | Identifier "Card0"
5 | Option "DPMS"
6 | Driver "intel"
7 | EndSection
8 |
--------------------------------------------------------------------------------
/freebsd/ThinkPad-X220/xorg.conf.d/flags.conf:
--------------------------------------------------------------------------------
1 | # /usr/local/etc/X11/xorg.conf.d/flags.conf
2 |
3 | Section "ServerFlags"
4 | Option "DontZap" "off"
5 | EndSection
6 |
--------------------------------------------------------------------------------
/freebsd/ThinkPad-X220/xorg.conf.d/keyboard.conf:
--------------------------------------------------------------------------------
1 | # /usr/local/etc/X11/xorg.conf.d/keyboard.conf
2 |
3 | Section "InputDevice"
4 | Identifier "Keyboard0"
5 | Driver "kbd"
6 | Option "XkbLayout" "pl"
7 | Option "XkbOptions" "terminate:ctrl_alt_bksp,ctrl:nocaps"
8 | EndSection
9 |
--------------------------------------------------------------------------------
/gitconfig/gitconfig:
--------------------------------------------------------------------------------
1 | [url "ssh://git@gitlab.com/"]
2 | insteadOf = gitlab://
3 |
4 | [url "ssh://git@github.com/"]
5 | insteadOf = github://
6 |
7 | [url "https://www.gitlab.com/"]
8 | insteadOf = gitlab-https://
9 |
10 | [url "https://www.github.com/"]
11 | insteadOf = github-https://
12 |
13 | [color "branch"]
14 | current = white reverse
15 | local = white
16 | remote = blue
17 |
18 | [color "diff"]
19 | meta = yellow bold
20 | frag = cyan bold
21 |
22 | [color "status"]
23 | added = yellow
24 | changed = green
25 |
--------------------------------------------------------------------------------
/htop/htoprc:
--------------------------------------------------------------------------------
1 | # Beware! This file is rewritten by htop when settings are changed in the interface.
2 | # The parser is also very primitive, and not human-friendly.
3 | fields=0 48 17 18 38 39 40 2 46 47 49 1
4 | sort_key=46
5 | sort_direction=1
6 | tree_sort_key=0
7 | tree_sort_direction=1
8 | hide_kernel_threads=1
9 | hide_userland_threads=1
10 | shadow_other_users=0
11 | show_thread_names=0
12 | show_program_path=1
13 | highlight_base_name=0
14 | highlight_megabytes=1
15 | highlight_threads=1
16 | highlight_changes=1
17 | highlight_changes_delay_secs=2
18 | find_comm_in_cmdline=1
19 | strip_exe_from_cmdline=1
20 | show_merged_command=0
21 | tree_view=1
22 | tree_view_always_by_pid=0
23 | header_margin=1
24 | detailed_cpu_time=0
25 | cpu_count_from_one=1
26 | show_cpu_usage=1
27 | show_cpu_frequency=0
28 | show_cpu_temperature=0
29 | degree_fahrenheit=0
30 | update_process_names=0
31 | account_guest_in_cpu_meter=0
32 | color_scheme=0
33 | enable_mouse=0
34 | delay=15
35 | left_meters=AllCPUs Memory Swap
36 | left_meter_modes=1 1 1
37 | right_meters=Tasks LoadAverage Uptime
38 | right_meter_modes=2 2 2
39 |
--------------------------------------------------------------------------------
/looking-glass-client/looking-glass-client.ini:
--------------------------------------------------------------------------------
1 | [win]
2 | autoResize=yes
3 | keepAspect=yes
4 |
5 | [spice]
6 | enable=no
7 |
8 | [input]
9 | grabKeyboard=no
10 |
--------------------------------------------------------------------------------
/mpv/mpv.conf:
--------------------------------------------------------------------------------
1 | ## mpv.conf
2 | ## Adapted from Argon-
3 | ## https://github.com/Argon-/mpv-config/blob/master/mpv.conf
4 |
5 | ###################
6 | ##### General #####
7 | ###################
8 |
9 | msg-module # prepend module name to log messages
10 | msg-color # color log messages on terminal
11 | term-osd-bar # display a progress bar on the terminal
12 | use-filedir-conf # look for additional config files in the directory of the opened file
13 | keep-open # keep the player open when a file's end is reached
14 | autofit-larger=100%x95% # resize window in case it's larger than W%xH% of the screen
15 | cursor-autohide-fs-only # don't autohide the cursor in window mode, only fullscreen
16 | input-media-keys=no # enable/disable OSX media keys
17 | cursor-autohide=1000 # autohide the curser after 1s
18 | prefetch-playlist=yes
19 | force-seekable=yes
20 |
21 | screenshot-format=png
22 | screenshot-png-compression=8
23 | screenshot-template='~/Desktop/%F (%P) %n'
24 |
25 | hls-bitrate=max # use max quality for HLS streams
26 |
27 | [default]
28 |
29 | #################
30 | ##### Cache #####
31 | #################
32 |
33 | cache=yes
34 | demuxer-max-bytes=512MiB
35 | demuxer-max-back-bytes=256MiB
36 |
37 |
38 | #####################
39 | ##### OSD / OSC #####
40 | #####################
41 |
42 | osd-level=1 # enable osd and display --osd-status-msg on interaction
43 | osd-duration=2500 # hide the osd after x ms
44 | osd-status-msg='${time-pos} / ${duration}${?percent-pos: (${percent-pos}%)}${?frame-drop-count:${!frame-drop-count==0: Dropped: ${frame-drop-count}}}\n${?chapter:Chapter: ${chapter}}'
45 |
46 | osd-font='Roboto'
47 | osd-font-size=32
48 | osd-color='#CCFFFFFF' # ARGB format
49 | osd-border-color='#DD322640' # ARGB format
50 | #osd-shadow-offset=1 # pixel width for osd text and progress bar
51 | osd-bar-align-y=0 # progress bar y alignment (-1 top, 0 centered, 1 bottom)
52 | osd-border-size=1 # size for osd text and progress bar
53 | osd-bar-h=2 # height of osd bar as a fractional percentage of your screen height
54 | osd-bar-w=80 # width of " " "
55 |
56 |
57 | #####################
58 | ##### Subtitles #####
59 | #####################
60 |
61 | demuxer-mkv-subtitle-preroll # try to correctly show embedded subs when seeking
62 | demuxer-mkv-subtitle-preroll-secs=2
63 |
64 | sub-auto=fuzzy # external subs don't have to match the file name exactly to autoload
65 | sub-file-paths-append=ass # search for external subs in these relative subdirectories
66 | sub-file-paths-append=srt
67 | sub-file-paths-append=sub
68 | sub-file-paths-append=subs
69 | sub-file-paths-append=subtitles
70 |
71 | embeddedfonts=yes # use embedded fonts for SSA/ASS subs
72 | sub-fix-timing=no # do not try to fix gaps (which might make it worse in some cases)
73 | sub-ass-force-style=Kerning=yes # allows you to override style parameters of ASS scripts
74 | sub-use-margins
75 | sub-ass-force-margins
76 |
77 | # the following options only apply to subtitles without own styling (i.e. not ASS but e.g. SRT)
78 | sub-font="roboto"
79 | sub-font-size=36
80 | sub-color="#FFFFFFFF"
81 | sub-border-color="#FF262626"
82 | sub-border-size=3.2
83 | sub-shadow-offset=1
84 | sub-shadow-color="#33000000"
85 | sub-spacing=0.5
86 |
87 |
88 | #####################
89 | ##### Languages #####
90 | #####################
91 |
92 | slang=enm,en,eng,de,deu,ger # automatically select these subtitles (decreasing priority)
93 | alang=ja,jp,jpn,en,eng,de,deu,ger # automatically select these audio tracks (decreasing priority)
94 |
95 |
96 | #################
97 | ##### Audio #####
98 | #################
99 |
100 | audio-file-auto=fuzzy # external audio doesn't has to match the file name exactly to autoload
101 | audio-pitch-correction=yes # automatically insert scaletempo when playing with higher speed
102 | volume-max=200 # maximum volume in %, everything above 100 results in amplification
103 | volume=100 # default volume, 100 = unchanged
104 |
105 |
106 | #######################
107 | #### Video Output #####
108 | #######################
109 |
110 | # Active VOs (and some other options) are set conditionally
111 | # See here for more information: https://github.com/wm4/mpv-scripts/blob/master/auto-profiles.lua
112 | # on_battery(), is_laptop() and is_dektop() are my own additional functions imported from scripts/auto-profiles-functions.lua
113 |
114 | # Defaults for all profiles
115 | #vo=opengl
116 | #tscale=oversample # [sharp] oversample <-> linear (triangle) <-> catmull_rom <-> mitchell <-> #gaussian <-> bicubic [smooth]
117 | #opengl-early-flush=no
118 | #opengl-pbo=yes
119 | #sigmoid-slope=10
120 |
121 |
122 | ###########################################
123 | ##### Protocol Specific Configuration #####
124 | ###########################################
125 |
126 | [protocol.https]
127 | cache=yes
128 | user-agent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:57.0) Gecko/20100101 Firefox/58.0'
129 |
130 | [protocol.http]
131 | cache=yes
132 | user-agent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:57.0) Gecko/20100101 Firefox/58.0'
133 |
--------------------------------------------------------------------------------
/npm/npmrc:
--------------------------------------------------------------------------------
1 | prefix="${HOME}/.npm"
2 |
--------------------------------------------------------------------------------
/picom/picom.conf:
--------------------------------------------------------------------------------
1 | #################################
2 | # Shadows #
3 | #################################
4 |
5 |
6 | # Enabled client-side shadows on windows. Note desktop windows
7 | # (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
8 | # unless explicitly requested using the wintypes option.
9 | #
10 | # shadow = false
11 | shadow = true;
12 |
13 | # The blur radius for shadows, in pixels. (defaults to 12)
14 | # shadow-radius = 12
15 | shadow-radius = 72;
16 |
17 | # The opacity of shadows. (0.0 - 1.0, defaults to 0.75)
18 | shadow-opacity = 0.75;
19 |
20 | # The left offset for shadows, in pixels. (defaults to -15)
21 | # shadow-offset-x = -15
22 | shadow-offset-x = -72;
23 |
24 | # The top offset for shadows, in pixels. (defaults to -15)
25 | # shadow-offset-y = -15
26 | shadow-offset-y = -72;
27 |
28 | # Avoid drawing shadows on dock/panel windows. This option is deprecated,
29 | # you should use the *wintypes* option in your config file instead.
30 | #
31 | # no-dock-shadow = false
32 |
33 | # Don't draw shadows on drag-and-drop windows. This option is deprecated,
34 | # you should use the *wintypes* option in your config file instead.
35 | #
36 | # no-dnd-shadow = false
37 |
38 | # Red color value of shadow (0.0 - 1.0, defaults to 0).
39 | # shadow-red = 0
40 |
41 | # Green color value of shadow (0.0 - 1.0, defaults to 0).
42 | # shadow-green = 0
43 |
44 | # Blue color value of shadow (0.0 - 1.0, defaults to 0).
45 | # shadow-blue = 0
46 |
47 | # Do not paint shadows on shaped windows. Note shaped windows
48 | # here means windows setting its shape through X Shape extension.
49 | # Those using ARGB background is beyond our control.
50 | # Deprecated, use
51 | # shadow-exclude = 'bounding_shaped'
52 | # or
53 | # shadow-exclude = 'bounding_shaped && !rounded_corners'
54 | # instead.
55 | #
56 | # shadow-ignore-shaped = ''
57 |
58 | # Specify a list of conditions of windows that should have no shadow.
59 | #
60 | # examples:
61 | # shadow-exclude = "n:e:Notification";
62 | #
63 | # shadow-exclude = []
64 | shadow-exclude = [
65 | "name = 'Notification'",
66 | "class_g = 'Conky'",
67 | "class_g ?= 'Notify-osd'",
68 | "class_g = 'Cairo-clock'",
69 | "_GTK_FRAME_EXTENTS@:c"
70 | ];
71 |
72 | # Specify a X geometry that describes the region in which shadow should not
73 | # be painted in, such as a dock window region. Use
74 | # shadow-exclude-reg = "x10+0+0"
75 | # for example, if the 10 pixels on the bottom of the screen should not have shadows painted on.
76 | #
77 | # shadow-exclude-reg = ""
78 |
79 | # Crop shadow of a window fully on a particular Xinerama screen to the screen.
80 | # xinerama-shadow-crop = false
81 |
82 |
83 | #################################
84 | # Fading #
85 | #################################
86 |
87 |
88 | # Fade windows in/out when opening/closing and when opacity changes,
89 | # unless no-fading-openclose is used.
90 | # fading = false
91 | fading = false
92 |
93 | # Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028)
94 | # fade-in-step = 0.028
95 | fade-in-step = 0.03;
96 |
97 | # Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03)
98 | # fade-out-step = 0.03
99 | fade-out-step = 0.03;
100 |
101 | # The time between steps in fade step, in milliseconds. (> 0, defaults to 10)
102 | # fade-delta = 10
103 |
104 | # Specify a list of conditions of windows that should not be faded.
105 | # fade-exclude = []
106 |
107 | # Do not fade on window open/close.
108 | no-fading-openclose = false;
109 |
110 | # Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc.
111 | # no-fading-destroyed-argb = false
112 |
113 |
114 | #################################
115 | # Transparency / Opacity #
116 | #################################
117 |
118 |
119 | # Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0)
120 | # inactive-opacity = 1
121 | inactive-opacity = 1;
122 |
123 | # Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default)
124 | # frame-opacity = 1.0
125 | frame-opacity = 0.7;
126 |
127 | # Default opacity for dropdown menus and popup menus. (0.0 - 1.0, defaults to 1.0)
128 | # menu-opacity = 1.0
129 |
130 | # Let inactive opacity set by -i override the '_NET_WM_OPACITY' values of windows.
131 | # inactive-opacity-override = true
132 | inactive-opacity-override = false;
133 |
134 | # Default opacity for active windows. (0.0 - 1.0, defaults to 1.0)
135 | # active-opacity = 1.0
136 |
137 | # Dim inactive windows. (0.0 - 1.0, defaults to 0.0)
138 | # inactive-dim = 0.0
139 |
140 | # Specify a list of conditions of windows that should always be considered focused.
141 | # focus-exclude = []
142 | focus-exclude = [ "class_g = 'Cairo-clock'" ];
143 |
144 | # Use fixed inactive dim value, instead of adjusting according to window opacity.
145 | # inactive-dim-fixed = 1.0
146 |
147 | # Specify a list of opacity rules, in the format `PERCENT:PATTERN`,
148 | # like `50:name *= "Firefox"`. picom-trans is recommended over this.
149 | # Note we don't make any guarantee about possible conflicts with other
150 | # programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows.
151 | # example:
152 | # opacity-rule = [ "80:class_g = 'URxvt'" ];
153 | #
154 | # opacity-rule = []
155 |
156 |
157 | #################################
158 | # Background-Blurring #
159 | #################################
160 |
161 |
162 | # Parameters for background blurring, see the *BLUR* section for more information.
163 | # blur-method =
164 | # blur-size = 12
165 | #
166 | # blur-deviation = false
167 |
168 | # Blur background of semi-transparent / ARGB windows.
169 | # Bad in performance, with driver-dependent behavior.
170 | # The name of the switch may change without prior notifications.
171 | #
172 | # blur-background = false
173 |
174 | # Blur background of windows when the window frame is not opaque.
175 | # Implies:
176 | # blur-background
177 | # Bad in performance, with driver-dependent behavior. The name may change.
178 | #
179 | # blur-background-frame = false
180 |
181 |
182 | # Use fixed blur strength rather than adjusting according to window opacity.
183 | # blur-background-fixed = false
184 |
185 |
186 | # Specify the blur convolution kernel, with the following format:
187 | # example:
188 | # blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";
189 | #
190 | # blur-kern = ''
191 | blur-kern = "3x3box";
192 |
193 |
194 | # Exclude conditions for background blur.
195 | # blur-background-exclude = []
196 | blur-background-exclude = [
197 | "window_type = 'dock'",
198 | "window_type = 'desktop'",
199 | "_GTK_FRAME_EXTENTS@:c"
200 | ];
201 |
202 | #################################
203 | # General Settings #
204 | #################################
205 |
206 | # Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers.
207 | # daemon = false
208 |
209 | # Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`.
210 | # `xrender` is the default one.
211 | #
212 | # backend = 'glx'
213 | backend = "xrender";
214 |
215 | # Enable/disable VSync.
216 | # vsync = false
217 | vsync = true
218 |
219 | # Enable remote control via D-Bus. See the *D-BUS API* section below for more details.
220 | # dbus = false
221 |
222 | # Try to detect WM windows (a non-override-redirect window with no
223 | # child that has 'WM_STATE') and mark them as active.
224 | #
225 | # mark-wmwin-focused = false
226 | mark-wmwin-focused = true;
227 |
228 | # Mark override-redirect windows that doesn't have a child window with 'WM_STATE' focused.
229 | # mark-ovredir-focused = false
230 | mark-ovredir-focused = true;
231 |
232 | # Try to detect windows with rounded corners and don't consider them
233 | # shaped windows. The accuracy is not very high, unfortunately.
234 | #
235 | # detect-rounded-corners = false
236 | detect-rounded-corners = true;
237 |
238 | # Detect '_NET_WM_OPACITY' on client windows, useful for window managers
239 | # not passing '_NET_WM_OPACITY' of client windows to frame windows.
240 | #
241 | # detect-client-opacity = false
242 | detect-client-opacity = true;
243 |
244 | # Specify refresh rate of the screen. If not specified or 0, picom will
245 | # try detecting this with X RandR extension.
246 | #
247 | # refresh-rate = 60
248 | refresh-rate = 0
249 |
250 | # Limit picom to repaint at most once every 1 / 'refresh_rate' second to
251 | # boost performance. This should not be used with
252 | # vsync drm/opengl/opengl-oml
253 | # as they essentially does sw-opti's job already,
254 | # unless you wish to specify a lower refresh rate than the actual value.
255 | #
256 | # sw-opti =
257 |
258 | # Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window,
259 | # rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy,
260 | # provided that the WM supports it.
261 | #
262 | # use-ewmh-active-win = false
263 |
264 | # Unredirect all windows if a full-screen opaque window is detected,
265 | # to maximize performance for full-screen windows. Known to cause flickering
266 | # when redirecting/unredirecting windows.
267 | #
268 | # unredir-if-possible = false
269 |
270 | # Delay before unredirecting the window, in milliseconds. Defaults to 0.
271 | # unredir-if-possible-delay = 0
272 |
273 | # Conditions of windows that shouldn't be considered full-screen for unredirecting screen.
274 | # unredir-if-possible-exclude = []
275 |
276 | # Use 'WM_TRANSIENT_FOR' to group windows, and consider windows
277 | # in the same group focused at the same time.
278 | #
279 | # detect-transient = false
280 | detect-transient = true
281 |
282 | # Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same
283 | # group focused at the same time. 'WM_TRANSIENT_FOR' has higher priority if
284 | # detect-transient is enabled, too.
285 | #
286 | # detect-client-leader = false
287 | detect-client-leader = true
288 |
289 | # Resize damaged region by a specific number of pixels.
290 | # A positive value enlarges it while a negative one shrinks it.
291 | # If the value is positive, those additional pixels will not be actually painted
292 | # to screen, only used in blur calculation, and such. (Due to technical limitations,
293 | # with use-damage, those pixels will still be incorrectly painted to screen.)
294 | # Primarily used to fix the line corruption issues of blur,
295 | # in which case you should use the blur radius value here
296 | # (e.g. with a 3x3 kernel, you should use `--resize-damage 1`,
297 | # with a 5x5 one you use `--resize-damage 2`, and so on).
298 | # May or may not work with *--glx-no-stencil*. Shrinking doesn't function correctly.
299 | #
300 | # resize-damage = 1
301 |
302 | # Specify a list of conditions of windows that should be painted with inverted color.
303 | # Resource-hogging, and is not well tested.
304 | #
305 | # invert-color-include = []
306 |
307 | # GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer.
308 | # Might cause incorrect opacity when rendering transparent content (but never
309 | # practically happened) and may not work with blur-background.
310 | # My tests show a 15% performance boost. Recommended.
311 | #
312 | # glx-no-stencil = false
313 |
314 | # GLX backend: Avoid rebinding pixmap on window damage.
315 | # Probably could improve performance on rapid window content changes,
316 | # but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.).
317 | # Recommended if it works.
318 | #
319 | # glx-no-rebind-pixmap = false
320 |
321 | # Disable the use of damage information.
322 | # This cause the whole screen to be redrawn everytime, instead of the part of the screen
323 | # has actually changed. Potentially degrades the performance, but might fix some artifacts.
324 | # The opposing option is use-damage
325 | #
326 | # no-use-damage = false
327 | use-damage = true
328 |
329 | # Use X Sync fence to sync clients' draw calls, to make sure all draw
330 | # calls are finished before picom starts drawing. Needed on nvidia-drivers
331 | # with GLX backend for some users.
332 | #
333 | # xrender-sync-fence = false
334 |
335 | # GLX backend: Use specified GLSL fragment shader for rendering window contents.
336 | # See `compton-default-fshader-win.glsl` and `compton-fake-transparency-fshader-win.glsl`
337 | # in the source tree for examples.
338 | #
339 | # glx-fshader-win = ''
340 |
341 | # Force all windows to be painted with blending. Useful if you
342 | # have a glx-fshader-win that could turn opaque pixels transparent.
343 | #
344 | # force-win-blend = false
345 |
346 | # Do not use EWMH to detect fullscreen windows.
347 | # Reverts to checking if a window is fullscreen based only on its size and coordinates.
348 | #
349 | # no-ewmh-fullscreen = false
350 |
351 | # Dimming bright windows so their brightness doesn't exceed this set value.
352 | # Brightness of a window is estimated by averaging all pixels in the window,
353 | # so this could comes with a performance hit.
354 | # Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled. (default: 1.0)
355 | #
356 | # max-brightness = 1.0
357 |
358 | # Make transparent windows clip other windows like non-transparent windows do,
359 | # instead of blending on top of them.
360 | #
361 | # transparent-clipping = false
362 |
363 | # Set the log level. Possible values are:
364 | # "trace", "debug", "info", "warn", "error"
365 | # in increasing level of importance. Case doesn't matter.
366 | # If using the "TRACE" log level, it's better to log into a file
367 | # using *--log-file*, since it can generate a huge stream of logs.
368 | #
369 | # log-level = "debug"
370 | log-level = "warn";
371 |
372 | # Set the log file.
373 | # If *--log-file* is never specified, logs will be written to stderr.
374 | # Otherwise, logs will to written to the given file, though some of the early
375 | # logs might still be written to the stderr.
376 | # When setting this option from the config file, it is recommended to use an absolute path.
377 | #
378 | # log-file = '/path/to/your/log/file'
379 |
380 | # Show all X errors (for debugging)
381 | # show-all-xerrors = false
382 |
383 | # Write process ID to a file.
384 | # write-pid-path = '/path/to/your/log/file'
385 |
386 | # Window type settings
387 | #
388 | # 'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard:
389 | # "unknown", "desktop", "dock", "toolbar", "menu", "utility",
390 | # "splash", "dialog", "normal", "dropdown_menu", "popup_menu",
391 | # "tooltip", "notification", "combo", and "dnd".
392 | #
393 | # Following per window-type options are available: ::
394 | #
395 | # fade, shadow:::
396 | # Controls window-type-specific shadow and fade settings.
397 | #
398 | # opacity:::
399 | # Controls default opacity of the window type.
400 | #
401 | # focus:::
402 | # Controls whether the window of this type is to be always considered focused.
403 | # (By default, all window types except "normal" and "dialog" has this on.)
404 | #
405 | # full-shadow:::
406 | # Controls whether shadow is drawn under the parts of the window that you
407 | # normally won't be able to see. Useful when the window has parts of it
408 | # transparent, and you want shadows in those areas.
409 | #
410 | # redir-ignore:::
411 | # Controls whether this type of windows should cause screen to become
412 | # redirected again after been unredirected. If you have unredir-if-possible
413 | # set, and doesn't want certain window to cause unnecessary screen redirection,
414 | # you can set this to `true`.
415 | #
416 | wintypes:
417 | {
418 | tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; };
419 | dock = { shadow = false; }
420 | dnd = { shadow = false; }
421 | popup_menu = { opacity = 0.8; }
422 | dropdown_menu = { opacity = 0.8; }
423 | };
424 |
--------------------------------------------------------------------------------
/plasma/color-schemes/BreezeDarkOld.colors:
--------------------------------------------------------------------------------
1 | [ColorEffects:Disabled]
2 | Color=56,56,56
3 | ColorAmount=0
4 | ColorEffect=0
5 | ContrastAmount=0.65
6 | ContrastEffect=1
7 | IntensityAmount=0.1
8 | IntensityEffect=2
9 |
10 | [ColorEffects:Inactive]
11 | ChangeSelectionColor=true
12 | Color=112,111,110
13 | ColorAmount=0.025
14 | ColorEffect=2
15 | ContrastAmount=0.1
16 | ContrastEffect=2
17 | Enable=false
18 | IntensityAmount=0
19 | IntensityEffect=0
20 |
21 | [Colors:Button]
22 | BackgroundAlternate=77,77,77
23 | BackgroundNormal=49,54,59
24 | DecorationFocus=61,174,233
25 | DecorationHover=61,174,233
26 | ForegroundActive=61,174,233
27 | ForegroundInactive=189,195,199
28 | ForegroundLink=41,128,185
29 | ForegroundNegative=218,68,83
30 | ForegroundNeutral=246,116,0
31 | ForegroundNormal=239,240,241
32 | ForegroundPositive=39,174,96
33 | ForegroundVisited=127,140,141
34 |
35 | [Colors:Complementary]
36 | BackgroundAlternate=59,64,69
37 | BackgroundNormal=49,54,59
38 | DecorationFocus=30,146,255
39 | DecorationHover=61,174,230
40 | ForegroundActive=246,116,0
41 | ForegroundInactive=175,176,179
42 | ForegroundLink=61,174,230
43 | ForegroundNegative=237,21,21
44 | ForegroundNeutral=201,206,59
45 | ForegroundNormal=239,240,241
46 | ForegroundPositive=17,209,22
47 | ForegroundVisited=61,174,230
48 |
49 | [Colors:Selection]
50 | BackgroundAlternate=29,153,243
51 | BackgroundNormal=61,174,233
52 | DecorationFocus=61,174,233
53 | DecorationHover=61,174,233
54 | ForegroundActive=252,252,252
55 | ForegroundInactive=239,240,241
56 | ForegroundLink=253,188,75
57 | ForegroundNegative=218,68,83
58 | ForegroundNeutral=246,116,0
59 | ForegroundNormal=239,240,241
60 | ForegroundPositive=39,174,96
61 | ForegroundVisited=189,195,199
62 |
63 | [Colors:Tooltip]
64 | BackgroundAlternate=77,77,77
65 | BackgroundNormal=49,54,59
66 | DecorationFocus=61,174,233
67 | DecorationHover=61,174,233
68 | ForegroundActive=61,174,233
69 | ForegroundInactive=189,195,199
70 | ForegroundLink=41,128,185
71 | ForegroundNegative=218,68,83
72 | ForegroundNeutral=246,116,0
73 | ForegroundNormal=239,240,241
74 | ForegroundPositive=39,174,96
75 | ForegroundVisited=127,140,141
76 |
77 | [Colors:View]
78 | BackgroundAlternate=49,54,59
79 | BackgroundNormal=35,38,41
80 | DecorationFocus=61,174,233
81 | DecorationHover=61,174,233
82 | ForegroundActive=61,174,233
83 | ForegroundInactive=189,195,199
84 | ForegroundLink=41,128,185
85 | ForegroundNegative=218,68,83
86 | ForegroundNeutral=246,116,0
87 | ForegroundNormal=239,240,241
88 | ForegroundPositive=39,174,96
89 | ForegroundVisited=127,140,141
90 |
91 | [Colors:Window]
92 | BackgroundAlternate=77,77,77
93 | BackgroundNormal=49,54,59
94 | DecorationFocus=61,174,233
95 | DecorationHover=61,174,233
96 | ForegroundActive=61,174,233
97 | ForegroundInactive=189,195,199
98 | ForegroundLink=41,128,185
99 | ForegroundNegative=218,68,83
100 | ForegroundNeutral=246,116,0
101 | ForegroundNormal=239,240,241
102 | ForegroundPositive=39,174,96
103 | ForegroundVisited=127,140,141
104 |
105 | [General]
106 | ColorScheme=Breeze Dark
107 | Name=Breeze Dark Old
108 | shadeSortColumn=true
109 |
110 | [KDE]
111 | contrast=4
112 |
113 | [WM]
114 | activeBackground=49,54,59
115 | activeBlend=255,255,255
116 | activeForeground=239,240,241
117 | inactiveBackground=49,54,59
118 | inactiveBlend=75,71,67
119 | inactiveForeground=127,140,141
120 |
--------------------------------------------------------------------------------
/plasma/desktoptheme/breeze-dark-transparent/colors:
--------------------------------------------------------------------------------
1 | [ColorEffects:Disabled]
2 | Color=56,56,56
3 | ColorAmount=0
4 | ColorEffect=0
5 | ContrastAmount=0.65
6 | ContrastEffect=1
7 | IntensityAmount=0.1
8 | IntensityEffect=2
9 |
10 | [ColorEffects:Inactive]
11 | ChangeSelectionColor=true
12 | Color=112,111,110
13 | ColorAmount=0.025
14 | ColorEffect=2
15 | ContrastAmount=0.1
16 | ContrastEffect=2
17 | Enable=false
18 | IntensityAmount=0
19 | IntensityEffect=0
20 |
21 | [Colors:Button]
22 | BackgroundAlternate=30,87,116
23 | BackgroundNormal=49,54,59
24 | DecorationFocus=61,174,233
25 | DecorationHover=61,174,233
26 | ForegroundActive=61,174,233
27 | ForegroundInactive=161,169,177
28 | ForegroundLink=29,153,243
29 | ForegroundNegative=218,68,83
30 | ForegroundNeutral=246,116,0
31 | ForegroundNormal=252,252,252
32 | ForegroundPositive=39,174,96
33 | ForegroundVisited=155,89,182
34 |
35 | [Colors:Complementary]
36 | BackgroundAlternate=30,87,116
37 | BackgroundNormal=42,46,50
38 | DecorationFocus=61,174,233
39 | DecorationHover=61,174,233
40 | ForegroundActive=61,174,233
41 | ForegroundInactive=161,169,177
42 | ForegroundLink=29,153,243
43 | ForegroundNegative=218,68,83
44 | ForegroundNeutral=246,116,0
45 | ForegroundNormal=252,252,252
46 | ForegroundPositive=39,174,96
47 | ForegroundVisited=155,89,182
48 |
49 | [Colors:Header]
50 | BackgroundAlternate=42,46,50
51 | BackgroundNormal=49,54,59
52 | DecorationFocus=61,174,233
53 | DecorationHover=61,174,233
54 | ForegroundActive=61,174,233
55 | ForegroundInactive=161,169,177
56 | ForegroundLink=29,153,243
57 | ForegroundNegative=218,68,83
58 | ForegroundNeutral=246,116,0
59 | ForegroundNormal=252,252,252
60 | ForegroundPositive=39,174,96
61 | ForegroundVisited=155,89,182
62 |
63 | [Colors:Header][Inactive]
64 | BackgroundAlternate=49,54,59
65 | BackgroundNormal=42,46,50
66 | DecorationFocus=61,174,233
67 | DecorationHover=61,174,233
68 | ForegroundActive=61,174,233
69 | ForegroundInactive=161,169,177
70 | ForegroundLink=29,153,243
71 | ForegroundNegative=218,68,83
72 | ForegroundNeutral=246,116,0
73 | ForegroundNormal=252,252,252
74 | ForegroundPositive=39,174,96
75 | ForegroundVisited=155,89,182
76 |
77 | [Colors:Selection]
78 | BackgroundAlternate=30,87,116
79 | BackgroundNormal=61,174,233
80 | DecorationFocus=61,174,233
81 | DecorationHover=61,174,233
82 | ForegroundActive=252,252,252
83 | ForegroundInactive=161,169,177
84 | ForegroundLink=253,188,75
85 | ForegroundNegative=218,68,83
86 | ForegroundNeutral=246,116,0
87 | ForegroundNormal=252,252,252
88 | ForegroundPositive=39,174,96
89 | ForegroundVisited=155,89,182
90 |
91 | [Colors:Tooltip]
92 | BackgroundAlternate=42,46,50
93 | BackgroundNormal=49,54,59
94 | DecorationFocus=61,174,233
95 | DecorationHover=61,174,233
96 | ForegroundActive=61,174,233
97 | ForegroundInactive=161,169,177
98 | ForegroundLink=29,153,243
99 | ForegroundNegative=218,68,83
100 | ForegroundNeutral=246,116,0
101 | ForegroundNormal=252,252,252
102 | ForegroundPositive=39,174,96
103 | ForegroundVisited=155,89,182
104 |
105 | [Colors:View]
106 | BackgroundAlternate=35,38,41
107 | BackgroundNormal=27,30,32
108 | DecorationFocus=61,174,233
109 | DecorationHover=61,174,233
110 | ForegroundActive=61,174,233
111 | ForegroundInactive=161,169,177
112 | ForegroundLink=29,153,243
113 | ForegroundNegative=218,68,83
114 | ForegroundNeutral=246,116,0
115 | ForegroundNormal=252,252,252
116 | ForegroundPositive=39,174,96
117 | ForegroundVisited=155,89,182
118 |
119 | [Colors:Window]
120 | BackgroundAlternate=49,54,59
121 | BackgroundNormal=42,46,50
122 | DecorationFocus=61,174,233
123 | DecorationHover=61,174,233
124 | ForegroundActive=61,174,233
125 | ForegroundInactive=161,169,177
126 | ForegroundLink=29,153,243
127 | ForegroundNegative=218,68,83
128 | ForegroundNeutral=246,116,0
129 | ForegroundNormal=252,252,252
130 | ForegroundPositive=39,174,96
131 | ForegroundVisited=155,89,182
132 |
133 | [General]
134 | ColorScheme=Breeze Dark
135 | Name=Breeze Dark
136 | shadeSortColumn=true
137 |
138 | [KDE]
139 | contrast=4
140 |
141 | [WM]
142 | activeBackground=49,54,59
143 | activeBlend=252,252,252
144 | activeForeground=252,252,252
145 | inactiveBackground=42,46,50
146 | inactiveBlend=161,169,177
147 | inactiveForeground=161,169,177
148 |
--------------------------------------------------------------------------------
/plasma/desktoptheme/breeze-dark-transparent/metadata.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Name=Breeze Dark Transparent
3 | Name[ar]=نسيم داكن
4 | Name[az]=Breeze Tünd variant
5 | Name[ca]=Brisa fosca
6 | Name[ca@valencia]=Brisa fosca
7 | Name[cs]=Breeze Tmavé
8 | Name[da]=Breeze Dark
9 | Name[de]=Breeze-Dunkel
10 | Name[en_GB]=Breeze Dark
11 | Name[es]=Brisa oscuro
12 | Name[et]=Breeze tume
13 | Name[eu]=Breeze iluna
14 | Name[fi]=Breeze Dark
15 | Name[fr]=Breeze sombre
16 | Name[gd]=Dorch-oiteag
17 | Name[gl]=Breeze escuro
18 | Name[hu]=Breeze Dark
19 | Name[ia]=Brisa obscure
20 | Name[id]=Breeze Gelap
21 | Name[it]=Brezza scuro
22 | Name[ko]=어두운 Breeze
23 | Name[lt]=Breeze tamsus
24 | Name[lv]=Tumšā brīze
25 | Name[nb]=Mørk bris
26 | Name[nds]=Breeze düüster
27 | Name[nl]=Breeze Dark
28 | Name[nn]=Breeze mørk
29 | Name[pa]=ਬਰੀਜ਼ ਗੂੜ੍ਹਾ
30 | Name[pl]=Ciemna bryza
31 | Name[pt]=Brisa Escura
32 | Name[pt_BR]=Breeze Dark
33 | Name[ro]=Briză, întunecat
34 | Name[ru]=Breeze, тёмный вариант
35 | Name[sk]=Vánok Tmavý
36 | Name[sl]=Sapica (temna)
37 | Name[sr]=Поветарац тамни
38 | Name[sr@ijekavian]=Поветарац тамни
39 | Name[sr@ijekavianlatin]=Povetarac tamni
40 | Name[sr@latin]=Povetarac tamni
41 | Name[sv]=Breeze mörk
42 | Name[tg]=Насими торик
43 | Name[tr]=Esintili Koyu
44 | Name[uk]=Темна Breeze
45 | Name[vi]=Breeze Tối
46 | Name[x-test]=xxBreeze Darkxx
47 | Name[zh_CN]=暗色微风
48 | Name[zh_TW]=Breeze Dark
49 | Comment=Breeze Dark by the KDE VDG
50 | Comment[az]=KDE VDG tərəfindən Tünd Breeze
51 | Comment[ca]=Brisa fosca, creat pel VDG del KDE
52 | Comment[ca@valencia]=Brisa fosca pel VDG del KDE
53 | Comment[cs]=Breeze Dark od KDE VDG
54 | Comment[da]=Breeze Dark af KDE VDG
55 | Comment[de]=Breeze-Dunkel von der KDE VDG
56 | Comment[en_GB]=Breeze Dark by the KDE VDG
57 | Comment[es]=Brisa oscuro por KDE VDG
58 | Comment[et]=Breeze tume KDE VDG-lt
59 | Comment[eu]=Breeze iluna, KDE VDGk egina
60 | Comment[fi]=Breeze Dark KDE VDG:ltä
61 | Comment[fr]=Breeze sombre, par KDE VDG
62 | Comment[gl]=Breeze escuro de KDE VDG
63 | Comment[hu]=Breeze Dark a KDE VDG-től
64 | Comment[ia]=Breeze Dark (Brisa Obscure) per le KDE VDG
65 | Comment[id]=Breeze Gelap oleh KDE VDG
66 | Comment[it]=Brezza scuro del KDE VDG
67 | Comment[ko]=KDE VDG에서 만든 어두운 Breeze
68 | Comment[nl]=Breeze Dark door de KDE VDG
69 | Comment[nn]=Breeze mørk frå KDE VDG
70 | Comment[pa]=ਕੇਡੀਈ ਵੀਡੀਜੀ ਵਲੋਂ ਬਰੀਜ਼ ਗੂੜ੍ਹਾ
71 | Comment[pl]=Ciemna bryza autorstwa KDE VDG
72 | Comment[pt]=Brisa Escuro da VDG do KDE
73 | Comment[pt_BR]=Breeze Dark pelo KDE VDG
74 | Comment[ro]=Briză, întunecat, de KDE VDG
75 | Comment[ru]=Тёмный вариант Breeze от KDE VDG
76 | Comment[sk]=Vánok Tmavý od KDE VDG
77 | Comment[sl]=Sapica temna (Breeze Dark) od KDE VDG
78 | Comment[sv]=Breeze mörk av KDE:s visuella designgrupp
79 | Comment[tg]=Насими торик аз KDE VDG
80 | Comment[uk]=Темна Breeze, автори — KDE VDG
81 | Comment[vi]=Breeze Tối, do KDE VDG
82 | Comment[x-test]=xxBreeze Dark by the KDE VDGxx
83 | Comment[zh_CN]=暗色微风,由 KDE VDG 创作
84 | Comment[zh_TW]=由 KDE VDG 團隊製作的 Breeze Dark
85 |
86 |
87 | X-KDE-PluginInfo-Author=KDE Visual Design Group
88 | X-KDE-PluginInfo-Email=kde-artists@kde.org
89 | X-KDE-PluginInfo-Name=breeze-dark
90 | X-KDE-PluginInfo-Version=5.81.0
91 | X-KDE-PluginInfo-Website=https://plasma.kde.org
92 | X-KDE-PluginInfo-Category=
93 | X-KDE-PluginInfo-License=LGPL
94 | X-KDE-PluginInfo-EnabledByDefault=true
95 | X-Plasma-API=5.0
96 |
97 | [Wallpaper]
98 | defaultWallpaperTheme=Next
99 | defaultFileSuffix=.png
100 | defaultWidth=1920
101 | defaultHeight=1080
102 |
103 | [ContrastEffect]
104 | enabled=true
105 | contrast=1.0
106 | intensity=0.8
107 | saturation=1.0
108 |
109 | [AdaptiveTransparency]
110 | enabled=true
111 |
--------------------------------------------------------------------------------
/plasma/desktoptheme/breeze-dark-transparent/widgets/plasmoidheading.svgz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/julian-heng/dotfiles/5a0f853d0d86660ecf5cdc6570d418fdaf215788/plasma/desktoptheme/breeze-dark-transparent/widgets/plasmoidheading.svgz
--------------------------------------------------------------------------------
/plasma/dolphin/dolphin.shortcuts:
--------------------------------------------------------------------------------
1 | [Shortcuts]
2 | activate_next_tab=Ctrl+PgDown; Ctrl+]; Ctrl+Tab
3 | activate_prev_tab=Ctrl+PgUp; Ctrl+[; Ctrl+Shift+Tab
4 | add_bookmark=none
5 | add_bookmarks_list=none
6 | ascending=none
7 | compact=Ctrl+2
8 | compare_files=none
9 | create_dir=F10; Ctrl+Shift+N
10 | delete_shortcut=Del
11 | deletefile=Shift+Del
12 | descending=none
13 | details=Ctrl+3
14 | edit_copy=Ctrl+C; Ctrl+Ins
15 | edit_cut=Ctrl+X
16 | edit_find=Ctrl+Shift+F
17 | edit_paste=Ctrl+V; Shift+Ins
18 | edit_select_all=Ctrl+A
19 | edit_undo=Ctrl+Z
20 | editable_location=F6
21 | file_close=Ctrl+W; Ctrl+Esc
22 | file_new=Ctrl+N
23 | file_quit=Ctrl+Q
24 | folders_first=none
25 | go_back=Alt+Left; Back; Backspace
26 | go_forward=Alt+Right; Forward
27 | go_home=Alt+Home; Home Page
28 | go_up=Alt+Up
29 | help_about_app=none
30 | help_about_kde=none
31 | help_contents=F1
32 | help_donate=none
33 | help_report_bug=none
34 | help_whats_this=Shift+F1
35 | icons=Ctrl+1
36 | invert_selection=Ctrl+Shift+A
37 | lock_panels=none
38 | mainToolBar=none
39 | movetotrash=Del
40 | new_tab=Ctrl+T;\s
41 | open_in_new_tab=none
42 | open_in_new_tabs=none
43 | open_in_new_window=none
44 | open_terminal=Shift+F4
45 | options_configure=Ctrl+Shift+,
46 | options_configure_keybinding=none
47 | options_configure_toolbars=none
48 | options_show_menubar=Ctrl+M
49 | properties=Alt+Return; Alt+Enter
50 | renamefile=F2
51 | replace_location=Ctrl+L
52 | show_accesstime=none
53 | show_comment=none
54 | show_creationtime=none
55 | show_filter_bar=Ctrl+F; /
56 | show_folders_panel=F7
57 | show_hidden_files=Alt+.; Ctrl+H; F8
58 | show_in_groups=none
59 | show_information_panel=F11
60 | show_modificationtime=none
61 | show_places_panel=F9
62 | show_preview=none
63 | show_rating=none
64 | show_size=none
65 | show_tags=none
66 | show_target=none
67 | show_terminal_panel=F4
68 | show_type=none
69 | sort_by_accesstime=none
70 | sort_by_comment=none
71 | sort_by_creationtime=none
72 | sort_by_modificationtime=none
73 | sort_by_rating=none
74 | sort_by_size=none
75 | sort_by_tags=none
76 | sort_by_text=none
77 | sort_by_type=none
78 | split_stash=Ctrl+S
79 | split_view=F3
80 | stop=none
81 | switch_application_language=none
82 | undo_close_tab=Ctrl+Shift+T
83 | view_mode=none
84 | view_properties=none
85 | view_redisplay=F5; Refresh
86 | view_zoom_in=Ctrl++; Ctrl+=
87 | view_zoom_out=Ctrl+-
88 |
--------------------------------------------------------------------------------
/plasma/dolphin/dolphinrc:
--------------------------------------------------------------------------------
1 | MenuBar=Disabled
2 |
3 | [CompactMode]
4 | FontWeight=57
5 | PreviewSize=22
6 |
7 | [Desktop Entry]
8 | DefaultProfile=Profile.profile
9 |
10 | [DetailsMode]
11 | ExpandableFolders=false
12 | FontWeight=57
13 | PreviewSize=16
14 |
15 | [Favorite Profiles]
16 | Favorites=
17 |
18 | [General]
19 | GlobalViewProps=true
20 | OpenExternallyCalledFolderInNewTab=false
21 | RememberOpenedTabs=false
22 | ShowZoomSlider=false
23 | Version=201
24 |
25 | [IconsMode]
26 | FontWeight=57
27 | IconSize=48
28 | MaximumTextLines=3
29 | PreviewSize=128
30 |
31 | [MainWindow]
32 | MenuBar=Disabled
33 | ToolBarsMovable=Disabled
34 |
35 | [MainWindow][Toolbar mainToolBar]
36 | IconSize=16
37 |
38 | [Notification Messages]
39 | ConfirmEmptyTrash=true
40 |
41 | [Open-with settings]
42 | CompletionMode=1
43 |
44 | [PlacesPanel]
45 | IconSize=16
46 |
47 | [PreviewSettings]
48 | Plugins=audiothumbnail,comicbookthumbnail,djvuthumbnail,exrthumbnail,directorythumbnail,fontthumbnail,imagethumbnail,jpegthumbnail,kraorathumbnail,windowsexethumbnail,windowsimagethumbnail,svgthumbnail
49 |
50 | [Search]
51 | Location=Everywhere
52 |
53 | [Toolbar mainToolBar]
54 | IconSize=16
55 |
--------------------------------------------------------------------------------
/plasma/gwenview/gwenviewrc:
--------------------------------------------------------------------------------
1 | Height 1080=728
2 | State=AAAA/wAAAAD9AAAAAAAAA8kAAAKUAAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAEAAAAWAG0AYQBpAG4AVABvAG8AbABCAGEAcgEAAAAA/////wAAAAAAAAAA
3 | Width 1920=969
4 |
5 | [$Version]
6 | update_info=gwenview.upd:SideBar_StatusBar_Rename,gwenview.upd:ImageView_AlphaBackgroundMode_Update,gwenview.upd:DeleteThumbnailSetting_Rename
7 |
8 | [Crop]
9 | CropAdvancedSettingsEnabled=true
10 | CropRatioHeight=1
11 | CropRatioWidth=1
12 |
13 | [General]
14 | ThumbnailBarRowCount=5
15 |
16 | [ImageView]
17 | AlphaBackgroundColor=100,100,100
18 | AlphaBackgroundMode=AbstractImageView::AlphaBackgroundSolid
19 | AnimationMethod=DocumentView::NoAnimation
20 | ThumbnailSplitterSizes=114,543
21 |
22 | [MainWindow]
23 | Height 1080=645
24 | Height 1920=645
25 | MenuBar=Disabled
26 | State=AAAA/wAAAAD9AAAAAAAAA/4AAAKFAAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAEAAAAWAG0AYQBpAG4AVABvAG8AbABCAGEAcgAAAAAA/////wAAAAAAAAAA
27 | ToolBarsMovable=Disabled
28 | Width 1080=1022
29 | Width 1920=1022
30 |
31 | [Notification Messages]
32 | HideMenuBarWarning=false
33 |
34 | [SideBar]
35 | IsVisible BrowseMode=false
36 | IsVisible ViewMode=false
37 | SideBarSplitterSizes=242,761
38 |
39 | [StatusBar]
40 | IsVisible ViewMode=false
41 |
42 | [ThumbnailView]
43 | ListVideos=false
44 | ThumbnailDetails=25
45 |
--------------------------------------------------------------------------------
/plasma/konsole/konsolerc:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | DefaultProfile=Profile.profile
3 |
4 | [Favorite Profiles]
5 | Favorites=Profile.profile
6 |
7 | [KonsoleWindow]
8 | AllowMenuAccelerators=true
9 | SaveGeometryOnExit=false
10 | ShowMenuBarByDefault=false
11 | ShowWindowTitleOnTitleBar=true
12 |
13 | [MainWindow]
14 | MenuBar=Disabled
15 | RestorePositionForNextInstance=false
16 | State=AAAA/wAAAAD9AAAAAAAAAsAAAAG2AAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAIAAAAWAG0AYQBpAG4AVABvAG8AbABCAGEAcgAAAAAA/////wAAAAAAAAAAAAAAHABzAGUAcwBzAGkAbwBuAFQAbwBvAGwAYgBhAHIAAAAAAP////8AAAAAAAAAAA==
17 | StatusBar=Disabled
18 | ToolBarsMovable=Disabled
19 | Window-Maximized 1920x1080=true
20 |
21 | [Notification Messages]
22 | CloseAllEmptyTabs=true
23 | CloseAllTabs=true
24 |
25 | [TabBar]
26 | TabBarPosition=Top
27 |
--------------------------------------------------------------------------------
/plasma/konsole/profile/Profile.profile:
--------------------------------------------------------------------------------
1 | [Appearance]
2 | AntiAliasFonts=true
3 | BoldIntense=false
4 | ColorScheme=base16-tomorrow-night
5 | Font=Inconsolata,9.5,-1,5,50,0,0,0,0,0
6 | LineSpacing=0
7 | UseFontLineChararacters=true
8 |
9 | [General]
10 | Command=/bin/bash
11 | Name=Profile
12 | Parent=FALLBACK/
13 | ShowTerminalSizeHint=true
14 | TerminalCenter=true
15 | TerminalColumns=92
16 | TerminalMargin=16
17 |
18 | [Interaction Options]
19 | CtrlRequiredForDrag=false
20 | DropUrlsAsText=true
21 |
22 | [Keyboard]
23 | KeyBindings=default
24 |
25 | [Scrolling]
26 | HistoryMode=2
27 | ScrollBarPosition=1
28 |
29 | [Terminal Features]
30 | BidiRenderingEnabled=true
31 | BlinkingCursorEnabled=true
32 | BlinkingTextEnabled=true
33 | UrlHintsModifiers=67108864
34 |
--------------------------------------------------------------------------------
/plasma/konsole/profile/base16-tomorrow-night.colorscheme:
--------------------------------------------------------------------------------
1 | [Background]
2 | Color=29,31,33
3 |
4 | [BackgroundFaint]
5 | Color=29,31,33
6 |
7 | [BackgroundIntense]
8 | Color=150,152,150
9 |
10 | [Color0]
11 | Color=29,31,33
12 |
13 | [Color0Faint]
14 | Color=29,31,33
15 |
16 | [Color0Intense]
17 | Color=150,152,150
18 |
19 | [Color1]
20 | Color=204,102,102
21 |
22 | [Color1Faint]
23 | Color=204,102,102
24 |
25 | [Color1Intense]
26 | Color=204,102,102
27 |
28 | [Color2]
29 | Color=181,189,104
30 |
31 | [Color2Faint]
32 | Color=181,189,104
33 |
34 | [Color2Intense]
35 | Color=181,189,104
36 |
37 | [Color3]
38 | Color=240,198,116
39 |
40 | [Color3Faint]
41 | Color=240,198,116
42 |
43 | [Color3Intense]
44 | Color=240,198,116
45 |
46 | [Color4]
47 | Color=129,162,190
48 |
49 | [Color4Faint]
50 | Color=129,162,190
51 |
52 | [Color4Intense]
53 | Color=129,162,190
54 |
55 | [Color5]
56 | Color=178,148,187
57 |
58 | [Color5Faint]
59 | Color=178,148,187
60 |
61 | [Color5Intense]
62 | Color=178,148,187
63 |
64 | [Color6]
65 | Color=138,190,183
66 |
67 | [Color6Faint]
68 | Color=138,190,183
69 |
70 | [Color6Intense]
71 | Color=138,190,183
72 |
73 | [Color7]
74 | Color=197,200,198
75 |
76 | [Color7Faint]
77 | Color=197,200,198
78 |
79 | [Color7Intense]
80 | Color=255,255,255
81 |
82 | [Foreground]
83 | Color=197,200,198
84 |
85 | [ForegroundFaint]
86 | Color=197,200,198
87 |
88 | [ForegroundIntense]
89 | Color=255,255,255
90 |
91 | [General]
92 | Blur=true
93 | Description=Base16 Tomorrow Night
94 | Opacity=0.82
95 | Wallpaper=
96 |
--------------------------------------------------------------------------------
/plasma/konsole/profile/readme.txt:
--------------------------------------------------------------------------------
1 | Copy the contents of this folder to ~/.local/share/konsole
2 |
--------------------------------------------------------------------------------
/polybar/config:
--------------------------------------------------------------------------------
1 | [bar/bar]
2 | bottom = true
3 | width = 100%
4 | height = 18
5 | radius = 0.0
6 | fixed-center = false
7 | separator = " "
8 |
9 | background = ${colors.background}
10 | foreground = ${colors.foreground}
11 |
12 | border-top-size = 2
13 | border-color = ${colors.foreground_2}
14 |
15 | padding-left = 1
16 | padding-right = 1
17 |
18 | module-margin-left = 0
19 | module-margin-right = 0
20 |
21 | font-0 = inconsolata:size=10;3
22 |
23 | modules-left = bspwm
24 | modules-right = info date
25 |
26 | cursor-click = pointer
27 | cursor-scroll = ns-resize
28 |
29 |
30 | [colors]
31 | background = #1d1f21
32 | foreground = #c5c8c6
33 | foreground_2 = #808080
34 |
35 |
36 | [module/bspwm]
37 | type = custom/script
38 | exec = bash ~/.dotfiles/polybar/polybar_bspwm
39 | content-padding = 1
40 | tail = true
41 | interval = 0.1
42 |
43 |
44 | [module/info]
45 | type = custom/script
46 | exec = ${HOME}/.local/bin/sys-line '[ {cpu.load_avg}{cpu.temp? | {}_C}{cpu.fan? | {} RPM} ]{mem.percent? [ Mem: {}% ]}{disk.percent? [ {disk.dev}: {}% ]}{bat.is_present? [ Bat: {bat.percent}%{bat.time? | {}} ]}{net.ssid? [ {} ]}{misc.vol? [ vol: {}%]}{misc.scr? [ scr: {}% ]}' --disk-short-dev --cpu-temp-round=1 --{mem,disk,bat}-percent-round=1
47 | content-padding = 1
48 | tail = true
49 |
50 |
51 | [module/date]
52 | type = internal/date
53 | interval = 2
54 | label = %time%
55 | time = [ %a, %d %h | %H:%M ]
56 |
--------------------------------------------------------------------------------
/polybar/polybar_bspwm:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | get_desktop_id()
4 | {
5 | if type -p xprop > /dev/null 2>&1; then
6 | read -r _ _ desktop_id < <(xprop -root -notype _NET_CURRENT_DESKTOP)
7 | fi
8 | }
9 |
10 | get_window_name()
11 | {
12 | node="$(bspc query --nodes -n)"
13 | bspc_out="$(bspc query --tree -n "${node}")"
14 | bspc_out="${bspc_out##*"className\":\""}"
15 | window_name="${bspc_out%%\"*}"
16 | }
17 |
18 | main()
19 | {
20 | get_desktop_id
21 | get_window_name
22 |
23 | if [[ "${desktop_id}" && "${window_name}" ]]; then
24 | printf "[ %s | %s ]" "${desktop_id}" "${window_name}"
25 | elif [[ "${desktop_id}" || "${window_name}" ]]; then
26 | printf "[ %s ]" "${desktop_id:-${window_name}}"
27 | else
28 | printf ""
29 | fi
30 | }
31 |
32 | main
33 |
--------------------------------------------------------------------------------
/polybar/reload:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | main()
4 | {
5 | type -p polybar > /dev/null 2>&1 && {
6 | pgrep -x polybar > /dev/null 2>&1 && \
7 | pkill -x polybar
8 |
9 | setsid polybar bar &
10 | }
11 | }
12 |
13 | main
14 |
--------------------------------------------------------------------------------
/qutebrowser/base16-tomorrow-night.config.py:
--------------------------------------------------------------------------------
1 | # base16-qutebrowser (https://github.com/theova/base16-qutebrowser)
2 | # Base16 qutebrowser template by theova and Daniel Mulford
3 | # Tomorrow Night scheme by Chris Kempson (http://chriskempson.com)
4 |
5 | base00 = "#1d1f21"
6 | base01 = "#282a2e"
7 | base02 = "#373b41"
8 | base03 = "#969896"
9 | base04 = "#b4b7b4"
10 | base05 = "#c5c8c6"
11 | base06 = "#e0e0e0"
12 | base07 = "#ffffff"
13 | base08 = "#cc6666"
14 | base09 = "#de935f"
15 | base0A = "#f0c674"
16 | base0B = "#b5bd68"
17 | base0C = "#8abeb7"
18 | base0D = "#81a2be"
19 | base0E = "#b294bb"
20 | base0F = "#a3685a"
21 |
22 | # set qutebrowser colors
23 |
24 | # Text color of the completion widget. May be a single color to use for
25 | # all columns or a list of three colors, one for each column.
26 | c.colors.completion.fg = base05
27 |
28 | # Background color of the completion widget for odd rows.
29 | c.colors.completion.odd.bg = base00
30 |
31 | # Background color of the completion widget for even rows.
32 | c.colors.completion.even.bg = base00
33 |
34 | # Foreground color of completion widget category headers.
35 | c.colors.completion.category.fg = base0D
36 |
37 | # Background color of the completion widget category headers.
38 | c.colors.completion.category.bg = base00
39 |
40 | # Top border color of the completion widget category headers.
41 | c.colors.completion.category.border.top = base00
42 |
43 | # Bottom border color of the completion widget category headers.
44 | c.colors.completion.category.border.bottom = base00
45 |
46 | # Foreground color of the selected completion item.
47 | c.colors.completion.item.selected.fg = base00
48 |
49 | # Background color of the selected completion item.
50 | c.colors.completion.item.selected.bg = base0D
51 |
52 | # Top border color of the selected completion item
53 | c.colors.completion.item.selected.border.top = base0D
54 |
55 | # Bottom border color of the selected completion item.
56 | c.colors.completion.item.selected.border.bottom = base0D
57 |
58 | # Foreground color of the matched text in the selected completion item.
59 | c.colors.completion.item.selected.match.fg = base00
60 |
61 | # Foreground color of the matched text in the completion.
62 | c.colors.completion.match.fg = base09
63 |
64 | # Color of the scrollbar handle in the completion view.
65 | c.colors.completion.scrollbar.fg = base05
66 |
67 | # Color of the scrollbar in the completion view.
68 | c.colors.completion.scrollbar.bg = base00
69 |
70 | # Background color for the download bar.
71 | c.colors.downloads.bar.bg = base00
72 |
73 | # Color gradient start for download text.
74 | c.colors.downloads.start.fg = base00
75 |
76 | # Color gradient start for download backgrounds.
77 | c.colors.downloads.start.bg = base0D
78 |
79 | # Color gradient end for download text.
80 | c.colors.downloads.stop.fg = base00
81 |
82 | # Color gradient stop for download backgrounds.
83 | c.colors.downloads.stop.bg = base0C
84 |
85 | # Foreground color for downloads with errors.
86 | c.colors.downloads.error.fg = base08
87 |
88 | # Font color for hints.
89 | c.colors.hints.fg = base00
90 |
91 | # Background color for hints. Note that you can use a `rgba(...)` value
92 | # for transparency.
93 | c.colors.hints.bg = base0A
94 |
95 | # Font color for the matched part of hints.
96 | c.colors.hints.match.fg = base05
97 |
98 | # Text color for the keyhint widget.
99 | c.colors.keyhint.fg = base05
100 |
101 | # Highlight color for keys to complete the current keychain.
102 | c.colors.keyhint.suffix.fg = base05
103 |
104 | # Background color of the keyhint widget.
105 | c.colors.keyhint.bg = base00
106 |
107 | # Foreground color of an error message.
108 | c.colors.messages.error.fg = base00
109 |
110 | # Background color of an error message.
111 | c.colors.messages.error.bg = base08
112 |
113 | # Border color of an error message.
114 | c.colors.messages.error.border = base08
115 |
116 | # Foreground color of a warning message.
117 | c.colors.messages.warning.fg = base00
118 |
119 | # Background color of a warning message.
120 | c.colors.messages.warning.bg = base0E
121 |
122 | # Border color of a warning message.
123 | c.colors.messages.warning.border = base0E
124 |
125 | # Foreground color of an info message.
126 | c.colors.messages.info.fg = base05
127 |
128 | # Background color of an info message.
129 | c.colors.messages.info.bg = base00
130 |
131 | # Border color of an info message.
132 | c.colors.messages.info.border = base00
133 |
134 | # Foreground color for prompts.
135 | c.colors.prompts.fg = base05
136 |
137 | # Border used around UI elements in prompts.
138 | c.colors.prompts.border = base00
139 |
140 | # Background color for prompts.
141 | c.colors.prompts.bg = base00
142 |
143 | # Background color for the selected item in filename prompts.
144 | c.colors.prompts.selected.bg = base0A
145 |
146 | # Foreground color of the statusbar.
147 | c.colors.statusbar.normal.fg = base05
148 |
149 | # Background color of the statusbar.
150 | c.colors.statusbar.normal.bg = base00
151 |
152 | # Foreground color of the statusbar in insert mode.
153 | c.colors.statusbar.insert.fg = base0C
154 |
155 | # Background color of the statusbar in insert mode.
156 | c.colors.statusbar.insert.bg = base00
157 |
158 | # Foreground color of the statusbar in passthrough mode.
159 | c.colors.statusbar.passthrough.fg = base0A
160 |
161 | # Background color of the statusbar in passthrough mode.
162 | c.colors.statusbar.passthrough.bg = base00
163 |
164 | # Foreground color of the statusbar in private browsing mode.
165 | c.colors.statusbar.private.fg = base0E
166 |
167 | # Background color of the statusbar in private browsing mode.
168 | c.colors.statusbar.private.bg = base00
169 |
170 | # Foreground color of the statusbar in command mode.
171 | c.colors.statusbar.command.fg = base04
172 |
173 | # Background color of the statusbar in command mode.
174 | c.colors.statusbar.command.bg = base01
175 |
176 | # Foreground color of the statusbar in private browsing + command mode.
177 | c.colors.statusbar.command.private.fg = base0E
178 |
179 | # Background color of the statusbar in private browsing + command mode.
180 | c.colors.statusbar.command.private.bg = base01
181 |
182 | # Foreground color of the statusbar in caret mode.
183 | c.colors.statusbar.caret.fg = base0D
184 |
185 | # Background color of the statusbar in caret mode.
186 | c.colors.statusbar.caret.bg = base00
187 |
188 | # Foreground color of the statusbar in caret mode with a selection.
189 | c.colors.statusbar.caret.selection.fg = base0D
190 |
191 | # Background color of the statusbar in caret mode with a selection.
192 | c.colors.statusbar.caret.selection.bg = base00
193 |
194 | # Background color of the progress bar.
195 | c.colors.statusbar.progress.bg = base0D
196 |
197 | # Default foreground color of the URL in the statusbar.
198 | c.colors.statusbar.url.fg = base05
199 |
200 | # Foreground color of the URL in the statusbar on error.
201 | c.colors.statusbar.url.error.fg = base08
202 |
203 | # Foreground color of the URL in the statusbar for hovered links.
204 | c.colors.statusbar.url.hover.fg = base09
205 |
206 | # Foreground color of the URL in the statusbar on successful load
207 | # (http).
208 | c.colors.statusbar.url.success.http.fg = base0B
209 |
210 | # Foreground color of the URL in the statusbar on successful load
211 | # (https).
212 | c.colors.statusbar.url.success.https.fg = base0B
213 |
214 | # Foreground color of the URL in the statusbar when there's a warning.
215 | c.colors.statusbar.url.warn.fg = base0E
216 |
217 | # Background color of the tab bar.
218 | c.colors.tabs.bar.bg = base00
219 |
220 | # Color gradient start for the tab indicator.
221 | c.colors.tabs.indicator.start = base0D
222 |
223 | # Color gradient end for the tab indicator.
224 | c.colors.tabs.indicator.stop = base0C
225 |
226 | # Color for the tab indicator on errors.
227 | c.colors.tabs.indicator.error = base08
228 |
229 | # Foreground color of unselected odd tabs.
230 | c.colors.tabs.odd.fg = base05
231 |
232 | # Background color of unselected odd tabs.
233 | c.colors.tabs.odd.bg = base00
234 |
235 | # Foreground color of unselected even tabs.
236 | c.colors.tabs.even.fg = base05
237 |
238 | # Background color of unselected even tabs.
239 | c.colors.tabs.even.bg = base00
240 |
241 | # Background color of pinned unselected even tabs.
242 | c.colors.tabs.pinned.even.bg = base0B
243 |
244 | # Foreground color of pinned unselected even tabs.
245 | c.colors.tabs.pinned.even.fg = base00
246 |
247 | # Background color of pinned unselected odd tabs.
248 | c.colors.tabs.pinned.odd.bg = base0B
249 |
250 | # Foreground color of pinned unselected odd tabs.
251 | c.colors.tabs.pinned.odd.fg = base00
252 |
253 | # Background color of pinned selected even tabs.
254 | c.colors.tabs.pinned.selected.even.bg = base0D
255 |
256 | # Foreground color of pinned selected even tabs.
257 | c.colors.tabs.pinned.selected.even.fg = base00
258 |
259 | # Background color of pinned selected odd tabs.
260 | c.colors.tabs.pinned.selected.odd.bg = base0D
261 |
262 | # Foreground color of pinned selected odd tabs.
263 | c.colors.tabs.pinned.selected.odd.fg = base00
264 |
265 | # Foreground color of selected odd tabs.
266 | c.colors.tabs.selected.odd.fg = base00
267 |
268 | # Background color of selected odd tabs.
269 | c.colors.tabs.selected.odd.bg = base0D
270 |
271 | # Foreground color of selected even tabs.
272 | c.colors.tabs.selected.even.fg = base00
273 |
274 | # Background color of selected even tabs.
275 | c.colors.tabs.selected.even.bg = base0D
276 |
277 | # Background color for webpages if unset (or empty to use the theme's
278 | # color).
279 | c.colors.webpage.bg = base00
280 |
--------------------------------------------------------------------------------
/qutebrowser/config.py:
--------------------------------------------------------------------------------
1 | # Autogenerated config.py
2 | # Documentation:
3 | # qute://help/configuring.html
4 | # qute://help/settings.html
5 |
6 | # Uncomment this to still load settings configured via autoconfig.yml
7 | config.load_autoconfig()
8 |
9 | # Enable JavaScript.
10 | # Type: Bool
11 | config.set("content.javascript.enabled", True, "file://*")
12 |
13 | # Enable JavaScript.
14 | # Type: Bool
15 | config.set("content.javascript.enabled", True, "chrome://*/*")
16 |
17 | # Enable JavaScript.
18 | # Type: Bool
19 | config.set("content.javascript.enabled", True, "qute://*/*")
20 |
21 |
22 | # Bindings
23 | # Focus on next and previous tabs
24 | config.bind("", "tab-next")
25 | config.bind("", "tab-prev")
26 |
27 | # Page up and page down
28 | config.bind("", "scroll-page 0 -1")
29 | config.bind("", "scroll-page 0 1")
30 |
31 | config.unbind("q")
32 |
33 | # Set search engines
34 | config.set("url.searchengines", {
35 | "DEFAULT": "https://www.google.com.au/search?q={}",
36 | "!g": "https://www.google.com.au/search?q={}",
37 | "!r": "https://old.reddit.com/r/{}",
38 | "!rs": "https://old.reddit.com/search?q={}",
39 | "!yt": "https://www.youtube.com/results?search_query={}",
40 | "!wiki": "https://en.wikipedia.org/wiki/Search?search={}"
41 | })
42 |
43 | # General settings
44 | config.set("content.notifications", False)
45 | config.set("content.pdfjs", True)
46 | config.set("editor.command", ["vim", "{file}"])
47 |
48 | # Font settings
49 | config.set("fonts.completion.category", "7pt inconsolata")
50 | config.set("fonts.completion.entry", "7pt inconsolata")
51 | config.set("fonts.downloads", "bold 7pt inconsolata")
52 | config.set("fonts.hints", "bold 7pt inconsolata")
53 | config.set("fonts.keyhint", "bold 7pt inconsolata")
54 | config.set("fonts.messages.error", "7pt inconsolata")
55 | config.set("fonts.messages.info", "7pt inconsolata")
56 | config.set("fonts.messages.warning", "7pt inconsolata")
57 | config.set("fonts.prompts", "7pt inconsolata")
58 | config.set("fonts.statusbar", "bold 7pt inconsolata")
59 | config.set("fonts.tabs.selected", "bold 7pt inconsolata")
60 | config.set("fonts.tabs.unselected", "bold 7pt inconsolata")
61 |
62 | config.set("fonts.web.family.fixed", "inconsolata")
63 | config.set("fonts.web.family.sans_serif", "IBM Plex Sans")
64 | config.set("fonts.web.family.serif", "IBM Plex Serif")
65 |
66 | # Keyhint settings
67 | config.set("keyhint.radius", 0)
68 |
69 | # Scroll settings
70 | config.set("scrolling.bar", "when-searching")
71 | config.set("scrolling.smooth", True)
72 |
73 | # Status bar settings
74 | config.set("statusbar.padding", {"bottom": 2, "left": 1, "right": 1, "top": 2})
75 |
76 | # Tab settings
77 | config.set("tabs.background", True)
78 | config.set("tabs.last_close", "close")
79 | config.set("tabs.max_width", -1)
80 | config.set("tabs.min_width", 60)
81 | config.set("tabs.position", "top")
82 | config.set("tabs.show", "multiple")
83 | config.set("tabs.title.alignment", "left")
84 | config.set("tabs.padding", {"bottom": 2, "left": 4, "right": 4, "top": 2})
85 |
86 | # Url settings
87 | config.set("url.default_page", "https://julian-heng.gitlab.io/startpage")
88 | config.set("url.start_pages", [config.get("url.default_page")])
89 |
90 | # Set colors
91 | config.source("base16-tomorrow-night.config.py")
92 |
--------------------------------------------------------------------------------
/screenshots/macos.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/julian-heng/dotfiles/5a0f853d0d86660ecf5cdc6570d418fdaf215788/screenshots/macos.png
--------------------------------------------------------------------------------
/scripts/color/coins.bash:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # shellcheck disable=SC2154
3 |
4 | init_colors()
5 | {
6 | for i in {0..7}; do
7 | printf -v "f[$i]" "%s" $'\e[3'"$i"'m'
8 | done
9 | reset=$'\e[0m'
10 | }
11 |
12 | print_box()
13 | {
14 | local start_x="$1"
15 | local start_y="$2"
16 | local end_x="$3"
17 | local end_y="$4"
18 |
19 | if [[ "${end_x}" == *"+"* ]]; then
20 | local length_x="${end_x//'+'}"
21 | else
22 | local length_x="$((end_x - start_x))"
23 | fi
24 |
25 | if [[ "${end_y}" == *"+"* ]]; then
26 | local length_y="${end_y//'+'}"
27 | else
28 | local length_y="$((end_y - start_y))"
29 | fi
30 |
31 | local pat="$5"
32 | local i j
33 |
34 | ((length_x = length_x == 0 ? length_x + 1 : length_x))
35 | ((length_y = length_y == 0 ? length_y + 1 : length_y))
36 |
37 | ((start_x += ${x_offset:-0}))
38 | ((start_y += ${y_offset:-0}))
39 |
40 | printf "\\e[%d;%dH" "${start_y}" "${start_x}"
41 |
42 | for ((i = 0; i < length_y; i++)); do
43 | for ((j = 0; j < length_x; j++)); do
44 | printf "\\e[%d;%dH%s" "$((start_y + i))" "$((start_x + j))" "${pat}"
45 | [[ "${slow}" == "true" ]] && \
46 | sleep "${s_speed:-0.1}"
47 | done
48 | done
49 | }
50 |
51 | get_args()
52 | {
53 | while (($# > 0)); do
54 | case "$1" in
55 | "-s"|"--serial") serial="true" ;;
56 | "-ss"|"--slow")
57 | slow="true"
58 | [[ "$2" =~ ^[0-9]+([.][0-9]+)?$ ]] && {
59 | s_speed="$2"
60 | shift
61 | }
62 | ;;
63 | esac
64 | shift
65 | done
66 | }
67 |
68 | main()
69 | {
70 | get_args "$@"
71 | init_colors
72 | printf "%s" $'\e[2J'
73 |
74 | _coins()
75 | (
76 | x_offset="$((i * 14))"
77 |
78 | print_box "5" "3" "12" "12" "${f[$i]}█"
79 | print_box "4" "4" "13" "11" "${f[$i]}█"
80 | print_box "13" "6" "13" "9" "${f[$i]}█"
81 | print_box "7" "12" "10" "12" "${f[$i]}█"
82 |
83 | print_box "10" "4" "10" "11" "${f[0]}█"
84 | print_box "7" "10" "10" "10" "${f[0]}█"
85 |
86 | print_box "7" "2" "10" "2" "${f[7]}█"
87 | print_box "5" "3" "7" "3" "${f[7]}█"
88 | print_box "4" "4" "5" "4" "${f[7]}█"
89 | print_box "7" "4" "10" "4" "${f[7]}█"
90 | print_box "3" "5" "3" "9" "${f[7]}█"
91 | print_box "7" "4" "7" "10" "${f[7]}█"
92 | print_box "4" "9" "4" "11" "${f[7]}█"
93 | print_box "5" "11" "5" "11" "${f[7]}█"
94 | )
95 |
96 | for ((i = 0; i < ${#f[@]}; i++)); do
97 | if [[ "${serial}" == "true" ]]; then
98 | _coins
99 | else
100 | _coins &
101 | fi
102 | done
103 |
104 | [[ "${serial}" != "true" ]] && \
105 | wait
106 |
107 | printf "%s\\n\\n\\n" "${reset}"
108 | }
109 |
110 | [[ "${BASH_SOURCE[0]}" == "$0" ]] && \
111 | main "$@"
112 |
--------------------------------------------------------------------------------
/scripts/color/coins.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # pylint: disable=invalid-name,too-few-public-methods,too-many-arguments
3 |
4 | """ Prints coins """
5 |
6 |
7 | class Colors:
8 | """ Contains the color ascii codes """
9 |
10 | def __init__(self):
11 | self.foreground = ["\033[3{}m".format(i) for i in range(8)]
12 | self.background = ["\033[4{}m".format(i) for i in range(8)]
13 | self.reset = "\033[0m"
14 |
15 |
16 | def print_box(x1, y1, x2, y2, x_off, y_off, col, pat):
17 | """ Prints a box """
18 | length_x = abs(x2 - x1)
19 | length_y = abs(y2 - y1)
20 | length_x += 1 if length_x == 0 else 0
21 | length_y += 1 if length_y == 0 else 0
22 |
23 | if x2 < x1:
24 | x1, x2 = x2, x1
25 | if y2 < y1:
26 | y1, y2 = y2, y1
27 |
28 | x1 += x_off
29 | y1 += y_off
30 |
31 | print("\033[{};{}H{}".format(y1, x1, col))
32 | for i in range(length_y):
33 | print("\033[{};{}H{}".format(y1 + i, x1, pat * length_x))
34 |
35 |
36 | def main():
37 | """ Main function """
38 | c = Colors()
39 | print("\033[2J\033[H")
40 | count = 0
41 |
42 | for color in c.foreground:
43 | x_off = 14 * count
44 | count += 1
45 |
46 | print_box(5, 3, 12, 12, x_off, 0, color, "█")
47 | print_box(4, 4, 13, 11, x_off, 0, color, "█")
48 | print_box(13, 6, 13, 9, x_off, 0, color, "█")
49 | print_box(7, 12, 10, 12, x_off, 0, color, "█")
50 |
51 | print_box(10, 4, 10, 11, x_off, 0, c.foreground[0], "█")
52 | print_box(7, 10, 10, 10, x_off, 0, c.foreground[0], "█")
53 |
54 | print_box(7, 2, 10, 2, x_off, 0, c.foreground[7], "█")
55 | print_box(5, 3, 7, 3, x_off, 0, c.foreground[7], "█")
56 | print_box(4, 4, 5, 4, x_off, 0, c.foreground[7], "█")
57 | print_box(7, 4, 10, 4, x_off, 0, c.foreground[7], "█")
58 | print_box(3, 5, 3, 9, x_off, 0, c.foreground[7], "█")
59 | print_box(7, 4, 7, 10, x_off, 0, c.foreground[7], "█")
60 | print_box(4, 9, 4, 11, x_off, 0, c.foreground[7], "█")
61 | print_box(5, 11, 5, 11, x_off, 0, c.foreground[7], "█")
62 |
63 | print("{}\n".format(c.reset))
64 |
65 |
66 | if __name__ == "__main__":
67 | main()
68 |
--------------------------------------------------------------------------------
/scripts/color/ntsc_color_bars.bash:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # shellcheck disable=SC2154
3 |
4 | init_colors()
5 | {
6 | for i in {0..7}; do
7 | printf -v "f[$i]" "%s" $'\e[3'"$i"'m'
8 | done
9 | reset=$'\e[0m'
10 | }
11 |
12 | print_box()
13 | {
14 | local start_x="$1"
15 | local start_y="$2"
16 | local end_x="$3"
17 | local end_y="$4"
18 |
19 | if [[ "${end_x}" == *"+"* ]]; then
20 | local length_x="${end_x//'+'}"
21 | else
22 | local length_x="$((end_x - start_x))"
23 | fi
24 |
25 | if [[ "${end_y}" == *"+"* ]]; then
26 | local length_y="${end_y//'+'}"
27 | else
28 | local length_y="$((end_y - start_y))"
29 | fi
30 |
31 | local pat="$5"
32 | local i j
33 |
34 | ((length_x = length_x == 0 ? length_x + 1 : length_x))
35 | ((length_y = length_y == 0 ? length_y + 1 : length_y))
36 |
37 | ((start_x += ${x_offset:-0}))
38 | ((start_y += ${y_offset:-0}))
39 |
40 | printf "\\e[%d;%dH" "${start_y}" "${start_x}"
41 |
42 | for ((i = 0; i < length_y; i++)); do
43 | for ((j = 0; j < length_x; j++)); do
44 | printf "\\e[%d;%dH%s" "$((start_y + i))" "$((start_x + j))" "${pat}"
45 | done
46 | done
47 | }
48 |
49 | main()
50 | {
51 | init_colors
52 | printf "%s" $'\e[2J'
53 |
54 | set1=(
55 | "${f[7]}" "${f[3]}"
56 | "${f[6]}" "${f[2]}"
57 | "${f[5]}" "${f[1]}"
58 | "${f[4]}"
59 | )
60 |
61 | set2=(
62 | "${f[4]}" "${f[0]}"
63 | "${f[5]}" "${f[0]}"
64 | "${f[6]}" "${f[0]}"
65 | "${f[7]}"
66 | )
67 |
68 | set3=(
69 | "${f[4]}" "${f[7]}"
70 | "${f[5]}"
71 | )
72 |
73 | for ((i = 0; i < ${#set1[@]}; i++)); do
74 | x_offset="$((2 + (i * 4)))"
75 | print_box "1" "1" "5" "9" "${set1[$i]}█"
76 | done
77 |
78 | for ((i = 0; i < ${#set2[@]}; i++)); do
79 | x_offset="$((2 + (i * 4)))"
80 | print_box "1" "9" "5" "10" "${set2[$i]}█"
81 | done
82 |
83 | for ((i = 0; i < ${#set3[@]}; i++)); do
84 | x_offset="$((2 + (i * 5)))"
85 | print_box "1" "10" "6" "12" "${set3[$i]}█"
86 | done
87 |
88 | x_offset="$((2 + (i * 5)))"
89 | print_box "1" "10" "14" "12" "${f[0]}█"
90 |
91 | printf "%s\\n\\n" "${reset}"
92 | }
93 |
94 | main
95 |
--------------------------------------------------------------------------------
/scripts/info/show_song:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # shellcheck disable=SC2048,SC2086
3 |
4 | has()
5 | {
6 | if type -p "$1" > /dev/null 2>&1; then
7 | return 0
8 | else
9 | return 1
10 | fi
11 | }
12 |
13 | print_stdout()
14 | {
15 | [[ "${title}" ]] && printf "%s\\n" "${title}"
16 | [[ "${subtitle}" ]] && printf "%s\\n" "${subtitle}"
17 | [[ "${message}" ]] && printf "%s\\n" "${message}"
18 | }
19 |
20 | notify()
21 | {
22 | [[ "${title}" =~ (^( \| ))|(( \| )$) ]] && {
23 | title="${title##' | '}"
24 | title="${title%%' | '}"
25 | }
26 |
27 | [[ "${subtitle}" =~ (^( \| ))|(( \| )$) ]] && {
28 | subtitle="${subtitle##' | '}"
29 | subtitle="${subtitle%%' | '}"
30 | }
31 |
32 | [[ "${message}" =~ (^( \| ))|(( \| )$) ]] && {
33 | message="${message##' | '}"
34 | message="${message%%' | '}"
35 | }
36 |
37 | if [[ "${out}" == "stdout" ]]; then
38 | print_stdout
39 | else
40 | if has "notify-send" || has "osascript"; then
41 | if [[ "${subtitle}" && "${message}" ]]; then
42 | body="${subtitle}\\n${message}"
43 | elif [[ ! "${subtitle}" || ! "${message}" ]]; then
44 | body+="${subtitle}"
45 | body+="${message}"
46 | else
47 | body=""
48 | fi
49 |
50 | case "${os}" in
51 | "MacOS")
52 | script="display notification \"${message}\" \
53 | with title \"${title}\" \
54 | subtitle \"${subtitle}\""
55 | /usr/bin/env osascript <<< "${script}"
56 | ;;
57 |
58 | "Linux")
59 | notify-send --icon=dialog-information "${title}" "${body}"
60 | ;;
61 | esac
62 | else
63 | print_stdout
64 | fi
65 | fi
66 | }
67 |
68 | _get_function_from_string()
69 | {
70 | declare -A uniq
71 | local regex='(\{)([a-zA-Z_]+)'
72 | local str="$1"
73 | local -a func
74 |
75 | while [[ "${str}" =~ ${regex} ]]; do
76 | [[ ! "${uniq[${BASH_REMATCH[2]}]}" ]] && {
77 | uniq[${BASH_REMATCH[2]}]="1"
78 | func+=("${BASH_REMATCH[2]}")
79 | }
80 | str="${str/${BASH_REMATCH[2]}}"
81 | done
82 |
83 | printf "%s\\n" "${func[@]}"
84 | }
85 |
86 | make_string()
87 | {
88 | local str="$1"
89 | local out="${str}"
90 | local -a func
91 |
92 | mapfile -t func < <(_get_function_from_string "${str}")
93 |
94 | for function in "${func[@]}"; do
95 | token_match="\\{(${function})((\\?)([^\\{]*(\\{(${function})?\\})[^\\}]*))?\\}"
96 |
97 | if [[ "${song_info[${function}]}" ]]; then
98 | [[ "${out}" =~ ${token_match} ]]
99 | if [[ "${BASH_REMATCH[2]}" ]]; then
100 | token="${BASH_REMATCH[0]}"
101 | token="${token/${BASH_REMATCH[5]}/${song_info[${function}]}}"
102 | token="${token/\{${BASH_REMATCH[1]}\?}"
103 | token="${token%\}}"
104 | out="${out/${BASH_REMATCH[0]}/${token}}"
105 | else
106 | out="${out/${BASH_REMATCH[0]}/${song_info[${function}]}}"
107 | fi
108 | else
109 | [[ "${out}" =~ ${token_match} ]]
110 | out="${out/${BASH_REMATCH[0]}}"
111 | fi
112 | done
113 |
114 | printf "%s" "${out}"
115 | }
116 |
117 | get_os()
118 | {
119 | case "${OSTYPE:-$(uname -s)}" in
120 | "Darwin"|"darwin"*)
121 | os="MacOS"
122 | ;;
123 |
124 | "Linux"|"linux"*)
125 | os="Linux"
126 | ;;
127 | esac
128 | }
129 |
130 | get_app()
131 | {
132 | [[ "${app}" && "${song_info[app]}" ]] && \
133 | return
134 |
135 | if pgrep -x cmus > /dev/null 2>&1; then
136 | app="cmus"
137 | elif [[ "${os}" == "MacOS" \
138 | && "$(osascript -e "application \"iTunes\" is running")" == "true" ]]; then
139 | app="iTunes"
140 | else
141 | app="none"
142 | fi
143 |
144 | song_info[app]="${app}"
145 | }
146 |
147 | get_app_state()
148 | {
149 | [[ "${app_state}" && "${song_info[app_state]}" ]] && \
150 | return
151 |
152 | [[ ! "${song_info[app]}" ]] && \
153 | get_app
154 |
155 | case "${song_info[app]}" in
156 | "cmus")
157 | while [[ ! "${app_state}" ]] && read -r line; do
158 | [[ "${line}" =~ ^'status' ]] && \
159 | read -r _ app_state <<< "${line}"
160 | done < <(cmus-remote -Q)
161 | ;;
162 |
163 | "iTunes")
164 | osa_script='tell application "iTunes" to player state as string'
165 | app_state="$(osascript -e "${osa_script}")"
166 | ;;
167 |
168 | "none") app_state="none" ;;
169 | esac
170 |
171 | song_info[app_state]="${app_state}"
172 | }
173 |
174 | get_track()
175 | {
176 | [[ "${track}" && "${song_info[track]}" ]] && \
177 | return
178 |
179 | [[ ! "${app_state}" && ! "${song_info[app_state]}" ]] && \
180 | get_app_state
181 |
182 | case "${app_state}" in
183 | "none"|"stopped")
184 | return
185 | ;;
186 | esac
187 |
188 | case "${app}" in
189 | "cmus")
190 | format="format_print %{title}"
191 | track="$(cmus-remote -C "${format}")"
192 | ;;
193 |
194 | "iTunes")
195 | osa_script='tell application "iTunes"
196 | track of current track as string
197 | end tell'
198 | track="$(/usr/bin/env osascript <<< "${osa_script}")"
199 | ;;
200 | esac
201 |
202 | song_info[track]="${track}"
203 | }
204 |
205 | get_artist()
206 | {
207 | [[ "${artist}" && "${song_info[artist]}" ]] && \
208 | return
209 |
210 | [[ ! "${app_state}" && ! "${song_info[app_state]}" ]] && \
211 | get_app_state
212 |
213 | case "${app_state}" in
214 | "none"|"stopped")
215 | return
216 | ;;
217 | esac
218 |
219 | case "${app}" in
220 | "cmus")
221 | format="format_print %{artist}"
222 | artist="$(cmus-remote -C "${format}")"
223 | ;;
224 |
225 | "iTunes")
226 | osa_script='tell application "iTunes"
227 | artist of current artist as string
228 | end tell'
229 | artist="$(/usr/bin/env osascript <<< "${osa_script}")"
230 | ;;
231 | esac
232 |
233 | song_info[artist]="${artist}"
234 | }
235 |
236 | get_album()
237 | {
238 | [[ "${album}" && "${song_info[album]}" ]] && \
239 | return
240 |
241 | [[ ! "${app_state}" && ! "${song_info[app_state]}" ]] && \
242 | get_app_state
243 |
244 | case "${app_state}" in
245 | "none"|"stopped")
246 | return
247 | ;;
248 | esac
249 |
250 | case "${app}" in
251 | "cmus")
252 | format="format_print %{album}"
253 | album="$(cmus-remote -C "${format}")"
254 | ;;
255 |
256 | "iTunes")
257 | osa_script='tell application "iTunes"
258 | album of current album as string
259 | end tell'
260 | album="$(/usr/bin/env osascript <<< "${osa_script}")"
261 | ;;
262 | esac
263 |
264 | song_info[album]="${album}"
265 | }
266 |
267 | print_usage()
268 | {
269 | printf "%s\\n" "
270 | Usage: ${0##*/} info_name --option --option [value] ...
271 |
272 | Options:
273 | --stdout Print to stdout
274 | --jsong Print in json format
275 | -r, --raw Print in csv format
276 | -h, --help Show this message
277 |
278 | Info:
279 | info_name Print the output of func_name
280 |
281 | Valid Names:
282 | app
283 | app_state
284 | artist
285 | track
286 | album
287 |
288 | Output:
289 | -f, --format \"str\" Print info_name in a formatted string
290 | Used in conjuction with info_name
291 |
292 | Syntax:
293 | {} Output of info_name
294 |
295 | Examples:
296 | Print all information as a notification:
297 | \$ ${0##*/}
298 |
299 | Print to standard out:
300 | \$ ${0##*/} --stdout
301 |
302 | Print playing track:
303 | \$ ${0##*/} track
304 |
305 | Print current music player and state:
306 | \$ ${0##*/} --format '{app} | {app_state}'
307 |
308 | Misc:
309 | If notify-send is not installed, then the script will
310 | print to standard output.
311 | "
312 | }
313 |
314 | get_args()
315 | {
316 | while (($# > 0)); do
317 | case "$1" in
318 | "--stdout") : "${out:=stdout}" ;;
319 | "--json") : "${out:=json}" ;;
320 | "-r"|"--raw") : "${out:=raw}" ;;
321 | "-f"|"--format")
322 | [[ "$2" ]] && {
323 | : "${out:=string}"
324 | str_format="$2"
325 |
326 | tmp="${str_format}"
327 | regex='\{([a-zA-Z_]+)\?[^\{]*\{([a-zA-Z_]+)}'
328 |
329 | # String validation
330 | while [[ "${tmp}" =~ ${regex} ]]; do
331 | tmp="${tmp/${BASH_REMATCH[0]}}"
332 | [[ "${BASH_REMATCH[1]}" != "${BASH_REMATCH[2]}" ]] && {
333 | printf "Invalid format: %s != %s\\n" \
334 | "${BASH_REMATCH[1]}" \
335 | "${BASH_REMATCH[2]}" >&2
336 | exit 1
337 | }
338 | done
339 |
340 | mapfile -t func < <(_get_function_from_string "${str_format}")
341 | shift
342 | }
343 | ;;
344 | "-h"|"--help") print_usage; exit ;;
345 | *)
346 | : "${out:=string}"
347 | func+=("$1")
348 | ;;
349 | esac
350 | shift
351 | done
352 | }
353 |
354 | main()
355 | {
356 | declare -A song_info
357 | get_args "$@"
358 | get_os
359 |
360 | [[ ! "${func[*]}" ]] && \
361 | func=("app" "app_state" "track" "artist" "album")
362 |
363 | for function in "${func[@]}"; do
364 | [[ "$(type -t "get_${function}")" == "function" ]] && \
365 | "get_${function}"
366 | done
367 |
368 | [[ ! "${str_format}" ]] && \
369 | for i in "${!func[@]}"; do
370 | [[ ! "${song_info[${func[$i]}]}" ]] && \
371 | unset 'func[$i]'
372 | done
373 |
374 | [[ ! "${func[*]}" ]] && \
375 | exit 1
376 |
377 | case "${app_state}" in
378 | "none"|"stopped") message="No Music Playing" ;;
379 | esac
380 |
381 | case "${out}" in
382 | "raw")
383 | raw="${func[0]}:${song_info[${func[0]}]}"
384 | for function in "${func[@]:1}"; do
385 | raw="${raw},${function}:${song_info[${function}]}"
386 | done
387 | printf "%s\\n" "${raw}"
388 | ;;
389 |
390 | "json")
391 | printf "{\\n"
392 | for function in "${func[@]::${#func[@]} - 1}"; do
393 | printf " \"%s\": \"%s\",\\n" "${function}" "${song_info[${function}]}"
394 | done
395 |
396 | last="${func[*]:(-1):1}"
397 | printf " \"%s\": \"%s\"\\n" "${last}" "${song_info[${last}]}"
398 | printf "}\\n"
399 | ;;
400 |
401 | "string")
402 | if [[ "${str_format}" ]]; then
403 | printf "%s" "$(make_string "${str_format}")"
404 | else
405 | for function in "${func[@]}"; do
406 | printf "%s\\n" "${song_info[${function}]}"
407 | done
408 | fi
409 | ;;
410 |
411 | *)
412 | title="Now Playing"
413 |
414 | if [[ "${song_info[artist]}" ]]; then
415 | subtitle="${song_info[artist]}"
416 | [[ "${song_info[track]}" ]] && \
417 | subtitle+=" - ${song_info[track]}"
418 | elif [[ "${song_info[track]}" ]]; then
419 | subtitle="${song_info[track]}"
420 | fi
421 |
422 | message="${message:-${song_info[album]:+${song_info[album]}}}"
423 |
424 | notify
425 | esac
426 | }
427 |
428 | main "$@"
429 |
--------------------------------------------------------------------------------
/scripts/utils/android_debloat:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 |
4 | main()
5 | {
6 | infile="$1"
7 | pkgs=()
8 |
9 | while read -r package; do
10 | pkgs+=("${package}")
11 | done < "${infile}"
12 |
13 | for pkg in "${pkgs[@]}"; do
14 | adb shell pm uninstall -k --user 0 "${pkg}" > /dev/null 2>&1 && \
15 | printf "%s\\n" "${pkg}"
16 | done
17 | }
18 |
19 |
20 | main "$@"
21 |
--------------------------------------------------------------------------------
/scripts/utils/count_lines:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # shellcheck disable=SC2030,SC2031,SC2194
3 |
4 | get_full_path()
5 | (
6 | target="$1"
7 | filename="${target##*/}"
8 |
9 | [[ "${filename}" == "${target}" ]] && \
10 | target="./${target}"
11 | target="${target%/*}"
12 | cd "${target}" || exit
13 | full_path="${PWD}/${filename}"
14 |
15 | printf "%s" "${full_path}"
16 | )
17 |
18 | check_file()
19 | (
20 | [[ "${exclude[*]}" ]] && {
21 | for pattern in "${exclude[@]}"; do
22 | [[ $1 =~ ${pattern} ]] && \
23 | exit_code="true"
24 | done
25 | }
26 |
27 | [[ "${exit_code}" || ! -e "$1" || -d "$1" ]] && \
28 | exit_code="true"
29 |
30 | if [[ "${exit_code}" == "true" ]]; then
31 | return 1
32 | else
33 | return 0
34 | fi
35 | )
36 |
37 | _count_lines()
38 | (
39 | file_path="$1"
40 |
41 | if ((BASH_VERSINFO[0] < 4)); then
42 | while IFS=$'\n' read -r _line; do
43 | line+=("${_line}")
44 | done < "${file_path}"
45 | else
46 | mapfile -t line < "${file_path}"
47 | fi
48 |
49 | if [[ "${character}" == "true" ]]; then
50 | raw_file="$(< "${file_path}")"
51 | char_count="${#raw_file}"
52 | out="${char_count}"
53 | elif [[ "${word}" == "true" ]]; then
54 | IFS=" " read -ra words <<< "${line[@]}"
55 | word_count="${#words[@]}"
56 | out="${word_count}"
57 | else
58 | line_count="${#line[@]}"
59 | out="${line_count}"
60 | fi
61 |
62 | [[ "${display_full}" == "true" ]] && \
63 | file_path="$(get_full_path "${file_path}")"
64 |
65 | out+=",${file_path}"
66 |
67 | printf "%s\\n" "${out}"
68 | )
69 |
70 | reverse_array()
71 | (
72 | for i in "$@"; do
73 | temp_arr=("${i}" "${temp_arr[@]}")
74 | done
75 | printf "%s\\n" "${temp_arr[@]}"
76 | )
77 |
78 | _qsort()
79 | {
80 | (($# == 0)) && {
81 | unset qreturn
82 | return
83 | }
84 |
85 | local pivot="$1"; shift
86 | local i
87 | local -a higher
88 | local -a lower
89 |
90 | for i in "$@"; do
91 | if ((${i%%,*} < ${pivot%%,*})); then
92 | lower+=("$i")
93 | else
94 | higher+=("$i")
95 | fi
96 | done
97 |
98 | _qsort "${higher[@]}"
99 | higher=("${qreturn[@]}")
100 |
101 | _qsort "${lower[@]}"
102 | qreturn+=("${pivot}" "${higher[@]}")
103 | }
104 |
105 | qsort()
106 | (
107 | qreturn=()
108 | _qsort "$@"
109 | printf "%s\\n" "${qreturn[@]}"
110 | )
111 |
112 | print_padding()
113 | (
114 | arr=("$@")
115 |
116 | [[ "${sort}" == "true" ]] && {
117 | if ((BASH_VERSINFO[0] < 4)); then
118 | IFS=$'\n' read -d "" -ra arr < <(qsort "${arr[@]}")
119 | else
120 | mapfile -t arr < <(qsort "${arr[@]}")
121 | fi
122 | }
123 |
124 | [[ "${reverse}" == "true" ]] && \
125 | mapfile -t arr < <(reverse_array "${arr[@]}")
126 |
127 | [[ "${display_num}" ]] && \
128 | arr=("${arr[@]:0:${display_num}}")
129 |
130 | for i in "${arr[@]}"; do
131 | IFS=$'\n' read -d "" -r count name <<< "${i//,/$'\n'}"
132 |
133 | ((count >= ${max_count:=0})) && {
134 | max_count="${count}"
135 | max_filename="${name}"
136 | }
137 |
138 | ((padding = ${#count} >= ${padding:=0} ? ${#count} : padding))
139 |
140 | count_arr+=("${count}")
141 | name_arr+=("${name}")
142 | ((total_count+=count))
143 | done
144 |
145 | for ((i=0; i < ${#arr[@]}; i++)); do
146 | out+=("$(printf "%-${padding}s%s%s" "${count_arr[$i]}" "${sep:- }" "${name_arr[$i]}")")
147 | done
148 |
149 | printf "%s\\n" "${out[@]}"
150 |
151 | ((${#arr[@]} != 1)) && {
152 | [[ "${display_total}" == "true" ]] && \
153 | case "true" in
154 | "${character}") printf "\\n%s\\n" "Total no. of characters: ${total_count}" ;;
155 | "${word}") printf "\\n%s\\n" "Total no. of words: ${total_count}" ;;
156 | *) printf "\\n%s\\n" "Total no. of lines: ${total_count}" ;;
157 | esac
158 |
159 | [[ "${display_top}" == "true" ]] && {
160 | printf "%s\\n" "Longest file:"
161 | printf "%-4s%s\\n" "" "${max_filename}"
162 | case "true" in
163 | "${character}") printf "%-4s%s\\n" "" "${max_count} characters" ;;
164 | "${word}") printf "%-4s%s\\n" "" "${max_count} words" ;;
165 | *) printf "%-4s%s\\n" "" "${max_count} lines" ;;
166 | esac
167 | }
168 |
169 | printf "\\n"
170 | }
171 | )
172 |
173 | print_example()
174 | (
175 | less < <(printf "%s" "Showing number of lines in current directory:
176 | $ $0
177 | $ $0 .
178 | $ $0 ./*
179 |
180 | Show the number of lines in a directory:
181 | $ $0 /path/to/dir
182 | $ $0 /path/to/dir/*
183 |
184 | Show the number of lines in current directory recursively:
185 | $ $0 -rr
186 | $ $0 -rr .
187 |
188 | $ $0 --recursive
189 | $ $0 --recursive .
190 |
191 | Show the number of lines in a directory recursively:
192 | $ $0 -rr /path/to/dir
193 |
194 | If globstar is enabled (shopt -s globstar)
195 | Note: Bash will complain if there's too many files
196 | $ $0 /path/to/dir/**/*
197 |
198 | Show the number or lines sorted from shortest to longest
199 | $ $0 --sort
200 | $ $0 -ss
201 |
202 | Show the number of lines sorted from longest to shortest
203 | $ $0 -ss -r
204 | $ $0 -ss --reverse
205 |
206 | Show the top 5 shortest files
207 | $ $0 -ss -n 5
208 |
209 | Show the top 5 longest files
210 | $ $0 -ss -r -n 5
211 |
212 | Show the total number of lines
213 | $ $0 -t
214 | $ $0 --total
215 |
216 | Show details on the longest file
217 | $ $0 -tt
218 | $ $0 --top
219 |
220 | Show the total number of files and details on the longest file
221 | $ $0 -t -tt
222 | $ $0 --total --top
223 |
224 | Show the number of lines of files without \"foobar\" in the path name
225 | $ $0 --exclude \"foobar\"
226 | $ $0 -e \"foobar\"
227 |
228 | Show the number of lines of files without \"foo\", \"bar\" and \"baz\"
229 | $ $0 -e 'foo' 'bar' 'baz'
230 | $ $0 -e 'foo|bar|baz'
231 | ")
232 | )
233 |
234 | print_usage()
235 | (
236 | printf "%s\\n" "
237 | Usage: ${0##*/} -o --option --option \"VALUE\"
238 |
239 | Options:
240 |
241 | [-r|--reverse] Reverse the order of the list
242 | [-n|--number \"num\"] Show n amount of files
243 | [-t|--total] Show the total number of lines
244 | [-e|--exclude] Don't show any files containing
245 | this regex pattern
246 | [-f|--full-path] Show the file's full path instead
247 | of the relative path
248 | [-s|--seperator \"sep\"] Use character as a seperator
249 | between line count and file name
250 | [-c|--character] Count characters alongside lines
251 | [-w|--word] Count words alongside lines
252 |
253 | [-rr|--recursive] Include files from subfolders
254 | [-tt|--top] Show the longest file and lines
255 | [-ss|--sort] Sort by lowest to highest
256 |
257 | [-ee|--example] Show examples
258 | [-h|--help] Show this message
259 |
260 | This bash script will list the number of lines
261 | a file contains. If no arguments are passed, then
262 | it will use the files in the current directory.
263 | "
264 | )
265 |
266 | get_args()
267 | {
268 | while (($# > 0)); do
269 | case "$1" in
270 | "-r"|"--reverse") reverse="true" ;;
271 | "-n"|"--number") display_num="$2"; shift ;;
272 | "-t"|"--total") display_total="true" ;;
273 | "-f"|"--full-path") display_full="true" ;;
274 | "-e"|"--exclude")
275 | e_flag="true"
276 | shift
277 | for i in "$@"; do
278 | case "$1" in
279 | "-"*) break ;;
280 | *) exclude+=("$1"); shift ;;
281 | esac
282 | done
283 | ;;
284 |
285 | "-s"|"--seperator") sep=" $2 "; shift ;;
286 | "-c"|"--character") character="true" ;;
287 | "-w"|"--word") word="true" ;;
288 | "-rr"|"--recursive") recursive="true" ;;
289 | "-tt"|"--top") display_top="true" ;;
290 | "-ss"|"--sort") sort="true" ;;
291 | "-ee"|"--example") print_example; exit ;;
292 | "-h"|"--help") print_usage; exit ;;
293 | *)
294 | [[ -e "$1" ]] && \
295 | file_list+=("${1%/}")
296 | ;;
297 | esac
298 |
299 | if [[ "${e_flag}" == "true" ]]; then
300 | e_flag="false"
301 | else
302 | shift
303 | fi
304 | done
305 |
306 | [[ ! "${file_list[*]}" || -d "${file_list[*]}" ]] && {
307 | if [[ "${recursive}" == "true" ]]; then
308 | shopt -s globstar
309 | file_list=("${file_list[*]:-.}"/**/*)
310 | shopt -u globstar
311 | else
312 | file_list=("${file_list[*]:-.}"/*)
313 | fi
314 | }
315 | }
316 |
317 | main()
318 | (
319 | get_args "$@"
320 |
321 | for i in "${file_list[@]}"; do
322 | check_file "$i" && \
323 | output+=("$(_count_lines "$i")")
324 | done
325 |
326 | [[ "${output[*]}" ]] && \
327 | print_padding "${output[@]}"
328 | )
329 |
330 | main "$@"
331 |
--------------------------------------------------------------------------------
/scripts/utils/feh-wal:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | main()
4 | {
5 | dir="${1:-/usr/share/wal}"
6 |
7 | shopt -s globstar nocaseglob
8 | for i in "${dir}/"**/*.{jpg,png}; do
9 | file_list+=("$i")
10 | done
11 | shopt -u globstar nocaseglob
12 |
13 | [[ "${file_list[*]}" ]] && \
14 | feh --bg-fill "${file_list[$((RANDOM % ${#file_list[@]}))]}"
15 | }
16 |
17 | main "$@"
18 |
--------------------------------------------------------------------------------
/scripts/utils/iommu:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 |
4 | main()
5 | {
6 | curr_group=""
7 | while read -r group line; do
8 | [[ "${curr_group}" != "${group}" ]] && {
9 | curr_group="${group}"
10 | printf "IOMMU Group %02d:\\n" "${curr_group}"
11 | }
12 | printf "\t%s\\n" "${line}"
13 | done < <(
14 | shopt -s nullglob
15 | for i in /sys/kernel/iommu_groups/*/devices/*; do
16 | (
17 | IFS='/' read -r _ _ _ _ group _ pci_id <<< "$i"
18 | printf "%d %s\\n" "${group}" "$(lspci -nns "${pci_id}")"
19 | ) &
20 | done | sort --numeric-sort
21 | shopt -u nullglob
22 | wait
23 | )
24 | }
25 |
26 |
27 | main
28 |
--------------------------------------------------------------------------------
/scripts/utils/nvidia_toggle:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 |
4 | check_app()
5 | {
6 | check()
7 | {
8 | ! type -p "$1" > /dev/null 2>&1 && {
9 | printf "'%s' is not installed\\n" "$1"
10 | printf "Exitting...\\n"
11 | exit 2
12 | }
13 | }
14 |
15 | check lspci
16 | check rmmod
17 | check modprobe
18 | }
19 |
20 |
21 | check_root()
22 | {
23 | ((EUID != 0)) && {
24 | printf "Not running as root\\n" >&2
25 | printf "Exitting...\\n" >&2
26 | exit 1
27 | }
28 | }
29 |
30 |
31 | get_gpu_id()
32 | {
33 | while read -r line; do
34 | [[ "${line}" =~ (VGA).*(NVIDIA) ]] && {
35 | read -r slot _ <<< "${line}"
36 | break
37 | }
38 | done < <(lspci -mm)
39 |
40 | [[ "$(lspci -nns "${slot}")" =~ \[([a-z0-9]{4}:[a-z0-9]{4})\] ]]
41 | printf "%s" "${BASH_REMATCH[1]}"
42 | }
43 |
44 |
45 | get_gpu_driver()
46 | {
47 | while read -r line; do
48 | [[ "${line}" == *"driver"* ]] && {
49 | driver="${line}"
50 | driver="${driver##*: }"
51 | driver="${driver//-/_}"
52 | break
53 | }
54 | done < <(lspci -kd "$1")
55 |
56 | printf "%s" "${driver}"
57 | }
58 |
59 |
60 | main()
61 | {
62 | check_app
63 | check_root
64 | target="$1"
65 | id="$(get_gpu_id)"
66 | driver="$(get_gpu_driver "${id}")"
67 |
68 | [[ "${target}" ]] && \
69 | [[ "${target}" == "${driver}" ]] && {
70 | printf "Already using \"%s\"\\n" "${driver}"
71 | exit 0
72 | }
73 |
74 | case "${driver}" in
75 | "vfio"*)
76 | printf "vfio_pci => nvidia\\n"
77 | rmmod vfio_pci && modprobe nvidia
78 | ;;
79 |
80 | "nvidia")
81 | printf "nvidia => vfio_pci\\n"
82 | modules=("nvidia")
83 | grep --quiet --no-messages -E "nvidia_uvm" /proc/modules && \
84 | modules=("nvidia_uvm" "${modules[@]}")
85 | rmmod "${modules[@]}" && modprobe vfio_pci
86 | ;;
87 | esac
88 | }
89 |
90 | main "$@"
91 |
--------------------------------------------------------------------------------
/scripts/utils/open_iterm2:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Detect MacOS
4 | [[ "${OSTYPE:-$(uname -s)}" =~ (D|d)arwin ]] && {
5 | # Detects if iTerm2 is running
6 | if ! pgrep -f "iTerm" > /dev/null 2>&1; then
7 | open -a "/Applications/iTerm.app"
8 | else
9 | # Create a new window
10 | script='tell application "iTerm2" to create window with default profile'
11 | ! osascript -e "${script}" > /dev/null 2>&1 && {
12 | # Get pids for any app with "iTerm" and kill
13 | while IFS="" read -r pid; do
14 | kill -15 "${pid}"
15 | done < <(pgrep -f "iTerm")
16 | open -a "/Applications/iTerm.app"
17 | }
18 | fi
19 | }
20 |
--------------------------------------------------------------------------------
/scripts/utils/ozbargain-cli:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # shellcheck disable=SC2048,SC2086,SC2016,SC2154,SC2034
3 |
4 | check_apps()
5 | {
6 | if ! type -p curl > /dev/null 2>&1; then
7 | err "Curl is not installed"
8 | fi
9 | }
10 |
11 | init_colors()
12 | {
13 | faint=$'\e[2m'
14 | bold=$'\e[1m'
15 | reset=$'\e[0m'
16 |
17 | for i in {0..7}; do
18 | printf -v "f[$i]" "%s" $'\e[3'"$i"'m'
19 | printf -v "b[$i]" "%s" $'\e[4'"$i"'m'
20 | printf -v "fb[$i]" "%s" $'\e[1m\e[3'"$i"'m'
21 | printf -v "bb[$i]" "%s" $'\e[1m\e[4'"$i"'m'
22 | done
23 | }
24 |
25 | trim()
26 | {
27 | [[ "$*" ]] && {
28 | set -f
29 | set -- $*
30 | printf "%s" "$*"
31 | set +f
32 | }
33 | }
34 |
35 | return_match()
36 | {
37 | local regex="$1"
38 | local i="-1"
39 | local -a words
40 | read -ra words <<< "$2"
41 |
42 | while ((++i < ${#words[@]})); do
43 | [[ "${words[$i]}" =~ ${regex} ]] && \
44 | printf "%s\\n" "${BASH_REMATCH[0]}"
45 | shift
46 | done
47 | }
48 |
49 | strip_tag()
50 | {
51 | str="$1"
52 | str="${str#*>}"
53 | str="${str%<*}"
54 | printf "%s" "${str}"
55 | }
56 |
57 | replace_symbols()
58 | {
59 | str="$1"
60 |
61 | while [[ "${str}" != "${_str}" ]]; do
62 | _str="${str}"
63 | case "${_str}" in
64 | *"""*) str="${str//'"'/\"}" ;;
65 | *"&"*) str="${str//'&'/\&}" ;;
66 | *""[0-9][0-9][0-9]";"*)
67 | while read -r match; do
68 | replace="${match/''}"
69 | replace="${replace/';'}"
70 | replace="${replace#"${replace%%[!0]*}"}"
71 | str="${str//${match}/$(printf "\x%x" "${replace}")}"
72 | done < <(return_match "[0-9][0-9][0-9];" "${str}")
73 | ;;
74 | esac
75 | done
76 | printf "%s" "${str}"
77 | }
78 |
79 | err()
80 | {
81 | printf "Error: %s\\n" "$*" >&2
82 | }
83 |
84 | format_title()
85 | {
86 | local title="$1"
87 | local regex='\$([0-9]+((,[0-9]+)+)?(.[0-9][0-9])?)'
88 |
89 | [[ "${title}" =~ ${regex} ]] && \
90 | while read -r match; do
91 | title="${title/${match}/${fb[2]}${match}${reset}${bold}}"
92 | done < <(return_match "${regex}" "${title}")
93 |
94 | printf "%s" "${title}"
95 | }
96 |
97 | display_deal()
98 | {
99 | url="https://www.ozbargain.com.au"
100 | printf "%s\\r" "Loading deals from ${url}/$1..."
101 |
102 | raw_xml="$(curl -L "${url}/$1/feed" 2> /dev/null)"
103 | [[ "${raw_xml}" =~ '404 Not Found' ]] && {
104 | printf "\\e[2K"
105 | err "$1: 404 Not Found"
106 | return
107 | }
108 |
109 | mapfile -t xml < <(printf "%s" "${raw_xml}")
110 |
111 | count="1"
112 | i="0"
113 | while ((i < ${#xml[@]} && count <= ${num_show:=10})); do
114 | [[ "${xml[$i]}" =~ "- " ]] && {
115 | until [[ "${xml[$i]}" == "
" ]]; do
116 | case "${xml[$i]}" in
117 | *""*)
118 | title="$(strip_tag "${xml[$i]}")"
119 | title="$(replace_symbols "${title}")"
120 | title="$(trim "${title}")"
121 | ;;
122 |
123 | *""*) page_link="$(strip_tag "${xml[$i]}")" ;;
124 |
125 | *""*) date_posted="$(strip_tag "${xml[$i]}")" ;;
142 | *""*) author="$(strip_tag "${xml[$i]}")" ;;
143 | esac
144 | ((i++))
145 | done
146 |
147 | line_1="${bold}$((count++)). $(format_title "${title}")"
148 |
149 | line_2="Posted By ${fb[4]}${author}${reset}"
150 | line_2="${line_2} on ${fb[4]}${date_posted}${reset}"
151 | line_2="${line_2} [${f[2]}${votes_pos}↑${reset}|${f[1]}${votes_neg}↓${reset}]"
152 | line_2="${line_2} ${faint}- ${clicks} Clicks - ${num_comments} Comments${reset}"
153 |
154 | [[ "${expiry}" ]] && \
155 | line_3="Expires on ${fb[4]}${expiry}${reset}"
156 |
157 | printf "\\e[2K"
158 | for line in "${line_1}" "${line_2}" "${line_3}"; do
159 | [[ "${line}" ]] && \
160 | printf "%s\\n" "${line}"
161 | done
162 |
163 | printf "\\n"
164 | printf " - %s\\n" "${deal_link}" "${page_link}"
165 | printf "\\n"
166 |
167 | unset title
168 | unset page_link
169 | unset num_comments
170 | unset clicks
171 | unset expiry
172 | unset votes_pos
173 | unset votes_neg
174 | unset deal_link
175 |
176 | unset line_1
177 | unset line_2
178 | unset line_3
179 | }
180 | ((i++))
181 | done
182 | }
183 |
184 | show_usage()
185 | {
186 | printf "%s\\n" "
187 | Usage: ${0##*/} -o option --option \"value\"
188 |
189 | Options:
190 |
191 | [-t|--tag \"name\"] Search for tags
192 | [-c|--category \"name\"] Search for categories
193 | [-n|--count \"num\"] Show \"num\" amount
194 | [-h|--help] Show this message
195 | "
196 | }
197 |
198 | get_args()
199 | {
200 | (($# == 0)) && {
201 | err "No arguments passed"
202 | exit 1
203 | }
204 |
205 | while (($# > 0)); do
206 | case "$1" in
207 | "tag/"*) tags+=("${1//'tag/'}") ;;
208 | "cat/"*) categories+=("${1//'cat/'}") ;;
209 | "-t"|"--tag") [[ "$2" ]] && { tags+=("$2"); shift; } ;;
210 | "-c"|"--category") [[ "$2" ]] && { categories+=("$2"); shift; } ;;
211 | "-n"|"--count") [[ $2 ]] && (($2 > 0)) && { num_show="$2"; shift; } ;;
212 | "-h"|"--help") show_usage; exit ;;
213 | *) err "Unknown Argument: $1"; exit 1 ;;
214 | esac
215 | shift
216 | done
217 | }
218 |
219 | main()
220 | {
221 | init_colors
222 | get_args "$@"
223 |
224 | for tag in "${tags[@]}"; do
225 | display_deal "tag/${tag}"
226 | done
227 |
228 | for category in "${categories[@]}"; do
229 | display_deal "cat/${category}"
230 | done
231 | }
232 |
233 | check_apps && main "$@"
234 |
--------------------------------------------------------------------------------
/scripts/utils/update-git-repos:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env -S python3 -B
2 | # vim: syntax=python
3 | # pylint: disable=invalid-name
4 |
5 | """ Performs a git pull on a folder of git repositories """
6 |
7 | from abc import ABC, abstractmethod
8 | from os import chdir, devnull
9 | from pathlib import Path
10 | from re import findall
11 | from shutil import get_terminal_size
12 | from subprocess import call, PIPE, run
13 | from sys import argv
14 | from typing import List, Tuple, Callable
15 |
16 |
17 | class Git(ABC):
18 | """ Abstract Git class """
19 |
20 | @staticmethod
21 | def get_runner():
22 | """
23 | Constructs an instance depending on the version of git installed
24 | """
25 | def check(i):
26 | return i["major"] == 1 and i["minor"] == 8 and i["patch"] < 5
27 |
28 | cmd = ["git", "--version"]
29 | keys = ["major", "minor", "patch"]
30 | vals = [int(i) for i in findall(r"\d+", run_cmd(cmd)[1])]
31 | version = dict(zip(keys, vals))
32 | return GitRunnerOld() if check(version) else GitRunnerNew()
33 |
34 | def is_repo(self, path: Path) -> bool:
35 | """ Checks if path is a git repository """
36 | def check(p):
37 | return p.exists() and p.is_dir()
38 | return (check(Path("{}/.git".format(path))) or
39 | len(self.rev_parse(path, ["--git-dir"]).split("\n")) > 0)
40 |
41 | @abstractmethod
42 | def fetch(self, path: Path) -> int:
43 | """ Abstract fetch method """
44 |
45 | @abstractmethod
46 | def pull(self, path: Path) -> int:
47 | """ Abstract pull method """
48 |
49 | @abstractmethod
50 | def rev_parse(self, path: Path, args: List[str]) -> str:
51 | """ Abstract rev_parse method """
52 |
53 |
54 | class GitRunnerNew(Git):
55 | """ Git class that uses a newer version of git """
56 |
57 | def fetch(self, path: Path) -> int:
58 | return call(["git", "-C", path, "fetch", "--quiet"])
59 |
60 | def pull(self, path: Path) -> int:
61 | return call(["git", "-C", path, "pull"])
62 |
63 | def rev_parse(self, path: Path, args: List[str]) -> str:
64 | return run_cmd(["git", "-C", str(path), "rev-parse"] + args)[1]
65 |
66 |
67 | class GitRunnerOld(Git):
68 | """ Git class that uses an older version of git """
69 |
70 | @staticmethod
71 | def _execute_in_dir(path: Path, func: Callable, *args, **kwargs):
72 | prev_cwd = Path.cwd()
73 | try:
74 | chdir(str(path))
75 | return func(*args, **kwargs)
76 | except NotADirectoryError:
77 | pass
78 | finally:
79 | chdir(str(prev_cwd))
80 |
81 | def fetch(self, path: Path) -> int:
82 | cmd = ["git", "fetch", "--quiet"]
83 | return GitRunnerOld._execute_in_dir(path, call, cmd)
84 |
85 | def pull(self, path: Path) -> int:
86 | cmd = ["git", "pull"]
87 | return GitRunnerOld._execute_in_dir(path, call, cmd)
88 |
89 | def rev_parse(self, path: Path, args: List[str]) -> str:
90 | cmd = ["git", "rev-parse"] + args
91 | ret = GitRunnerOld._execute_in_dir(path, run_cmd, cmd)
92 | return ret[1] if ret else None
93 |
94 |
95 | def run_cmd(cmd: List[str]) -> Tuple[int, str]:
96 | """ Executes a command """
97 | with open(devnull, "w") as err:
98 | out = PIPE
99 | process = run(cmd, stdout=out, stderr=err,
100 | check=False)
101 | return process.returncode, process.stdout.decode("utf-8").strip()
102 |
103 |
104 | def main():
105 | """ Main function """
106 | repos = dict()
107 | git = Git.get_runner()
108 |
109 | paths = argv[1:] if argv[1:] else ["."]
110 |
111 | for i in paths:
112 | for j in Path(i).glob("*"):
113 | repo_path = git.rev_parse(j, ["--show-toplevel"])
114 | if repo_path:
115 | if repo_path in repos:
116 | break
117 | if git.is_repo(j):
118 | repos[repo_path] = "1"
119 |
120 | repos = sorted(repos.keys())
121 |
122 | for i in repos:
123 | cols, _ = get_terminal_size(fallback=(80, 0))
124 |
125 | print("Updating {}... ".format(i), end="", flush=True)
126 |
127 | git.fetch(i)
128 | local_ref = git.rev_parse(i, ["HEAD"])
129 | remote_ref = git.rev_parse(i, ["@{u}"])
130 |
131 | if not remote_ref or local_ref == remote_ref:
132 | print("Already up to date.")
133 | else:
134 | print("\n{}".format("=" * cols))
135 | git.pull(i)
136 | print("{}".format("=" * cols))
137 |
138 |
139 | if __name__ == "__main__":
140 | main()
141 |
--------------------------------------------------------------------------------
/scripts/utils/vim-plugins:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # shellcheck disable=SC2048,SC2086
3 |
4 | trim_string()
5 | {
6 | str="$1"
7 | str="${str#"${str%%[![:space:]]*}"}"
8 | str="${str%"${str##*[![:space:]]}"}"
9 | printf "%s" "${str}"
10 | }
11 |
12 | trim()
13 | {
14 | [[ "$*" ]] && {
15 | set -f
16 | set -- $*
17 | printf "%s" "$*"
18 | set +f
19 | }
20 | }
21 |
22 | err()
23 | {
24 | >&2 printf "\\e[31m%s\\e[0m%s\\n" "Error" ": $*"
25 | }
26 |
27 | get_vimrc()
28 | {
29 | [[ "${vimrc_file}" ]] && \
30 | return 0
31 |
32 | count="0"
33 |
34 | while [[ ! "${vimrc_file}" ]] && ((++count < ${#vim_location[@]})); do
35 | [[ -f "${vim_location[${count}]}" ]] && \
36 | vimrc_file="${vim_location[${count}]}"
37 | done
38 | }
39 |
40 | get_plugin_manager()
41 | {
42 | [[ ! "${vimrc_file}" ]] && \
43 | return 1
44 |
45 | mapfile -t vimrc_contents < "${vimrc_file}"
46 | [[ "${plugin_managers[*]}" ]] && \
47 | return 0
48 |
49 | count="0"
50 |
51 | while ((++count < ${#vimrc_contents[@]})); do
52 | line="${vimrc_contents[${count}]}"
53 | [[ ! "${line}" =~ ^\" ]] && \
54 | case "${vimrc_contents[${count}]}" in
55 | *"pathogen#infect"*) plugin_managers+=("pathogen") ;;
56 | *"plug#begin"*) plugin_managers+=("plug") ;;
57 | *"vundle#begin"*) plugin_managers+=("vundle") ;;
58 | *"neobundle#begin"*) plugin_managers+=("neobundle") ;;
59 | esac
60 | done
61 | }
62 |
63 | get_plugins()
64 | {
65 | [[ ! "${plugin_managers[*]}" \
66 | || ! "${vimrc_contents[*]}" \
67 | || ! "${vimrc_file}" ]] && \
68 | return 1
69 |
70 | for i in "${plugin_managers[@]}"; do
71 | case "${i,,}" in
72 | "pathogen")
73 | count="-1"
74 |
75 | while [[ ! "${pathogen_dir}" ]] && \
76 | ((++count < ${#vimrc_contents[@]})); do
77 | line="${vimrc_contents[${count}]}"
78 | [[ "${line}" =~ ^runtime && "${line}" =~ pathogen ]] && {
79 | pathogen_dir="${line//runtime }"
80 | pathogen_dir="${vimrc_file%/*}/${pathogen_dir%%/*}"
81 | }
82 | done
83 |
84 | if [[ -d "${pathogen_dir}" ]]; then
85 | for plugin_path in "${pathogen_dir}"/*; do
86 | plugin_name="${plugin_path##"${pathogen_dir}/"}"
87 | plugin_name="${plugin_name/.vim}"
88 | plugin_author="$(get_repo_author "${plugin_path}")"
89 | [[ "${plugin_name}" ]] && {
90 | temp="${plugin_name}"
91 | temp+=",${plugin_author:-Unknown}"
92 | temp+=",Pathogen"
93 | plugins+=("${temp}")
94 | }
95 | done
96 | else
97 | err "Pathogen directory \"${pathogen_dir}\" does not exist"
98 | fi
99 | ;;
100 |
101 | "plug")
102 | count="-1"
103 | unset start
104 | unset end
105 |
106 | while [[ ! "${start}" || ! "${end}" ]] && \
107 | ((++count < ${#vimrc_contents[@]})); do
108 | line="${vimrc_contents[${count}]}"
109 | [[ ! "${line}" =~ ^\" ]] && \
110 | case "${line}" in
111 | *"plug#begin"*) start="${count}" ;;
112 | *"plug#end"*) end="${count}" ;;
113 | esac
114 | done
115 |
116 | diff="$((end - start))"
117 | for line in "${vimrc_contents[@]:${start}:${diff}}"; do
118 | [[ "${line}" =~ ^Plug ]] && \
119 | if [[ "${line}" == *"|"* ]]; then
120 | IFS=$'\n' read -d "" -ra multi_plug \
121 | <<< "${line//"|"/$'\n'}"
122 | for plug in "${multi_plug[@]}"; do
123 | temp="$(process_plug "${plug}")"
124 | temp+=",Vim-Plug"
125 | plugins+=("${temp}")
126 | done
127 | else
128 | temp="$(process_plug "${line}")"
129 | temp+=",Vim-Plug"
130 | plugins+=("${temp}")
131 | fi
132 | done
133 | ;;
134 |
135 | "vundle")
136 | count="-1"
137 | unset start
138 | unset end
139 |
140 | while [[ ! "${start}" || ! "${end}" ]] && \
141 | ((++count < ${#vimrc_contents[@]})); do
142 | line="${vimrc_contents[${count}]}"
143 | [[ ! "${line}" =~ ^\" ]] && \
144 | case "${line}" in
145 | *"vundle#begin"*) start="${count}" ;;
146 | *"vundle#end"*) end="${count}" ;;
147 | esac
148 | done
149 |
150 | diff="$((end - start))"
151 | for line in "${vimrc_contents[@]:${start}:${diff}}"; do
152 | [[ "${line}" =~ ^Plugin ]] && {
153 | temp="$(process_plug "${line}")"
154 | temp+=",Vundle"
155 | plugins+=("${temp}")
156 | }
157 | done
158 | ;;
159 |
160 | "neobundle")
161 | count="-1"
162 | unset start
163 | unset end
164 |
165 | while [[ ! "${start}" || ! "${end}" ]] && \
166 | ((++count < ${#vimrc_contents[@]})); do
167 | line="${vimrc_contents[${count}]}"
168 | [[ ! "${line}" =~ ^\" ]] && \
169 | case "${line}" in
170 | *"neobundle#begin"*) start="${count}" ;;
171 | *"neobundle#end"*) end="${count}" ;;
172 | esac
173 | done
174 |
175 | diff="$((end - start))"
176 | for line in "${vimrc_contents[@]:${start}:${diff}}"; do
177 | [[ "${line}" =~ ^NeoBundle ]] && \
178 | plugins+=("$(process_plug "${line}"),NeoBundle")
179 | done
180 | ;;
181 | esac
182 | done
183 | }
184 |
185 | get_repo_author()
186 | {
187 | { [[ -d "$1/.git" ]] || git -C "$1" rev-parse --git-dir > /dev/null 2>&1; } && {
188 | mapfile -t first_commit < <(git -C "$1" rev-list --max-parents=0 HEAD)
189 | author="$(git -C "$1" --no-pager log --format=format:%an "${first_commit[0]}")"
190 | printf "%s" "${author}"
191 | }
192 | }
193 |
194 | process_plug()
195 | {
196 | plugin="$1"
197 | plugin="${plugin#* }"
198 | plugin="${plugin/"Plug "}"
199 | plugin="${plugin%%,*}"
200 | plugin="${plugin//\'}"
201 | plugin="${plugin/"https://github.com/"}"
202 | plugin="${plugin/".git"}"
203 | plugin_name="$(trim_string "${plugin##*/}")"
204 | plugin_author="$(trim_string "${plugin%%/*}")"
205 |
206 | if [[ "${plugin_author}" =~ ^\~ ]]; then
207 | plugin_name="${plugin}"
208 | plugin_author="Unmanaged"
209 | elif [[ "${plugin_author}" =~ (git|file): ]]; then
210 | plugin_author="Unmanaged"
211 | fi
212 |
213 | [[ "${plugin_name}" ]] && \
214 | printf "%s" "${plugin_name},${plugin_author:-Unknown}"
215 | }
216 |
217 | print_plugins()
218 | {
219 | [[ ! "${plugins[*]}" ]] && \
220 | return 1
221 |
222 | plugins=("Plugin Name,Author,Manager" "${plugins[@]}")
223 |
224 | for i in "${plugins[@]}"; do
225 | IFS=$'\n' read -d "" -r name author manager <<< "${i//,/$'\n'}"
226 |
227 | ((name_padding = ${#name} >= ${name_padding:=0} ? ${#name} : name_padding))
228 | ((manager_padding = ${#manager} >= ${manager_padding:=0} ? ${#manager} : manager_padding))
229 | ((author_padding = ${#author} >= ${author_padding:=0} ? ${#author} : author_padding))
230 |
231 | name_arr+=("${name}")
232 | manager_arr+=("${manager}")
233 | author_arr+=("${author}")
234 | done
235 |
236 | for ((i = 0; i < ${#plugins[@]}; i++)); do
237 | printf -v "col_1" "%-${name_padding}s %s" "${name_arr[$i]}" "|"
238 | printf -v "col_2" "%-${manager_padding}s %s" "${manager_arr[$i]}" "|"
239 | printf -v "col_3" "%-${author_padding}s" "${author_arr[$i]}"
240 | out[$i]="${col_1} ${col_2} ${col_3}"
241 | done
242 |
243 | max_line="${#out[0]}"
244 |
245 | eval printf -v line "%0.s=" "{1..${max_line}}"
246 | printf "%s\\n" "${line}" "${out[0]}" "${line}"
247 | printf "%s\\n" "${out[@]:1}"
248 | }
249 |
250 | show_usage()
251 | {
252 | printf "%s\\n" "
253 | Usage: ${0##*/} -o option --option \"value\"
254 |
255 | Options:
256 |
257 | [-u|--vimrc \"/path/to/vimrc\"] Use a user specified vimrc
258 | [-p|--plugin-manager \"name\"] Show plugins used by a plugin manager
259 | [-h|--help] Show this message
260 |
261 | Supported managers:
262 | - pathogen
263 | - plug
264 | - vundle
265 | - neobundle
266 | "
267 | printf "%s\\n" " Checking these locations for vimrc file:"
268 | for file in "${vim_location[@]}"; do
269 | printf "%s\\n" " - ${file}"
270 | done
271 | printf "\\n"
272 | }
273 |
274 | get_args()
275 | {
276 | while (($# > 0)); do
277 | case "$1" in
278 | "-u"|"--vimrc") vimrc_file="$2"; shift ;;
279 | "-p"|"--plugin-manager") plugin_managers+=("$2"); shift ;;
280 | "-h"|"--help") show_usage; exit 0 ;;
281 | esac
282 | shift
283 | done
284 |
285 | [[ "${vimrc_file}" && ! -f "${vimrc_file}" ]] && {
286 | err "Selected vimrc file \"${vimrc_file}\" is not valid"
287 | exit 1
288 | }
289 | }
290 |
291 | main()
292 | {
293 | vim_location=(
294 | "${HOME}/.vimrc"
295 | "${HOME}/.vim/vimrc"
296 | )
297 |
298 | get_args "$@"
299 | get_vimrc
300 | get_plugin_manager
301 | get_plugins
302 | print_plugins
303 | }
304 |
305 | main "$@"
306 |
--------------------------------------------------------------------------------
/scripts/utils/wal:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | : "${wal_path:=/usr/share/wal}"
4 | : "${recursive:=true}"
5 |
6 | get_full_path()
7 | (
8 | target="$1"
9 |
10 | [[ -f "${target}" ]] && {
11 | filename="${target##*/}"
12 | [[ "${filename}" == "${target}" ]] && \
13 | target="./${target}"
14 | target="${target%/*}"
15 | }
16 |
17 | cd "${target}" || exit
18 | full_path="${PWD}"
19 |
20 | printf "%s" "${full_path%/}"
21 | )
22 |
23 | check_img()
24 | {
25 | ext="${1##*.}"
26 | if [[ ! -d "$1" && "${ext,,}" =~ ^(jpg|png)$ ]]; then
27 | return 0
28 | else
29 | return 1
30 | fi
31 | }
32 |
33 | get_file_list()
34 | {
35 | dir="$1"
36 | if [[ -f "${dir}" ]] && check_img "${dir}"; then
37 | printf "%s\\n" "${dir}"
38 | elif [[ -d "${dir}" ]]; then
39 | if [[ "${recursive}" == "true" ]]; then
40 | shopt -s globstar
41 | for i in "${dir}"/**/*; do
42 | check_img "$i" && \
43 | list+=("$i")
44 | done
45 | shopt -u globstar
46 | else
47 | for i in "${dir}"/*/*; do
48 | check_img "$i" && \
49 | list+=("$i")
50 | done
51 | fi
52 | fi
53 |
54 | printf "%s\\n" "${list[@]}"
55 | }
56 |
57 | get_last_wal()
58 | {
59 | mapfile -t feh_file < "${HOME}/.fehbg"
60 | read -r _ _ last_wal <<< "${feh_file[1]}"
61 | last_wal="${last_wal//\'}"
62 | printf "%s" "${last_wal}"
63 | }
64 |
65 | print_usage()
66 | {
67 | printf "%s\\n" "
68 | Usage: ${0##*/} -o --option --option \"value\"
69 |
70 | Options:
71 |
72 | [-i|--image \"path\"] Image or directory for wallpaper
73 | [-r|--recursive] Search the image directory recursively
74 | [-h|--help] Show this message
75 |
76 | Settings:
77 |
78 | wal_path: ${wal_path}
79 | recursive: ${recursive}
80 | "
81 | }
82 |
83 | get_args()
84 | {
85 | while (($# > 0)); do
86 | case "$1" in
87 | "-i"|"--image") wal_path="$(get_full_path "${2%/}")"; shift ;;
88 | "-r"|"--recursive") recursive="true" ;;
89 | "-h"|"--help") print_usage; exit ;;
90 | esac
91 | shift
92 | done
93 | }
94 |
95 | main()
96 | {
97 | get_args "$@"
98 |
99 | ! type -p feh > /dev/null 2>&1 && \
100 | exit 1
101 |
102 | mapfile -t file_list < <(get_file_list "${wal_path}")
103 |
104 | [[ -f "${HOME}/.fehbg" ]] && \
105 | last_wal="$(get_last_wal)"
106 |
107 | until [[ "${img}" && "${img}" != "${last_wal}" ]]; do
108 | index="$((RANDOM % ${#file_list[@]}))"
109 | img="${file_list[${index}]}"
110 | done
111 |
112 | feh --bg-fill "${img}"
113 | }
114 |
115 | main "$@"
116 |
--------------------------------------------------------------------------------
/scripts/utils/xfce-wal:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # shellcheck disable=SC2030,SC2031
3 |
4 | : "${wal_path:=/usr/share/wal}"
5 | : "${all_monitors:=true}"
6 | : "${recursive:=true}"
7 |
8 | get_full_path()
9 | (
10 | target="$1"
11 |
12 | [[ -f "${target}" ]] && {
13 | filename="${target##*/}"
14 | [[ "${filename}" == "${target}" ]] && \
15 | target="./${target}"
16 | target="${target%/*}"
17 | }
18 |
19 | cd "${target}" || exit
20 | full_path="${PWD}"
21 |
22 | printf "%s" "${full_path%/}"
23 | )
24 |
25 | monitor_count()
26 | (
27 | type -p xrandr > /dev/null && {
28 | awk '/\yconnected\y/ {
29 | sum += 1
30 | }
31 | END {
32 | printf "%s", sum
33 | }' <(xrandr --query)
34 | }
35 | )
36 |
37 | list_monitors()
38 | (
39 | type -p xrandr > /dev/null && {
40 | awk 'BEGIN { count = 0 }
41 | /\yconnected\y/ {
42 | printf "%s%s%s %s\n", "Monitor", count, ":", $0
43 | count++
44 | }' <(xrandr --query)
45 | }
46 | )
47 |
48 | check_img()
49 | (
50 | ext="${1##*.}"
51 | if [[ ! -d "$1" && "${ext,,}" =~ ^(jpg|png)$ ]]; then
52 | return 0
53 | else
54 | return 1
55 | fi
56 | )
57 |
58 | get_file_list()
59 | (
60 | dir="$1"
61 | if [[ -f "${dir}" ]] && check_img "${dir}"; then
62 | printf "%s\\n" "${dir}"
63 | elif [[ -d "${dir}" ]]; then
64 | if [[ "${recursive}" == "true" ]]; then
65 | shopt -s globstar
66 | for i in "${dir}"/**/*; do
67 | check_img "$i" && \
68 | list+=("$i")
69 | done
70 | shopt -u globstar
71 | else
72 | for i in "${dir}"/*/*; do
73 | check_img "$i" && \
74 | list+=("$i")
75 | done
76 | fi
77 |
78 | printf "%s\\n" "${list[@]}"
79 | fi
80 | )
81 |
82 | rand()
83 | (
84 | printf "%s" "$((RANDOM % $1))"
85 | )
86 |
87 | change_wal()
88 | (
89 | img="$1"
90 | monitor="${2:-0}"
91 | property="/backdrop/screen0/monitor${monitor}/workspace0/last-image"
92 | pid="$(pgrep -x xfce4-session)"
93 |
94 | IFS="=" \
95 | read -rd '' _ dbus_session \
96 | < <(grep -z DBUS_SESSION_BUS_ADDRESS "/proc/${pid}/environ")
97 | export DBUS_SESSION_BUS_ADDRESS="${dbus_session}"
98 |
99 | printf "%s\\n" "Changing monitor${monitor} wallpaper to \"${img}\""
100 | xfconf-query --channel xfce4-desktop \
101 | --property "${property}" \
102 | --set "${img}"
103 | )
104 |
105 | print_exit()
106 | {
107 | printf "%s\\n" "XFCE is not running" >&2
108 | exit 2
109 | }
110 |
111 | print_usage()
112 | (
113 | printf "%s\\n" "
114 | Usage: ${0##*/} -o --option --option \"value\"
115 |
116 | Options:
117 |
118 | [-i|--image \"path\"] Image or directory for wallpaper
119 | [-m|--monitor \"num\"] Index for the monitor to change
120 | [-a|--all] Change the wallpaper on all monitors
121 | [-s|--same-image] Use the same image for all monitors
122 | [-r|--recursive] Search the image directory recursively
123 | [-l|--list-monitors] List all the monitors available
124 | [-d|--dry] Run without changing wallpapers
125 | [-h|--help] Show this message
126 |
127 | Settings:
128 |
129 | wal_path: ${wal_path}
130 | all_monitors: ${all_monitors}
131 | recursive: ${recursive}
132 |
133 | This bash script will set a wallpaper for the Xfce4 desktop
134 | environment. Xrandr is required to detect the number of displays
135 | connected. Settings are within the script. If no arguments are
136 | are passed, then these settings will be used.
137 | "
138 | )
139 |
140 | get_args()
141 | {
142 | while (($# > 0)); do
143 | case "$1" in
144 | "-i"|"--image") wal_path="$(get_full_path "${2%/}")"; shift ;;
145 | "-m"|"--monitor") monitor="$2"; shift ;;
146 | "-a"|"--all") all_monitors="true" ;;
147 | "-s"|"--same-image") same="true" ;;
148 | "-r"|"--recursive") recursive="true" ;;
149 | "-l"|"--list-monitors") list_monitors; exit ;;
150 | "-d"|"--dry") dry="true" ;;
151 | "-h"|"--help") print_usage; exit ;;
152 | esac
153 | shift
154 | done
155 | }
156 |
157 | main()
158 | (
159 | get_args "$@"
160 |
161 | if [[ "${XDG_CURRENT_DESKTOP}" ]]; then
162 | [[ "${XDG_CURRENT_DESKTOP}" != "XFCE" ]] && \
163 | print_exit
164 | elif type -p xprop > /dev/null 2>&1; then
165 | [[ ! "$(xprop -root)" =~ XFCE|xfce ]] && \
166 | print_exit
167 | else
168 | ! type -p xfconf-query > /dev/null 2>&1 && \
169 | print_exit
170 | fi
171 |
172 | [[ ! -d "${HOME}/.last_wal" ]] && \
173 | mkdir -p "${HOME}/.last_wal"
174 |
175 | mapfile -t file_list < <(get_file_list "${wal_path}")
176 |
177 | if [[ "${all_monitors}" == "true" ]]; then
178 | num_monitors="$(monitor_count)"
179 | else
180 | num_monitors="$((monitor + 1))"
181 | fi
182 |
183 | _change_wal()
184 | (
185 | [[ -f "${HOME}/.last_wal/monitor${i}" ]] && \
186 | last_wal="$(< "${HOME}/.last_wal/monitor${i}")"
187 |
188 | [[ "${same}" != "true" ]] && \
189 | unset img
190 |
191 | until [[ "${img}" && "${img}" != "${last_wal}" ]]; do
192 | index="$(rand "${#file_list[@]}")"
193 | img="${file_list[${index}]}"
194 | done
195 |
196 | if [[ "${dry}" != "dry" ]]; then
197 | printf "%s" "${img}" > "${HOME}/.last_wal/monitor${i}"
198 | change_wal "${img}" "$i"
199 | else
200 | printf "Changing monitor%s to %s\\n" "$i" "${img}" >&2
201 | fi
202 | )
203 |
204 | [[ "${file_list[*]}" ]] && \
205 | for ((i = ${monitor:-0}; i < ${num_monitors:-1}; i++)); do
206 | _change_wal &
207 | done
208 | )
209 |
210 | main "$@"
211 |
--------------------------------------------------------------------------------
/skhd/skhdrc:
--------------------------------------------------------------------------------
1 | # opens iTerm2
2 | alt - return : "${HOME}"/.dotfiles/scripts/utils/open_iterm2
3 |
4 | # Show system statistics
5 | fn + lalt - 1 : "${HOME}"/.dotfiles/scripts/info/show_cpu
6 | fn + lalt - 2 : "${HOME}"/.dotfiles/scripts/info/show_mem
7 | fn + lalt - 3 : "${HOME}"/.dotfiles/scripts/info/show_bat
8 | fn + lalt - 4 : "${HOME}"/.dotfiles/scripts/info/show_disk
9 | fn + lalt - 5 : "${HOME}"/.dotfiles/scripts/info/show_song
10 |
11 | # Navigation
12 | alt - h : yabai -m window --focus west
13 | alt - j : yabai -m window --focus south
14 | alt - k : yabai -m window --focus north
15 | alt - l : yabai -m window --focus east
16 |
17 | # Moving windows
18 | shift + alt - h : yabai -m window --warp west
19 | shift + alt - j : yabai -m window --warp south
20 | shift + alt - k : yabai -m window --warp north
21 | shift + alt - l : yabai -m window --warp east
22 |
23 | # Move focus container to workspace
24 | shift + alt - m : yabai -m window --space last; yabai -m space --focus last
25 | shift + alt - p : yabai -m window --space prev; yabai -m space --focus prev
26 | shift + alt - n : yabai -m window --space next; yabai -m space --focus next
27 | shift + alt - 1 : yabai -m window --space 1; yabai -m space --focus 1
28 | shift + alt - 2 : yabai -m window --space 2; yabai -m space --focus 2
29 | shift + alt - 3 : yabai -m window --space 3; yabai -m space --focus 3
30 | shift + alt - 4 : yabai -m window --space 4; yabai -m space --focus 4
31 |
32 | # Resize windows
33 | lctrl + alt - h : yabai -m window --resize left:-50:0; \
34 | yabai -m window --resize right:-50:0
35 | lctrl + alt - j : yabai -m window --resize bottom:0:50; \
36 | yabai -m window --resize top:0:50
37 | lctrl + alt - k : yabai -m window --resize top:0:-50; \
38 | yabai -m window --resize bottom:0:-50
39 | lctrl + alt - l : yabai -m window --resize right:50:0; \
40 | yabai -m window --resize left:50:0
41 |
42 | # Equalise size of windows
43 | lctrl + alt - e : yabai -m space --balance
44 |
45 | # Enable / Disable gaps in current workspace
46 | lctrl + alt - g : yabai -m space --toggle padding; yabai -m space --toggle gap
47 |
48 | # Rotate windows clockwise and anticlockwise
49 | alt - r : yabai -m space --rotate 270
50 | shift + alt - r : yabai -m space --rotate 90
51 |
52 | # Rotate on X and Y Axis
53 | shift + alt - x : yabai -m space --mirror x-axis
54 | shift + alt - y : yabai -m space --mirror y-axis
55 |
56 | # Set insertion point for focused container
57 | shift + lctrl + alt - h : yabai -m window --insert west
58 | shift + lctrl + alt - j : yabai -m window --insert south
59 | shift + lctrl + alt - k : yabai -m window --insert north
60 | shift + lctrl + alt - l : yabai -m window --insert east
61 |
62 | # Float / Unfloat window
63 | shift + alt - space : \
64 | yabai -m window --toggle float; \
65 | yabai -m window --toggle border
66 |
67 | # Restart Yabai
68 | shift + lctrl + alt - r : \
69 | /usr/bin/env osascript <<< \
70 | 'display notification "Restarting yabai" with title "yabai"'; \
71 | launchctl kickstart -k "gui/${UID}/homebrew.mxcl.yabai"
72 |
73 | # Make window native fullscreen
74 | alt - f : yabai -m window --toggle zoom-fullscreen
75 | shift + alt - f : yabai -m window --toggle native-fullscreen
76 |
--------------------------------------------------------------------------------
/sxhkd/sxhkdrc:
--------------------------------------------------------------------------------
1 | # Move / Navigate windows
2 | alt + {_,shift + }{h,j,k,l}
3 | bspc node -{f,s} {west,south,north,east}
4 |
5 | # Resize windows
6 | alt + control + {h,j,k,l}
7 | bash "${HOME}/.config/bspwm/resize" {left,down,up,right} 30
8 |
9 | # Preselection
10 | alt + control + shift + {h,j,k,l}
11 | bspc node -p {west,south,north,east}
12 |
13 | alt + control + shift + c
14 | bspc node -p cancel
15 |
16 | # Tabbing across windows
17 | alt + {_,shift +} Tab
18 | bspc node -f {next,prev}
19 |
20 | # Move focus container to workspace
21 | alt + {_,shift + }{1-9,0}
22 | bspc {desktop -f,node -d} '^{1-9,10}'
23 |
24 | # Equalize size of windows
25 | alt + control + e
26 | bspc node @/ --equalize
27 |
28 | # Toggle window mode on active window
29 | alt + shift + space
30 | bash "${HOME}/.config/bspwm/float"
31 |
32 | # Rotate windows clockwise and anticlockwise
33 | alt + {_,shift + } + r
34 | bspc node @/ --circulate {backward,forward}
35 |
36 | # Rotate on X and Y axis
37 | alt + shift + {x,y}
38 | bspc node @/ --flip {horizontal,vertical}
39 |
40 | # Close / Kill windows
41 | alt + {_,shift + } w
42 | bspc node -{c,k}
43 |
44 | # Restart sxhkd
45 | alt + shift + Escape
46 | pkill -USR1 -x sxhkd
47 |
48 | # Reload bspwm config
49 | alt + control + shift + Escape
50 | bash "${HOME}/.config/bspwm/bspwmrc"
51 |
52 | # Reload polybar config
53 | alt + control + Escape
54 | bash "${HOME}/.dotfiles/polybar/reload"
55 |
56 | # Exit bspwm
57 | alt + shift + q
58 | bspc quit
59 |
60 | # WM unspecific
61 |
62 | # Opens terminal
63 | alt + Return
64 | st
65 |
66 | # Opens thunar
67 | alt + e
68 | thunar "${HOME}"
69 |
70 | # Opens dmenu
71 | alt + space
72 | dmenu_run -fn "Inconsolata-10" \
73 | -nb "#1d1f21" \
74 | -nf "#c5c8c6" \
75 | -sb "#b5bd68" \
76 | -sf "#1d1f21"
77 |
--------------------------------------------------------------------------------
/systemd/wallpaper.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=Changes wallpaper periodically using feh
3 |
4 | [Service]
5 | Type=oneshot
6 | Environment="DISPLAY=:0"
7 | ExecStart=feh -r -z --bg-fill %h/.local/share/wallpaper
8 |
9 | [Install]
10 | WantedBy=default.target
11 |
--------------------------------------------------------------------------------
/systemd/wallpaper.timer:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=Changes wallpaper periodically using feh
3 |
4 | [Timer]
5 | Persistent=true
6 | OnCalendar=*-*-* *:00:00
7 | Unit=wallpaper.service
8 |
9 | [Install]
10 | WantedBy=timers.target
11 |
--------------------------------------------------------------------------------
/tmux/info.bash:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | get_window_size()
4 | {
5 | mapfile -t sizes < <(tmux list-windows -F '#{window_width}')
6 | window_size="${sizes[0]}"
7 | }
8 |
9 | get_status_length()
10 | {
11 | printf -v tmp "%s" "${*}"
12 | length="$((${#tmp} + (2 * (${#*} + 1))))"
13 | printf "%d" "${length}"
14 | }
15 |
16 | use_sys_line()
17 | {
18 | out_fmt=(
19 | $'| {cpu.load_avg}{cpu.temp? | {}°C}{mem.percent[round=0]? | Mem: {mem.used[prefix=GiB,round=2]} ({}%)}{disk.percent[round=0]? | {disk.dev[short]}: {disk.used[prefix=GiB,round=2]} ({}%)} | {date.date} | {date.time} |'
20 | $'| {cpu.load_avg[short]}{cpu.temp? | {}°C}{mem.percent[round=0]? | Mem: {}%}{disk.percent[round=0]? | Disk: {}%} | {date.date} | {date.time} |'
21 | )
22 |
23 | mapfile -t out < <(sys-line "${out_fmt[@]}")
24 | printf "%s" "${out[$((${#out[0]} < (window_size / 2) ? 0 : 1))]}"
25 | }
26 |
27 | use_show_scripts()
28 | {
29 | script_dir="$(type -p show_cpu)"
30 | script_dir="${script_dir%/*}"
31 | script_dir="${script_dir:-${HOME}/.dotfiles/scripts/info}"
32 |
33 | mapfile -t cpu_info < <(bash "-$-" "${script_dir}/show_cpu" load temp)
34 | mapfile -t mem_info < <(bash "-$-" "${script_dir}/show_mem" --prefix GiB --round 2 mem_used mem_percent)
35 | mapfile -t disk_info < <(bash "-$-" "${script_dir}/show_disk" --short-device disk_device disk_used disk_percent)
36 |
37 | mem_info[1]="${mem_info[1]/'%'}"
38 | disk_info[2]="${disk_info[2]/'%'}"
39 |
40 | if (($(get_status_length "${cpu_info[@]}" "${mem_info[@]}" "${disk_info[@]}") < (window_size / 2))); then
41 | printf -v cpu_out "| %s " "${cpu_info[@]}"
42 | printf -v mem_out "| Mem: %s (%.*f%%) " "${mem_info[0]}" "0" "${mem_info[1]}"
43 | printf -v disk_out "| %s: %s (%.*f%%) " "${disk_info[0]}" "${disk_info[1]}" "0" "${disk_info[2]}"
44 | else
45 | printf -v cpu_out "| %s " "${cpu_info[0]%% *}" "${cpu_info[@]:1}"
46 | printf -v mem_out "| Mem: %.*f%% " "0" "${mem_info[1]}"
47 | printf -v disk_out "| Disk: %.*f%% " "0" "${disk_info[2]}"
48 | fi
49 |
50 | printf -v time_out "| %(%a, %d %h)T | %(%H:%M)T |" "-1"
51 | time_out="${time_out:-$(date '+| %a, %d %h | %H:%M |')}"
52 |
53 | printf "%s" "${cpu_out}" "${mem_out}" "${disk_out}" "${time_out}"
54 | }
55 |
56 | main()
57 | {
58 | get_window_size
59 |
60 | if type -p sys-line > /dev/null 2>&1; then
61 | output="$(use_sys_line)"
62 | else
63 | output="$(use_show_scripts)"
64 | fi
65 |
66 | printf "%s" "${output}"
67 | }
68 |
69 | main
70 |
--------------------------------------------------------------------------------
/tmux/tmux.conf:
--------------------------------------------------------------------------------
1 | TMUX_DIR="${HOME}/.dotfiles/tmux"
2 |
3 | # General Settings
4 | set -g base-index 1
5 | set -g default-terminal xterm-256color
6 | set -g escape-time 0
7 | set -g history-limit 50000
8 | set -g status-position bottom
9 |
10 | set -g set-titles on
11 | set -g set-titles-string "[#S] #W: #T"
12 |
13 | set -g pane-border-style fg=white
14 | set -g pane-active-border-style fg=green
15 |
16 | # Status bar
17 | set -g status-left '|'
18 | setw -g window-status-separator ''
19 | setw -g window-status-current-format '#[bg=blue] #I:#W #[bg=green]|'
20 | setw -g window-status-format ' #I:#W |'
21 |
22 | set -g status-right-length 112
23 | set -g status-right '#(bash $TMUX_DIR/info.bash)'
24 |
25 | # Bindings
26 | bind r source-file ~/.tmux.conf \; display-message "Reloading config..."
27 |
--------------------------------------------------------------------------------
/ubersicht/bar.jsx:
--------------------------------------------------------------------------------
1 | import * as config from "./config.json"
2 |
3 | const style = {
4 | background: config.style.color.backgroundPrimary,
5 | height: 19,
6 | width: "100%",
7 | bottom: 0,
8 | right: 0,
9 | left: 0,
10 | zIndex: -1,
11 | position: "fixed",
12 | overflow: "hidden",
13 |
14 | borderTopStyle: "solid",
15 | borderTopColor: config.style.color.backgroundSecondary,
16 | borderTopWidth: 1,
17 | };
18 |
19 | export const refreshFrequency = false;
20 | export const render = ({output}) => ;
21 |
22 | export default null;
23 |
--------------------------------------------------------------------------------
/ubersicht/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "binary": "${HOME}/Library/Python/3.10/bin/sys-line",
3 | "style": {
4 | "font": {
5 | "style": "inconsolata",
6 | "size": 13
7 | },
8 | "color": {
9 | "backgroundPrimary": "#1d1f21",
10 | "backgroundSecondary": "#a0a0a0",
11 | "foreground": "#c5c8c6"
12 | }
13 | },
14 | "info": {
15 | "format": [
16 | "[ {cpu.load_avg}{cpu.temp[round=1]? | {}°C}{cpu.fan? | {} RPM} ]",
17 | "{mem.used[round=2,prefix=GiB]? [ Mem: {} ]}",
18 | "{disk.used[round=2,prefix=GiB]? [ {disk.dev[short]}: {} ]}",
19 | "{bat.is_present? [ Bat: {bat.percent[round=1]}%{bat.time? | {}} ]}",
20 | "{net.ssid? [ {} ]}",
21 | " [ {misc.vol?vol: {}%}{misc.scr? | scr: {}%} ]",
22 | " [ {date.date} | {date.time} ]"
23 | ],
24 | "args": [
25 | "--mount", "/System/Volumes/Data"
26 | ]
27 | },
28 | "spaces": {
29 | "format": [
30 | "[{wm.desktop_index? {}{wm.app_name[max_length=53]? | {}{wm.window_name?: {}}} }]"
31 | ],
32 | "args": [
33 | ]
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/ubersicht/lib/style.jsx:
--------------------------------------------------------------------------------
1 | const makeTextStyle = (config) => {
2 | return {
3 | marginTop: 0,
4 | marginLeft: 5,
5 | marginBottom: 4,
6 | marginRight: 5,
7 |
8 | color: config.style.color.foreground,
9 | font: `${config.style.font.size}px ${config.style.font.style}`,
10 | };
11 | };
12 |
13 | export default makeTextStyle;
14 |
--------------------------------------------------------------------------------
/ubersicht/lib/util.jsx:
--------------------------------------------------------------------------------
1 | const makeCommand = (bin, spec) => {
2 | return `${bin} '${spec.format.join("")}' ${spec.args.join(" ")}`;
3 | };
4 |
5 | export default makeCommand;
6 |
--------------------------------------------------------------------------------
/ubersicht/spaces.jsx:
--------------------------------------------------------------------------------
1 | import * as config from "./config.json";
2 | import makeCommand from "./lib/util.jsx";
3 | import makeTextStyle from "./lib/style.jsx";
4 |
5 | export const className = {
6 | bottom: 0,
7 | left: 0,
8 | };
9 |
10 | export const refreshFrequency = false;
11 | export const command = makeCommand(config.binary, config.spaces);
12 | export const render = ({output}) => {
13 | return (
14 |
15 | {output}
16 |
17 | );
18 | };
19 |
20 | export default null;
21 |
--------------------------------------------------------------------------------
/ubersicht/status.jsx:
--------------------------------------------------------------------------------
1 | import * as config from "./config.json";
2 | import makeCommand from "./lib/util.jsx";
3 | import makeTextStyle from "./lib/style.jsx";
4 |
5 | export const className = {
6 | bottom: 0,
7 | right: 0,
8 | };
9 |
10 | export const refreshFrequency = 5000;
11 | export const command = makeCommand(config.binary, config.info);
12 | export const render = ({output}) => {
13 | return (
14 |
15 | {output}
16 |
17 | );
18 | };
19 |
20 | export default null;
21 |
--------------------------------------------------------------------------------
/ubersicht/widget.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "dotfiles-bar",
3 | "description": "Dotfiles bar",
4 | "author": "Julian Heng",
5 | "email": "julianhengwl@gmail.com"
6 | }
7 |
--------------------------------------------------------------------------------
/vimrc/after/ftplugin/go.vim:
--------------------------------------------------------------------------------
1 | " Use hard tabs
2 | setlocal noexpandtab
3 |
4 | " Set tab to be 8 columns
5 | setlocal tabstop=8
6 | setlocal shiftwidth=8
7 |
--------------------------------------------------------------------------------
/vimrc/after/ftplugin/markdown.vim:
--------------------------------------------------------------------------------
1 | " Use vim-surround to bold text
2 | let b:surround_{char2nr('b')}="**\r**"
3 | let b:surround_{char2nr('i')}="*\r*"
4 |
--------------------------------------------------------------------------------
/vimrc/vimrc:
--------------------------------------------------------------------------------
1 | filetype plugin indent on
2 |
3 | " Vim Settings
4 | set tabpagemax=99
5 | set nocompatible
6 | set backspace=2
7 | set hidden
8 | set history=100
9 | set smartindent
10 | set autoindent
11 | set tabstop=4
12 | set shiftwidth=4
13 | set expandtab
14 | set viminfo='50,<1000,s100,h
15 | set conceallevel=0
16 | set path+=**
17 | autocmd BufRead scp://* :set bt=acwrite
18 |
19 | " Aesthetics
20 | set number
21 | set laststatus=2
22 | set noshowmode
23 |
24 | " Force vim to use 16 colors
25 | set t_Co=16
26 |
27 | call matchadd('ColorColumn', '\%80v', 100)
28 |
29 | if has('linebreak')
30 | set breakindent
31 | let &showbreak = '↳ '
32 | set cpo+=n
33 | end
34 |
35 | " Cursorline
36 | set cursorline
37 | set cursorcolumn
38 |
39 | highlight CursorLine cterm=bold ctermbg=None
40 | highlight CursorColumn cterm=bold ctermbg=None
41 | highlight CursorLineNr cterm=bold ctermfg=None
42 |
43 | " Highlight
44 | highlight LineNr ctermfg=DarkGrey
45 | highlight ColorColumn ctermbg=DarkGrey
46 |
47 | " Search
48 | set hlsearch
49 | set showmatch
50 | set incsearch
51 |
52 | syntax on
53 |
54 | " List of chars from Gozala
55 | " https://github.com/Gozala/.vim/blob/master/.vimrc
56 | set list
57 | set listchars=tab:▸\ ,eol:¬,trail:˺,nbsp:█
58 |
59 | " Redefine navigation with ctrl key in certain modes
60 | nnoremap
61 | vnoremap
62 | inoremap
63 | cnoremap
64 |
65 | nnoremap
66 | inoremap
67 | vnoremap
68 |
69 | nnoremap
70 | inoremap
71 | vnoremap
72 |
73 | nnoremap
74 | inoremap
75 | vnoremap
76 | cnoremap
77 |
78 | " Disable arrows
79 | nnoremap :echo "Nope."
80 | vnoremap :echo "Nope."
81 | inoremap :echo "Nope."
82 | cnoremap
83 |
84 | nnoremap :echo "Nope."
85 | vnoremap :echo "Nope."
86 | inoremap :echo "Nope."
87 |
88 | nnoremap :echo "Nope."
89 | vnoremap :echo "Nope."
90 | inoremap :echo "Nope."
91 |
92 | nnoremap :echo "Nope."
93 | vnoremap :echo "Nope."
94 | inoremap :echo "Nope."
95 | cnoremap
96 |
97 | " Set scoll
98 | nnoremap
99 | vnoremap
100 | inoremap
101 |
102 | nnoremap
103 | vnoremap
104 | inoremap
105 |
106 | " Soft wrapping movements
107 | nnoremap j gj
108 | vnoremap j gj
109 |
110 | nnoremap k gk
111 | vnoremap k gk
112 |
113 | " Block indent with visual mode
114 | vnoremap > >gv
115 | vnoremap <
118 |
119 | " Disable json conceal
120 | let g:vim_json_conceal=0
121 |
122 | " Disable tex conceal
123 | let g:tex_conceal=""
124 |
125 | " Disable indentLine for these filetypes
126 | autocmd FileType markdown let g:indentLine_enabled=0
127 |
128 | " Lightline status line
129 | let g:lightline = {
130 | \ 'active': {
131 | \ 'left': [ [ 'mode', 'paste' ],
132 | \ [ 'readonly', 'filename' ] ],
133 | \ },
134 | \ 'component_function': {
135 | \ 'filename': 'LightlineFilename',
136 | \ },
137 | \ }
138 |
139 | function! LightlineFilename()
140 | let filename = expand('%:t') !=# '' ? expand('%:t') : '[No Name]'
141 | let modified = &modified ? ' +' : ''
142 | return filename . modified
143 | endfunction
144 |
145 | " vim-lsc
146 | let g:lsc_server_commands = {
147 | \ 'cs': 'omnisharp --languageserver'
148 | \ }
149 |
150 | let g:lsc_auto_map = {
151 | \ 'defaults': v:true,
152 | \ }
153 |
--------------------------------------------------------------------------------
/yabai/yabairc:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -x
4 |
5 | # ====== Variables =============================
6 |
7 | declare -A gaps
8 | declare -A color
9 |
10 | gaps["top"]="4"
11 | gaps["bottom"]="24"
12 | gaps["left"]="4"
13 | gaps["right"]="4"
14 | gaps["inner"]="4"
15 |
16 | color["focused"]="0xE0808080"
17 | color["normal"]="0x00010101"
18 | color["preselect"]="0xE02d74da"
19 |
20 | ubersicht_spaces_refresh_command="osascript -e 'tell application id \"tracesOf.Uebersicht\" to refresh widget id \"dotfiles-bar-spaces-jsx\"'"
21 |
22 | # ===== Loading Scripting Additions ============
23 |
24 | # See: https://github.com/koekeishiya/yabai/wiki/Installing-yabai-(latest-release)#macos-big-sur---automatically-load-scripting-addition-on-startup
25 | sudo yabai --load-sa
26 | yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa"
27 |
28 | # ===== Tiling setting =========================
29 |
30 | yabai -m config layout bsp
31 |
32 | yabai -m config top_padding "${gaps["top"]}"
33 | yabai -m config bottom_padding "${gaps["bottom"]}"
34 | yabai -m config left_padding "${gaps["left"]}"
35 | yabai -m config right_padding "${gaps["right"]}"
36 | yabai -m config window_gap "${gaps["inner"]}"
37 |
38 | yabai -m config mouse_follows_focus off
39 | yabai -m config focus_follows_mouse off
40 |
41 | yabai -m config window_topmost off
42 | yabai -m config window_opacity off
43 | yabai -m config window_shadow float
44 |
45 | yabai -m config window_border on
46 | yabai -m config window_border_width 2
47 | yabai -m config active_window_border_color "${color["focused"]}"
48 | yabai -m config normal_window_border_color "${color["normal"]}"
49 | yabai -m config insert_feedback_color "${color["preselect"]}"
50 |
51 | yabai -m config active_window_opacity 1.0
52 | yabai -m config normal_window_opacity 0.90
53 | yabai -m config split_ratio 0.50
54 |
55 | yabai -m config auto_balance off
56 |
57 | yabai -m config mouse_modifier fn
58 | yabai -m config mouse_action1 move
59 | yabai -m config mouse_action2 resize
60 |
61 | # ===== Rules ==================================
62 |
63 | yabai -m rule --add label="Finder" app="^Finder$" title="(Co(py|nnect)|Move|Info|Pref)" manage=off
64 | yabai -m rule --add label="Safari" app="^Safari$" title="^(General|(Tab|Password|Website|Extension)s|AutoFill|Se(arch|curity)|Privacy|Advance)$" manage=off
65 | yabai -m rule --add label="macfeh" app="^macfeh$" manage=off
66 | yabai -m rule --add label="Krita" app="Krita" manage=off
67 | yabai -m rule --add label="Blender" app="Blender" manage=off
68 | yabai -m rule --add label="Steam" app="Steam" manage=off
69 | yabai -m rule --add label="Aseprite" app="Aseprite" manage=off
70 | yabai -m rule --add label="qemu" app="qemu-system-x86_64" manage=off
71 | yabai -m rule --add label="QuickTime Player" app="QuickTime Player" manage=off
72 | yabai -m rule --add label="System Preferences" app="^System Preferences$" title=".*" manage=off
73 | yabai -m rule --add label="App Store" app="^App Store$" manage=off
74 | yabai -m rule --add label="Activity Monitor" app="^Activity Monitor$" manage=off
75 | yabai -m rule --add label="KeePassXC" app="^KeePassXC$" manage=off
76 | yabai -m rule --add label="Calculator" app="^Calculator$" manage=off
77 | yabai -m rule --add label="Dictionary" app="^Dictionary$" manage=off
78 | yabai -m rule --add label="mpv" app="^mpv$" manage=off
79 | yabai -m rule --add label="Software Update" title="Software Update" manage=off
80 | yabai -m rule --add label="About This Mac" app="System Information" title="About This Mac" manage=off
81 |
82 | # ===== Signals ================================
83 |
84 | yabai -m signal --add event=application_front_switched action="${ubersicht_spaces_refresh_command}"
85 | yabai -m signal --add event=display_changed action="${ubersicht_spaces_refresh_command}"
86 | yabai -m signal --add event=space_changed action="${ubersicht_spaces_refresh_command}"
87 | yabai -m signal --add event=window_created action="${ubersicht_spaces_refresh_command}"
88 | yabai -m signal --add event=window_destroyed action="${ubersicht_spaces_refresh_command}"
89 | yabai -m signal --add event=window_focused action="${ubersicht_spaces_refresh_command}"
90 | yabai -m signal --add event=window_title_changed action="${ubersicht_spaces_refresh_command}"
91 |
92 | set +x
93 | printf "yabai: configuration loaded...\\n"
94 |
--------------------------------------------------------------------------------