Compare commits

...

32 Commits

Author SHA1 Message Date
1dee09759a chore(deps): update nvim and yarn 2023-10-02 19:13:37 +03:00
e2f6db9208 feat(tmux): tmux suspend and mode indicator 2023-10-02 13:04:53 +03:00
14270093c2 chore(config): remove irssi default theme 2023-10-02 11:58:45 +03:00
5015a8cd5a chore(nvim): update plugins, tweaks ui 2023-10-02 11:58:19 +03:00
266c18e195 chore(dotbot): cleanup dotbot plugins 2023-10-02 11:33:35 +03:00
9c432ed2a0 feat(tmux): update cfg, remove tpm, change theme 2023-10-02 11:32:41 +03:00
e6f3aae287 fix(shell): rework shell config for more stability 2023-10-02 08:39:07 +03:00
a73c54a5a6 chore(nvim): update deps 2023-09-29 20:47:11 +03:00
39ecd0495c fix(shell): update paths, add missing deps 2023-09-29 20:46:46 +03:00
4b45c89a90 fix(shell): change how shell detection works 2023-09-29 15:52:16 +03:00
dfb7a51786 fix(scripts): bash doesn't know -s in x-have 2023-09-29 14:57:26 +03:00
56ae0e1e1c feat(scripts): have is now x-have script 2023-09-29 14:51:20 +03:00
3d753fe08c feat(scripts): x-load-configs is now a script 2023-09-29 14:50:05 +03:00
540054d4bb feat(config): irssi config and plugins 2023-09-29 14:43:59 +03:00
b1a7932b72 chore(scripts): tweaks to dfm and msgr 2023-09-28 22:39:25 +03:00
ced09160ab chore(nvim): updates, config changes, tweaking 2023-09-28 20:37:16 +03:00
594ee0d03c chore(scripts): more work on installation scripts 2023-09-28 18:59:21 +03:00
68ec53e29b chore(repo): ignore local/share/fonts 2023-09-28 18:49:52 +03:00
0c8b075689 fix(config): lakka zshrc fixes 2023-09-28 18:33:29 +03:00
0242bbbd73 chore(deps): nvim dependencies 2023-09-28 18:17:44 +03:00
31423c30b9 fix(scripts): have now uses which -s 2023-09-28 18:17:29 +03:00
fbdd2c7448 fix(shell): fixed zsh/bash config loading 2023-09-28 17:53:09 +03:00
0aff4784b1 feat(scripts): msgr helper script 2023-09-28 17:13:44 +03:00
10b18e8bcc chore(dotbot): remove dotbot-crontab 2023-09-28 10:44:27 +03:00
dc0a349139 chore(config): add bob installed nvim to path 2023-09-28 09:38:55 +03:00
3ac1fac444 feat(nvim): Switched from brew nvim to bob-nvim 2023-09-27 15:25:33 +03:00
5bf4ea462b chore(config): Configuration tweaks 2023-09-27 15:22:42 +03:00
1d056988f4 feat(lint): added my linting configs 2023-09-27 14:25:53 +03:00
2415dff0e2 feat(scripts): dfu - dotfiles update function 2023-09-27 11:08:44 +03:00
d891d5a3c5 chore(deps): nvim deps update 2023-09-27 11:07:34 +03:00
f48813ff85 chore(config): Tweaks to fonts, app title bar, etc 2023-09-27 11:07:15 +03:00
a87b33b8c2 chore(shell): make everything bit faster 2023-09-27 10:38:10 +03:00
97 changed files with 6438 additions and 1321 deletions

3
.commitlintrc.json Normal file
View File

@@ -0,0 +1,3 @@
{
"extends": ["@ivuorinen/commitlint-config"]
}

View File

@@ -19,11 +19,11 @@ indent_size = 1
indent_size = 1 indent_size = 1
indent_style = tab indent_style = tab
[{local/bin/*,**/*.sh,**/zshrc}] [{local/bin/*,**/*.sh,**/zshrc,config/*}]
shell_variant = bash # --language-variant shell_variant = bash # --language-variant
binary_next_line = true binary_next_line = true
switch_case_indent = true # --case-indent switch_case_indent = true # --case-indent
space_redirects = true space_redirects = true
keep_padding = true keep_padding = false
function_next_line = true # --func-next-line function_next_line = true # --func-next-line

3
.eslintrc.json Normal file
View File

@@ -0,0 +1,3 @@
{
"extends": ["@ivuorinen"]
}

2
.gitattributes vendored
View File

@@ -13,7 +13,7 @@
## Handle line endings automatically for files detected as ## Handle line endings automatically for files detected as
## text and leave all files detected as binary untouched. ## text and leave all files detected as binary untouched.
## This will handle all files NOT defined below. ## This will handle all files NOT defined below.
* text=auto * text=auto oel=lf
# Source code # Source code
*.bash text eol=lf *.bash text eol=lf

View File

@@ -1,7 +1,7 @@
version: 2 version: 2
updates: updates:
# Maintain dependencies for GitHub Actions # Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions" - package-ecosystem: 'github-actions'
directory: "/" directory: '/'
schedule: schedule:
interval: "weekly" interval: 'weekly'

View File

@@ -1,6 +1,4 @@
{ {
"$schema": "https://docs.renovatebot.com/renovate-schema.json", "$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [ "extends": ["local>ivuorinen/.github:renovate-config"]
"local>ivuorinen/.github:renovate-config"
]
} }

View File

@@ -7,20 +7,21 @@ module.exports = {
{ types: ['build', 'ci'], label: '🏗️ Build System' }, { types: ['build', 'ci'], label: '🏗️ Build System' },
{ types: ['refactor'], label: '🪚 Refactors' }, { types: ['refactor'], label: '🪚 Refactors' },
{ types: ['doc', 'docs'], label: '📚 Documentation Changes' }, { types: ['doc', 'docs'], label: '📚 Documentation Changes' },
{ types: ['config'], label: '🪛 Configuration Changes' },
{ types: ['test', 'tests'], label: '🔍 Tests' }, { types: ['test', 'tests'], label: '🔍 Tests' },
{ types: ['style', 'codestyle'], label: '💅 Code Style Changes' }, { types: ['style', 'codestyle', 'lint'], label: '💅 Code Style Changes' },
{ types: ['chore', 'Chore'], label: '🧹 Chores' }, { types: ['chore', 'Chore', 'deps', 'Deps'], label: '🧹 Chores' },
{ types: ['other', 'Other'], label: 'Other Changes' }, { types: ['other', 'Other'], label: 'Other Changes' },
], ],
excludeTypes: [], excludeTypes: [],
renderTypeSection: function (label, commits) { renderTypeSection: function (label, commits) {
let text = `\n## ${ label }\n\n` let text = `\n## ${label}\n\n`
commits.forEach((commit) => { commits.forEach(commit => {
const scope = commit.scope ? `**${ commit.scope }:** ` : '' const scope = commit.scope ? `**${commit.scope}:** ` : ''
text += `- ${ scope }${ commit.subject }\n` text += `- ${scope}${commit.subject}\n`
}) })
return text return text
@@ -28,8 +29,8 @@ module.exports = {
renderChangelog: function (release, changes) { renderChangelog: function (release, changes) {
const now = new Date() const now = new Date()
const d = now.toISOString().substring(0, 10); const d = now.toISOString().substring(0, 10)
const header = `# ${ release } - ${ d }\n`; const header = `# ${release} - ${d}\n`
return header + changes + '\n\n' return header + changes + '\n\n'
}, },
} }

View File

@@ -12,7 +12,7 @@ jobs:
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
config_file: .github/tag-changelog-config.js config_file: .github/tag-changelog-config.js
- name: "Echo results" - name: 'Echo results'
id: output-changelog id: output-changelog
run: | run: |
echo "${{ steps.changelog.outputs.changes }}" echo "${{ steps.changelog.outputs.changes }}"

View File

@@ -2,7 +2,7 @@ name: Release Daily State # Workflow name displayed on GitHub
on: on:
workflow_dispatch: # Trigger manually workflow_dispatch: # Trigger manually
schedule: schedule:
- cron: "30 20 * * *" # UTC is 2-3 hours behind Europe/Helsinki, my timezone - cron: '30 20 * * *' # UTC is 2-3 hours behind Europe/Helsinki, my timezone
permissions: permissions:
contents: write contents: write
jobs: jobs:

View File

@@ -1,6 +1,6 @@
name: Update submodules name: Update submodules
on: on:
schedule: [{cron: 0 3 * * *}] schedule: [{ cron: 0 3 * * * }]
workflow_dispatch: workflow_dispatch:
permissions: permissions:
contents: write contents: write

3
.gitignore vendored
View File

@@ -13,5 +13,6 @@ ssh/local.d/*
!ssh/local.d/.gitkeep !ssh/local.d/.gitkeep
!.gitkeep !.gitkeep
.env .env
local/share/fonts/NerdFonts local/share/fonts/*
node_modules

28
.gitmodules vendored
View File

@@ -19,40 +19,36 @@
url = https://github.com/cheat/cheatsheets.git url = https://github.com/cheat/cheatsheets.git
ignore = dirty ignore = dirty
[submodule "tmux/tpm"]
path = config/tmux/plugins/tpm
url = https://github.com/tmux-plugins/tpm.git
ignore = dirty
[submodule "tmux/catppuccin"]
path = config/tmux/plugins/tmux
url = https://github.com/catppuccin/tmux.git
[submodule "tmux/tmux-continuum"] [submodule "tmux/tmux-continuum"]
path = config/tmux/plugins/tmux-continuum path = config/tmux/plugins/tmux-continuum
url = https://github.com/tmux-plugins/tmux-continuum url = https://github.com/tmux-plugins/tmux-continuum
[submodule "tmux/tmux-menus"] ignore = dirty
path = config/tmux/plugins/tmux-menus
url = https://github.com/jaclu/tmux-menus.git
[submodule "tmux/tmux-resurrect"] [submodule "tmux/tmux-resurrect"]
path = config/tmux/plugins/tmux-resurrect path = config/tmux/plugins/tmux-resurrect
url = https://github.com/tmux-plugins/tmux-resurrect url = https://github.com/tmux-plugins/tmux-resurrect
ignore = dirty
[submodule "tmux/tmux-sensible"] [submodule "tmux/tmux-sensible"]
path = config/tmux/plugins/tmux-sensible path = config/tmux/plugins/tmux-sensible
url = https://github.com/tmux-plugins/tmux-sensible.git url = https://github.com/tmux-plugins/tmux-sensible.git
ignore = dirty
[submodule "tmux/tmux-sessionist"] [submodule "tmux/tmux-sessionist"]
path = config/tmux/plugins/tmux-sessionist path = config/tmux/plugins/tmux-sessionist
url = https://github.com/tmux-plugins/tmux-sessionist.git url = https://github.com/tmux-plugins/tmux-sessionist.git
ignore = dirty
[submodule "tmux/tmux-yank"] [submodule "tmux/tmux-yank"]
path = config/tmux/plugins/tmux-yank path = config/tmux/plugins/tmux-yank
url = https://github.com/tmux-plugins/tmux-yank.git url = https://github.com/tmux-plugins/tmux-yank.git
ignore = dirty
[submodule "tmux/tmux-window-name"] [submodule "tmux/tmux-window-name"]
path = config/tmux/plugins/tmux-window-name path = config/tmux/plugins/tmux-window-name
url = https://github.com/ofirgall/tmux-window-name.git url = https://github.com/ofirgall/tmux-window-name.git
[submodule "dotbot-crontab"] ignore = dirty
path = tools/dotbot-crontab
url = https://github.com/codekansas/dotbot-crontab.git
[submodule "dotbot-snap"]
path = tools/dotbot-snap
url = https://github.com/DrDynamic/dotbot-snap.git
[submodule "dotbot-pip"] [submodule "dotbot-pip"]
path = tools/dotbot-pip path = tools/dotbot-pip
url = https://github.com/sobolevn/dotbot-pip.git url = https://github.com/sobolevn/dotbot-pip.git
[submodule "tmux/tmux-suspend"]
path = config/tmux/plugins/tmux-suspend
url = https://github.com/MunifTanjim/tmux-suspend.git
[submodule "tmux/tmux-mode-indicator"]
path = config/tmux/plugins/tmux-mode-indicator
url = https://github.com/MunifTanjim/tmux-mode-indicator.git

View File

@@ -3,4 +3,4 @@ config/cheat/cheatsheets/community/**
tools/dotbot/** tools/dotbot/**
tools/dotbot-brew/** tools/dotbot-brew/**
tools/dotbot-include/** tools/dotbot-include/**
node_modules

View File

@@ -1,5 +1,5 @@
{ {
"extends": "markdownlint/style/prettier", "extends": "@ivuorinen/markdownlint-config",
"code-block-style": { "code-block-style": {
"style": "fenced" "style": "fenced"
}, },

6
.markdownlintignore Normal file
View File

@@ -0,0 +1,6 @@
# only care about files that are under our control
config/cheat/cheatsheets/community/*
config/tmux/plugins/*
tools/*
node_modules/*

8
.prettierignore Normal file
View File

@@ -0,0 +1,8 @@
.mypy_cache/*
tools/dotbot*
local/bin/antigen.zsh
config/cheat/cheatsheets/community
config/tmux/plugins/*
lazy-lock.json
Brewfile.lock.json

14
.prettierrc.js Normal file
View File

@@ -0,0 +1,14 @@
module.exports = {
...require('@ivuorinen/prettier-config'),
trailingComma: 'all',
// Add custom options below:
overrides: [
{
files: '*.md',
options: {
printWidth: 120,
proseWrap: 'preserve',
},
},
],
}

View File

@@ -1,21 +0,0 @@
formatter:
type: basic
indent: 2
retain_line_breaks: false
disallow_anchors: false
max_line_length: 0
scan_folded_as_literal: false
indentless_arrays: false
doublestar: true
extensions:
- yaml
- yml
include:
- ./*.{yml,yaml}
- ./**/*.{yml,yaml}
exclude:
- ./tools/**

View File

@@ -1,2 +0,0 @@
# .yamlignore

View File

@@ -7,10 +7,6 @@ git submodule add --name dotbot-brew \
-f https://github.com/wren/dotbot-brew.git tools/dotbot-brew -f https://github.com/wren/dotbot-brew.git tools/dotbot-brew
git submodule add --name dotbot-include \ git submodule add --name dotbot-include \
-f https://gitlab.com/gnfzdz/dotbot-include.git tools/dotbot-include -f https://gitlab.com/gnfzdz/dotbot-include.git tools/dotbot-include
git submodule add --name dotbot-crontab \
-f https://github.com/codekansas/dotbot-crontab.git tools/dotbot-crontab
git submodule add --name dotbot-snap \
-f https://github.com/DrDynamic/dotbot-snap.git tools/dotbot-snap
git submodule add --name dotbot-pip \ git submodule add --name dotbot-pip \
-f https://github.com/sobolevn/dotbot-pip.git tools/dotbot-pip -f https://github.com/sobolevn/dotbot-pip.git tools/dotbot-pip
@@ -19,21 +15,30 @@ git submodule add --name cheat-community \
-f https://github.com/cheat/cheatsheets.git config/cheat/cheatsheets/community -f https://github.com/cheat/cheatsheets.git config/cheat/cheatsheets/community
# tmux plugin manager and plugins # tmux plugin manager and plugins
git submodule add --name tmux/tpm \
-f https://github.com/tmux-plugins/tpm.git config/tmux/plugins/tpm
git submodule add --name tmux/catppuccin \
-f https://github.com/catppuccin/tmux.git config/tmux/plugins/tmux
git submodule add --name tmux/tmux-continuum \ git submodule add --name tmux/tmux-continuum \
-f https://github.com/tmux-plugins/tmux-continuum config/tmux/plugins/tmux-continuum -f https://github.com/tmux-plugins/tmux-continuum config/tmux/plugins/tmux-continuum
git submodule add --name tmux/tmux-menus \ git submodule add --name tmux/tmux-mode-indicator \
-f https://github.com/jaclu/tmux-menus.git config/tmux/plugins/tmux-menus -f https://github.com/MunifTanjim/tmux-mode-indicator.git config/tmux/plugins/tmux-mode-indicator
git submodule add --name tmux/tmux-resurrect \ git submodule add --name tmux/tmux-resurrect \
-f https://github.com/tmux-plugins/tmux-resurrect config/tmux/plugins/tmux-resurrect -f https://github.com/tmux-plugins/tmux-resurrect config/tmux/plugins/tmux-resurrect
git submodule add --name tmux/tmux-sensible \ git submodule add --name tmux/tmux-sensible \
-f https://github.com/tmux-plugins/tmux-sensible.git config/tmux/plugins/tmux-sensible -f https://github.com/tmux-plugins/tmux-sensible.git config/tmux/plugins/tmux-sensible
git submodule add --name tmux/tmux-sessionist \ git submodule add --name tmux/tmux-sessionist \
-f https://github.com/tmux-plugins/tmux-sessionist.git config/tmux/plugins/tmux-sessionist -f https://github.com/tmux-plugins/tmux-sessionist.git config/tmux/plugins/tmux-sessionist
git submodule add --name tmux/tmux-suspend \
-f https://github.com/MunifTanjim/tmux-suspend.git config/tmux/plugins/tmux-suspend
git submodule add --name tmux/tmux-window-name \ git submodule add --name tmux/tmux-window-name \
-f https://github.com/ofirgall/tmux-window-name.git config/tmux/plugins/tmux-window-name -f https://github.com/ofirgall/tmux-window-name.git config/tmux/plugins/tmux-window-name
git submodule add --name tmux/tmux-yank \ git submodule add --name tmux/tmux-yank \
-f https://github.com/tmux-plugins/tmux-yank.git config/tmux/plugins/tmux-yank -f https://github.com/tmux-plugins/tmux-yank.git config/tmux/plugins/tmux-yank
for MODULE in $(git config --file .gitmodules --get-regexp path | awk '{ print $2 }'); do
git config "submodule.${MODULE}.ignore" all
done
# remove old submodules
[ -d "config/tmux/plugins/tpm" ] && rm -rf config/tmux/plugins/tpm
[ -d "config/tmux/plugins/tmux" ] && rm -rf config/tmux/plugins/tmux
[ -d "config/tmux/plugins/tmux-menus" ] && rm -rf config/tmux/plugins/tmux-menus
[ -d "tools/dotbot-crontab" ] && rm -rf tools/dotbot-crontab
[ -d "tools/dotbot-snap" ] && rm -rf tools/dotbot-snap

View File

@@ -3,32 +3,20 @@
# Defaults # Defaults
export DOTFILES="$HOME/.dotfiles" export DOTFILES="$HOME/.dotfiles"
export PATH="$HOME/.local/bin:$HOME/.dotfiles/local/bin:$PATH"
# shellcheck source=scripts/shared.sh
source "$DOTFILES/scripts/shared.sh"
# Run x-load-configs in your terminal to reload the files. # Explicitly set XDG folders
function x-load-configs() # https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
{ export XDG_CONFIG_HOME="$HOME/.config"
# Load the shell dotfiles, and then some: export XDG_DATA_HOME="$HOME/.local/share"
for file in $DOTFILES/config/{exports,alias,functions}; do export XDG_STATE_HOME="$HOME/.local/state"
HOST="$(hostname -s)"
# global (exports|alias|functions) file for all hosts # custom variables
# shellcheck source=../config/exports export XDG_BIN_HOME="$HOME/.local/bin"
[ -r "$file" ] && source "$file" export XDG_CACHE_HOME="$HOME/.cache"
# global secret file, git ignored export XDG_RUNTIME_DIR="$HOME/.local/run"
# shellcheck source=../config/exports-secret
[ -r "$file-secret" ] && source "$file-secret"
# host specific (exports|alias|functions) file
# shellcheck source=../config/exports
[ -r "$file-$HOST" ] && source "$file-$HOST"
# host specific (exports|alias|functions) file, git ignored
# shellcheck source=../config/exports
[ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret"
done
}
x-load-configs
# Import ssh keys in keychain # Import ssh keys in keychain
ssh-add -A 2> /dev/null ssh-add -A 2>/dev/null
# shellcheck source=../config/fzf/fzf.bash
[ -f "${DOTFILES}/config/fzf/fzf.bash" ] \
&& source "${DOTFILES}/config/fzf/fzf.bash"

View File

@@ -5,48 +5,43 @@
export DOTFILES="$HOME/.dotfiles" export DOTFILES="$HOME/.dotfiles"
# shellcheck source=scripts/shared.sh # shellcheck source=scripts/shared.sh
source "$DOTFILES/scripts/shared.sh" source "$DOTFILES/scripts/shared.sh"
export PATH="$HOME/.local/bin:$HOME/.dotfiles/local/bin:$PATH"
# Explicitly set XDG folders
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_STATE_HOME="$HOME/.local/state"
# custom variables
export XDG_BIN_HOME="$HOME/.local/bin"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_RUNTIME_DIR="$HOME/.local/run"
export COMPLETION_WAITING_DOTS=true export COMPLETION_WAITING_DOTS=true
# Run x-load-configs in your terminal to reload the files. path_append "/opt/homebrew/bin"
function x-load-configs() if type brew &> /dev/null; then
{ eval "$(brew shellenv)"
# Load the shell dotfiles, and then some: FPATH="$HOMEBREW_PREFIX/share/zsh/site-functions:${FPATH}"
for file in $DOTFILES/config/{exports,alias,functions}; do fi
HOST="$(hostname -s)"
# global (exports|alias|functions) file for all hosts
# shellcheck source=../config/exports
[ -r "$file" ] && source "$file"
# global secret file, git ignored
# shellcheck source=../config/exports-secret
[ -r "$file-secret" ] && source "$file-secret"
# host specific (exports|alias|functions) file
# shellcheck source=../config/exports
[ -r "$file-$HOST" ] && source "$file-$HOST"
# host specific (exports|alias|functions) file, git ignored
# shellcheck source=../config/exports
[ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret"
done
}
x-load-configs
export HISTFILE="$XDG_STATE_HOME"/zsh/history path_append "/usr/local/bin"
path_prepend "$XDG_DATA_HOME/cargo/bin"
path_prepend "$XDG_BIN_HOME"
path_prepend "$HOME/.local/go/bin"
path_prepend "$XDG_DATA_HOME/bob/nvim-bin"
autoload -U colors zsh/terminfo source "$DOTFILES/config/exports-shell"
colors source "$DOTFILES/config/exports-apps"
source "$DOTFILES/config/alias"
source "$DOTFILES/config/functions"
export ZSH_CUSTOM_COMPLETION_PATH="$XDG_CONFIG_HOME/zsh/completion" export ZSH_CUSTOM_COMPLETION_PATH="$XDG_CONFIG_HOME/zsh/completion"
x-dc "$ZSH_CUSTOM_COMPLETION_PATH" x-dc "$ZSH_CUSTOM_COMPLETION_PATH"
# Add completion scripts to zsh path # Add completion scripts to zsh path
FPATH="$ZSH_CUSTOM_COMPLETION_PATH:$FPATH" FPATH="$ZSH_CUSTOM_COMPLETION_PATH:$FPATH"
autoload -Uz compinit
if type brew &> /dev/null; then
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
fi
compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION"
# Try to load antigen, if present # Try to load antigen, if present
ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh" ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh"
@@ -54,14 +49,46 @@ ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh"
[[ -f "$ANTIGEN_ZSH_PATH" ]] && source "$ANTIGEN_ZSH_PATH" [[ -f "$ANTIGEN_ZSH_PATH" ]] && source "$ANTIGEN_ZSH_PATH"
# antigen is present # antigen is present
have antigen && { antigen use oh-my-zsh
antigen use oh-my-zsh
# config/functions export ZSH_TMUX_AUTOSTART=true
x-default-antigen-bundles export ZSH_TMUX_CONFIG="$DOTFILES/config/tmux/tmux.conf"
export ZSH_TMUX_UNICODE=true
export ZSH_TMUX_AUTOQUIT=false
export ZSH_TMUX_DEFAULT_SESSION_NAME=main
antigen apply export NVM_DIR="$XDG_CONFIG_HOME/nvm"
} export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME"/npm/npmrc
# z, the zsh version
export ZSHZ_DATA="$XDG_STATE_HOME/z"
antigen bundle z
# these should be always available
antigen bundle tmux
antigen bundle colored-man-pages
antigen bundle command-not-found
antigen bundle ssh-agent
antigen bundle jreese/zsh-titles
antigen bundle unixorn/autoupdate-antigen.zshplugin
antigen bundle zsh-users/zsh-completions
# these should be available if there's need
have brew && antigen bundle brew
have php && antigen bundle php
have python && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
# nvm is a strange beast
zstyle ':omz:plugins:nvm' autoload yes
antigen bundle nvm
# antigen bundle "$DOTFILES/config/zsh/plugins/nvm-auto-use"
# nice to have stuff
antigen bundle gcloud
# this needs to be the last item
antigen bundle zsh-users/zsh-syntax-highlighting
antigen apply
# shellcheck source=../config/fzf/fzf.zsh # shellcheck source=../config/fzf/fzf.zsh
[ -f "${DOTFILES}/config/fzf/fzf.zsh" ] \ [ -f "${DOTFILES}/config/fzf/fzf.zsh" ] \

View File

@@ -17,6 +17,7 @@ env:
# Window dimensions in character columns and lines # Window dimensions in character columns and lines
# (changes require restart) # (changes require restart)
window: window:
dynamic_title: true
dimensions: dimensions:
columns: 130 columns: 130
lines: 40 lines: 40
@@ -39,19 +40,19 @@ draw_bold_text_with_bright_colors: true
font: font:
# The normal (roman) font face to use. # The normal (roman) font face to use.
normal: normal:
family: JetBrainsMono Nerd Font family: JetBrainsMonoNL Nerd Font Mono
# Style can be specified to pick a specific face. # Style can be specified to pick a specific face.
style: ExtraLight style: ExtraLight
# The bold font face # The bold font face
bold: bold:
family: JetBrainsMono Nerd Font family: JetBrainsMonoNL Nerd Font Mono
# Style can be specified to pick a specific face. # Style can be specified to pick a specific face.
style: Bold style: Bold
# The italic font face # The italic font face
italic: italic:
family: JetBrainsMono Nerd Font family: JetBrainsMonoNL Nerd Font Mono
# Style can be specified to pick a specific face. # Style can be specified to pick a specific face.
style: Italic style: Italic
@@ -74,144 +75,39 @@ font:
# Should display the render timer # Should display the render timer
debug.render_timer: false debug.render_timer: false
# https://github.com/catppuccin/alacritty # TokyoNight Alacritty Colors (storm)
colors: colors:
# Default colors
primary: primary:
background: "#1E1E2E" # base background: '0x24283b'
foreground: "#CDD6F4" # text foreground: '0xc0caf5'
# Bright and dim foreground colors
dim_foreground: "#CDD6F4" # text
bright_foreground: "#CDD6F4" # text
# Cursor colors
cursor:
text: "#1E1E2E" # base
cursor: "#F5E0DC" # rosewater
vi_mode_cursor:
text: "#1E1E2E" # base
cursor: "#B4BEFE" # lavender
# Search colors
search:
matches:
foreground: "#1E1E2E" # base
background: "#A6ADC8" # subtext0
focused_match:
foreground: "#1E1E2E" # base
background: "#A6E3A1" # green
footer_bar:
foreground: "#1E1E2E" # base
background: "#A6ADC8" # subtext0
# Keyboard regex hints
hints:
start:
foreground: "#1E1E2E" # base
background: "#F9E2AF" # yellow
end:
foreground: "#1E1E2E" # base
background: "#A6ADC8" # subtext0
# Selection colors
selection:
text: "#1E1E2E" # base
background: "#F5E0DC" # rosewater
# Normal colors # Normal colors
normal: normal:
black: "#45475A" # surface1 black: '0x1d202f'
red: "#F38BA8" # red red: '0xf7768e'
green: "#A6E3A1" # green green: '0x9ece6a'
yellow: "#F9E2AF" # yellow yellow: '0xe0af68'
blue: "#89B4FA" # blue blue: '0x7aa2f7'
magenta: "#F5C2E7" # pink magenta: '0xbb9af7'
cyan: "#94E2D5" # teal cyan: '0x7dcfff'
white: "#BAC2DE" # subtext1 white: '0xa9b1d6'
# Bright colors # Bright colors
bright: bright:
black: "#585B70" # surface2 black: '0x414868'
red: "#F38BA8" # red red: '0xf7768e'
green: "#A6E3A1" # green green: '0x9ece6a'
yellow: "#F9E2AF" # yellow yellow: '0xe0af68'
blue: "#89B4FA" # blue blue: '0x7aa2f7'
magenta: "#F5C2E7" # pink magenta: '0xbb9af7'
cyan: "#94E2D5" # teal cyan: '0x7dcfff'
white: "#A6ADC8" # subtext0 white: '0xc0caf5'
# Dim colors
dim:
black: "#45475A" # surface1
red: "#F38BA8" # red
green: "#A6E3A1" # green
yellow: "#F9E2AF" # yellow
blue: "#89B4FA" # blue
magenta: "#F5C2E7" # pink
cyan: "#94E2D5" # teal
white: "#BAC2DE" # subtext1
indexed_colors: indexed_colors:
- { index: 16, color: "#FAB387" } - { index: 16, color: '0xff9e64' }
- { index: 17, color: "#F5E0DC" } - { index: 17, color: '0xdb4b4b' }
# Visual Bell
#
# Any time the BEL code is received, Alacritty "rings" the visual bell. Once
# rung, the terminal background will be set to white and transition back to the
# default background color. You can control the rate of this transition by
# setting the `duration` property (represented in milliseconds). You can also
# configure the transition function by setting the `animation` property.
#
# Possible values for `animation`
# `Ease`
# `EaseOut`
# `EaseOutSine`
# `EaseOutQuad`
# `EaseOutCubic`
# `EaseOutQuart`
# `EaseOutQuint`
# `EaseOutExpo`
# `EaseOutCirc`
# `Linear`
#
# To completely disable the visual bell, set its duration to 0.
#
# visual_bell:
# animation: EaseOutExpo
# duration: 0
# Key bindings
#
# Each binding is defined as an object with some properties. Most of the
# properties are optional. All of the alphabetical keys should have a letter for
# the `key` value such as `V`. Function keys are probably what you would expect
# as well (F1, F2, ..). The number keys above the main keyboard are encoded as
# `Key1`, `Key2`, etc. Keys on the number pad are encoded `Number1`, `Number2`,
# etc. These all match the glutin::VirtualKeyCode variants.
#
# Possible values for `mods`
# `Command`, `Super` refer to the super/command/windows key
# `Control` for the control key
# `Shift` for the Shift key
# `Alt` and `Option` refer to alt/option
#
# mods may be combined with a `|`. For example, requiring control and shift
# looks like:
#
# mods: Control|Shift
#
# The parser is currently quite sensitive to whitespace and capitalization -
# capitalization must match exactly, and piped items must not have whitespace
# around them.
#
# Either an `action`, `chars`, or `command` field must be present.
# `action` must be one of `Paste`, `PasteSelection`, `Copy`, or `Quit`.
# `chars` writes the specified string every time that binding is activated.
# These should generally be escape sequences, but they can be configured to
# send arbitrary strings of bytes.
# `command` must be a map containing a `program` string, and `args` array of
# strings. For example:
# - { ... , command: { program: "alacritty", args: ["-e", "vttest"] } }
key_bindings: key_bindings:
- { key: V, mods: Command, action: Paste } - { key: V, mods: Command, action: Paste }
- { key: C, mods: Command, action: Copy } - { key: C, mods: Command, action: Copy }
@@ -261,7 +157,7 @@ key_bindings:
- { key: F10, chars: "\e[21~" } - { key: F10, chars: "\e[21~" }
- { key: F11, chars: "\e[23~" } - { key: F11, chars: "\e[23~" }
- { key: F12, chars: "\e[24~" } - { key: F12, chars: "\e[24~" }
- { key: Back, chars: "" } - { key: Back, chars: '' }
- { key: Back, mods: Alt, chars: "\e" } - { key: Back, mods: Alt, chars: "\e" }
- { key: Insert, chars: "\e[2~" } - { key: Insert, chars: "\e[2~" }
- { key: Delete, chars: "\e[3~" } - { key: Delete, chars: "\e[3~" }

View File

@@ -1,14 +1,14 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck source="../scripts/shared.sh" # shellcheck source="../scripts/shared.sh"
# shellcheck disable=1091,2139 # shellcheck disable=1091,2139
source "$DOTFILES/scripts/shared.sh" DOTFILES="$HOME/.dotfiles"
# Get installed php versions from brew and setup aliases # Get installed php versions from brew and setup aliases
function x-set-php-aliases function x-set-php-aliases
{ {
have brew && { have brew && {
local php_versions=() local php_versions=()
while IFS="" read -r line; do php_versions+=("$line"); done < <(brew list | grep '^php') while IFS="" read -r line; do php_versions+=("$line"); done < <(brew_installed | grep '^php')
php_error_reporting='-d error_reporting=22527' php_error_reporting='-d error_reporting=22527'
@@ -58,6 +58,9 @@ fi
# Be nice # Be nice
alias please="sudo " alias please="sudo "
# Color the grep output
alias grep='grep --color'
! have eza && alias ls='ls --color=auto' ! have eza && alias ls='ls --color=auto'
have eza && { have eza && {
alias ls='eza -h -s=type --git --icons --group-directories-first' alias ls='eza -h -s=type --git --icons --group-directories-first'
@@ -68,9 +71,12 @@ alias ..="cd .."
alias ...="cd ../.." alias ...="cd ../.."
alias ....="cd ../../.." alias ....="cd ../../.."
# Colors for ls # cd to git root directory
alias ll="ls -l" alias cdgr='cd "$(git root)"'
alias l="ls"
# Shortcuts for listing
alias ll="ls -la"
alias l="ls -a"
# Prevent common typos # Prevent common typos
alias cd..="cd .." alias cd..="cd .."
@@ -79,12 +85,6 @@ alias sl="ls"
# List only directories # List only directories
alias lsd="ls -lF | grep '^d'" alias lsd="ls -lF | grep '^d'"
# Recursively delete `.pyc` files
alias rmpyc="find . -type f -name '*.pyc' -ls -delete"
# Recursively delete `.DS_Store` files
alias rmds="find . -type f -name '*.DS_Store' -ls -delete"
# IP addresses # IP addresses
alias ip="dig +short myip.opendns.com @resolver1.opendns.com" alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
alias localip="ipconfig getifaddr en1" alias localip="ipconfig getifaddr en1"
@@ -106,9 +106,6 @@ alias updatedb="sudo /usr/libexec/locate.updatedb"
# Always return full history # Always return full history
alias history="history 1" alias history="history 1"
alias pip="pip3 "
alias python="python3 "
# tmux: automatically attach or create session with name 'main' # tmux: automatically attach or create session with name 'main'
alias tmux='tmux new-session -A -s main' alias tmux='tmux new-session -A -s main'
# tmux: attach or create new session # tmux: attach or create new session
@@ -118,6 +115,10 @@ alias ta='tmux attach || tmux'
alias watchx='watch -dpbc' alias watchx='watch -dpbc'
# delete .DS_Store files # delete .DS_Store files
alias zapds='find . -name ".DS_Store" -print -delete' alias zapds='find . -name ".DS_Store" -print -delete'
# Recursively delete `.pyc` files
alias zappyc="find . -type f -name '*.pyc' -ls -delete"
# Run all zaps
alias zapall="zapds && zappyc"
# tail with follow flag on # tail with follow flag on
alias t='tail -f' alias t='tail -f'
# directory usage, return only the total # directory usage, return only the total
@@ -136,8 +137,7 @@ alias code_scanner='docker run
alias zedit='$EDITOR ~/.dotfiles' alias zedit='$EDITOR ~/.dotfiles'
have irssi \ alias irssi="irssi --config=$XDG_CONFIG_HOME/irssi/config --home=$XDG_CONFIG_HOME/irssi"
&& alias irssi="irssi --config='$IRSSI_CONFIG_FILE' --home='$IRSSI_CONFIG_HOME'"
if [[ -f "$HOME/.aliases.local" ]]; then if [[ -f "$HOME/.aliases.local" ]]; then
# shellcheck disable=SC1091 # shellcheck disable=SC1091
@@ -146,3 +146,69 @@ fi
alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts" alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts"
alias svn="svn --config-dir $XDG_CONFIG_HOME/subversion" alias svn="svn --config-dir $XDG_CONFIG_HOME/subversion"
# Alacritty preexec hook to update dynamic title
preexec()
{
print -Pn "\e]0;$1%~\a"
}
# Update dotfiles
dfu()
{
(
cd "$DOTFILES" && git pull --ff-only && ./install -q
)
}
# Weather in Tampere, or other city
weather()
{
# https://github.com/chubin/wttr.in#usage
local city="${1:-Tampere}"
curl "http://wttr.in/${city// /+}?2nFQM&lang=fi"
}
# Docker
ssh-docker()
{
docker exec -it "$@" bash
}
# All the dig info
digga()
{
dig +nocmd "$1" any +multiline +noall +answer
}
# Rector project to php version 8.2 by default.
rector()
{
local php="${1:-82}"
docker run -v "$(pwd)":/project rector/rector:latest process \
"/project/$1" \
--set "php${php}" \
--autoload-file /project/vendor/autoload.php
}
# Commit everything
commit()
{
commitMessage="$*"
if [ "$commitMessage" = "" ]; then
commitMessage="Automated commit"
fi
git add .
eval "git commit -a -m '${commitMessage}'"
}
scheduler()
{
while :; do
php artisan schedule:run
echo "Sleeping 60 seconds..."
sleep 60
done
}

View File

@@ -1,4 +0,0 @@
#!/usr/bin/env bash
# Setting aliases for tunkki
alias nvim="/snap/nvim/current/usr/bin/nvim"

View File

@@ -6,7 +6,7 @@ colorize: true
# Which 'chroma' colorscheme should be applied to the output? # Which 'chroma' colorscheme should be applied to the output?
# Options are available here: # Options are available here:
# https://github.com/alecthomas/chroma/tree/master/styles # https://github.com/alecthomas/chroma/tree/master/styles
style: "catppuccin" style: 'catppuccin'
# Which 'chroma' "formatter" should be applied? # Which 'chroma' "formatter" should be applied?
# One of: "terminal", "terminal256", "terminal16m" # One of: "terminal", "terminal256", "terminal16m"
formatter: terminal256 formatter: terminal256
@@ -74,7 +74,6 @@ cheatpaths:
path: ~/.dotfiles/config/cheat/cheatsheets/tldr path: ~/.dotfiles/config/cheat/cheatsheets/tldr
tags: [tldr] tags: [tldr]
readonly: true readonly: true
# While it requires no configuration here, it's also worth noting that # While it requires no configuration here, it's also worth noting that
# cheat will automatically append directories named '.cheat' within the # cheat will automatically append directories named '.cheat' within the
# current working directory to the 'cheatpath'. This can be very useful if # current working directory to the 'cheatpath'. This can be very useful if

View File

@@ -3,8 +3,6 @@
# vim: filetype=zsh # vim: filetype=zsh
export DOTFILES="$HOME/.dotfiles" export DOTFILES="$HOME/.dotfiles"
source "$DOTFILES/scripts/shared.sh"
path_append "$DOTFILES/local/bin"
# Explicitly set XDG folders # Explicitly set XDG folders
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html # https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
@@ -17,17 +15,6 @@ export XDG_BIN_HOME="$HOME/.local/bin"
export XDG_CACHE_HOME="$HOME/.cache" export XDG_CACHE_HOME="$HOME/.cache"
export XDG_RUNTIME_DIR="$HOME/.local/run" export XDG_RUNTIME_DIR="$HOME/.local/run"
path_append "/opt/homebrew/bin"
have brew && eval "$(brew shellenv)"
path_append "/usr/local/bin"
path_append "$XDG_BIN_HOME"
# brew, https://brew.sh
have brew && {
have_brew python && path_append "$(brew --prefix python)/bin"
}
source "$DOTFILES/config/exports-shell" source "$DOTFILES/config/exports-shell"
source "$DOTFILES/config/exports-apps" source "$DOTFILES/config/exports-apps"

View File

@@ -2,9 +2,7 @@
# shellcheck shell=bash # shellcheck shell=bash
# shellcheck enable=external-sources # shellcheck enable=external-sources
# shellcheck disable=1091,2139 # shellcheck disable=1091,2139
# vim: filetype=zsh # vim: filetype=bash
export DOTFILES="$HOME/.dotfiles"
source "$DOTFILES/scripts/shared.sh"
# Antigen configuration # Antigen configuration
# https://github.com/zsh-users/antigen/wiki/Configuration # https://github.com/zsh-users/antigen/wiki/Configuration
@@ -17,41 +15,32 @@ export ANTIGEN_PLUGIN_RECEIPT_F=".local/share/antigen/antigen_plugin_lastupdate"
export ANSIBLE_HOME="$XDG_CONFIG_HOME/ansible" export ANSIBLE_HOME="$XDG_CONFIG_HOME/ansible"
export ANSIBLE_CONFIG="$XDG_CONFIG_HOME/ansible.cfg" export ANSIBLE_CONFIG="$XDG_CONFIG_HOME/ansible.cfg"
export ANSIBLE_GALAXY_CACHE_DIR="$XDG_CACHE_HOME/ansible/galaxy_cache" export ANSIBLE_GALAXY_CACHE_DIR="$XDG_CACHE_HOME/ansible/galaxy_cache"
have ansible && { x-dc "$ANSIBLE_HOME"
x-dc "$ANSIBLE_HOME" x-dc "$ANSIBLE_GALAXY_CACHE_DIR"
x-dc "$ANSIBLE_GALAXY_CACHE_DIR"
}
export ANDROID_HOME="$XDG_DATA_HOME/android" export ANDROID_HOME="$XDG_DATA_HOME/android"
# bob manages nvim versions
path_prepend "$XDG_DATA_HOME/bob/nvim-bin"
have nvim && export EDITOR="nvim"
export HOMEBREW_NO_ENV_HINTS=true export HOMEBREW_NO_ENV_HINTS=true
# composer, https://getcomposer.org/ # composer, https://getcomposer.org/
export COMPOSER_HOME="$XDG_STATE_HOME/composer" export COMPOSER_HOME="$XDG_STATE_HOME/composer"
export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin" export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin"
have composer && { path_append "$COMPOSER_BIN"
export PATH="$COMPOSER_BIN:$PATH"
}
# docker, https://docs.docker.com/engine/reference/commandline/cli/ # docker, https://docs.docker.com/engine/reference/commandline/cli/
export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker" export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker"
have docker && { x-dc "$DOCKER_CONFIG"
x-dc "$DOCKER_CONFIG" # Docker: Disable snyk ad
# Docker: Disable snyk ad export DOCKER_SCAN_SUGGEST=false
export DOCKER_SCAN_SUGGEST=false
}
# ffmpeg # ffmpeg
export FFMPEG_DATADIR="$XDG_CONFIG_HOME/ffmpeg" export FFMPEG_DATADIR="$XDG_CONFIG_HOME/ffmpeg"
have ffmpeg && x-dc "$FFMPEG_DATADIR" have ffmpeg && x-dc "$FFMPEG_DATADIR"
# gcloud
have gcloud && {
GCLOUD_LOC=$(gcloud info --format="value(installation.sdk_root)" --quiet)
[[ -f "$GCLOUD_LOC/path.zsh.inc" ]] && builtin source "$GCLOUD_LOC/path.zsh.inc"
[[ -f "$GCLOUD_LOC/completion.zsh.inc" ]] && builtin source "$GCLOUD_LOC/completion.zsh.inc"
}
# GnuPG # GnuPG
export GNUPGHOME="$XDG_DATA_HOME/gnupg" export GNUPGHOME="$XDG_DATA_HOME/gnupg"
@@ -59,29 +48,11 @@ export GNUPGHOME="$XDG_DATA_HOME/gnupg"
export GOPATH="$XDG_DATA_HOME/go" export GOPATH="$XDG_DATA_HOME/go"
export GOBIN="$XDG_BIN_HOME" export GOBIN="$XDG_BIN_HOME"
# irssi
have irssi && {
# These variables are used in ./alias with --config and --home
export IRSSI_CONFIG_HOME="$XDG_CONFIG_HOME/irssi"
export IRSSI_CONFIG_FILE="$IRSSI_CONFIG_HOME/config"
x-dc "$IRSSI_CONFIG_HOME"
}
# nb, https://xwmx.github.io/nb/ # nb, https://xwmx.github.io/nb/
export NBRC_PATH="$XDG_CONFIG_HOME/nbrc" export NBRC_PATH="$XDG_CONFIG_HOME/nbrc"
export NB_DIR="$XDG_STATE_HOME/nb" export NB_DIR="$XDG_STATE_HOME/nb"
# nvm, the node version manager # NPM: Add npm packages to path
export NVM_LAZY_LOAD=true
export NVM_COMPLETION=true
export NVM_AUTO_USE=true
export NVM_DIR="$XDG_CONFIG_HOME/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME"/npm/npmrc
# Add npm packages to path
have node && { have node && {
NVM_NODE_BIN_DIR="$(dirname "$(which node)")" NVM_NODE_BIN_DIR="$(dirname "$(which node)")"
path_append "$NVM_NODE_BIN_DIR" path_append "$NVM_NODE_BIN_DIR"
@@ -90,8 +61,10 @@ have node && {
# op (1Password cli) is present # op (1Password cli) is present
export OP_CACHE="$XDG_STATE_HOME/1password" export OP_CACHE="$XDG_STATE_HOME/1password"
have op && { have op && {
eval "$(op completion zsh)" [ "$DOTFILES_CURRENT_SHELL" = "zsh" ] && {
compdef _op op eval "$(op completion zsh)"
compdef _op op
}
} }
# Python # Python
@@ -100,8 +73,7 @@ have op && {
export WORKON_HOME="$XDG_DATA_HOME/virtualenvs" export WORKON_HOME="$XDG_DATA_HOME/virtualenvs"
export PYENV_ROOT="$XDG_STATE_HOME/pyenv" export PYENV_ROOT="$XDG_STATE_HOME/pyenv"
have pyenv && { have pyenv && {
path_append "$(pyenv root)/shims" path_append "$PYENV_ROOT/shims"
path_append "$PYENV_ROOT/bin"
eval "$(pyenv init -)" eval "$(pyenv init -)"
} }
@@ -115,8 +87,11 @@ export BUNDLE_USER_CACHE="$XDG_CACHE_HOME"/bundle
export BUNDLE_USER_PLUGIN="$XDG_DATA_HOME"/bundle export BUNDLE_USER_PLUGIN="$XDG_DATA_HOME"/bundle
export RBENV_ROOT="$XDG_STATE_HOME/rbenv" export RBENV_ROOT="$XDG_STATE_HOME/rbenv"
x-dc "$RBENV_ROOT" x-dc "$RBENV_ROOT"
have gem && path_append "$(gem environment gemdir)/bin" have gem && path_append "${GEM_HOME}/bin"
have rbenv && eval "$(rbenv init - zsh)" have rbenv && {
[ "$DOTFILES_CURRENT_SHELL" = "zsh" ] && eval "$(rbenv init - zsh)"
[ "$DOTFILES_CURRENT_SHELL" = "bash" ] && eval "$(rbenv init - bash)"
}
# Rust / cargo # Rust / cargo
export RUSTUP_HOME="$XDG_DATA_HOME/rustup" export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
@@ -139,10 +114,6 @@ export TMUX_CONF="$XDG_CONFIG_HOME/tmux/tmux.conf"
export WAKATIME_HOME="$XDG_STATE_HOME/wakatime" export WAKATIME_HOME="$XDG_STATE_HOME/wakatime"
x-dc "$WAKATIME_HOME" x-dc "$WAKATIME_HOME"
# z, https://github.com/rupa/z
export _Z_DATA="$XDG_STATE_HOME/z"
[[ -f "$XDG_BIN_HOME/z/z.sh" ]] && source "$XDG_BIN_HOME/z/z.sh"
# Misc # Misc
export BAT_THEME="ansi" export BAT_THEME="ansi"
export CHEAT_USE_FZF=true export CHEAT_USE_FZF=true

View File

@@ -3,5 +3,18 @@
## LUA ## LUA
have luarocks && $(luarocks path --bin) have luarocks && $(luarocks path --bin)
path_append "$HOME/.local/go/bin" path_prepend "$HOME/.local/go/bin"
alias logrotate='/usr/sbin/logrotate -s $HOME/logs/state'
alias nano='nano -wS -$'
alias gpg=gpg2
ACME_PATH="$HOME/.acme.sh"
# shellcheck source=$HOME/.acme.sh/acme.sh.env
[[ -s "$ACME_PATH/acme.sh.env" ]] && . "$ACME_PATH/acme.sh.env"
export RVM_PATH="$HOME/.rvm"
export PATH="$RVM_PATH/bin:$PATH"
# shellcheck source=$HOME/.rvm/scripts/rvm
[[ -s "$RVM_PATH/scripts/rvm" ]] && source "$RVM_PATH/scripts/rvm" # Load RVM into a shell session *as a function*

View File

@@ -1,9 +1,20 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck shell=bash # shellcheck shell=bash
# shellcheck disable=1091,2046 # shellcheck disable=1091,2046
# vim: filetype=zsh # vim: filetype=bash
export DOTFILES="$HOME/.dotfiles" export DOTFILES="$HOME/.dotfiles"
source "$DOTFILES/scripts/shared.sh"
# Explicitly set XDG folders
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_STATE_HOME="$HOME/.local/state"
# custom variables
export XDG_BIN_HOME="$HOME/.local/bin"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_RUNTIME_DIR="$HOME/.local/run"
export LC_ALL=fi_FI.UTF-8 export LC_ALL=fi_FI.UTF-8
@@ -23,9 +34,16 @@ export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help"
# And include the parameter for ZSH # And include the parameter for ZSH
export HISTORY_IGNORE="(ls|cd|cd -|pwd|exit|date|* --help)" export HISTORY_IGNORE="(ls|cd|cd -|pwd|exit|date|* --help)"
# Less history location
export LESSHISTFILE="$XDG_STATE_HOME"/less/history
# Highlight section titles in manual pages # Highlight section titles in manual pages
export LESS_TERMCAP_md="$ORANGE" export LESS_TERMCAP_md="$ORANGE"
# zsh autoloaded terminfo
export TERMINFO="$XDG_DATA_HOME"/terminfo
export TERMINFO_DIRS="$XDG_DATA_HOME"/terminfo:/usr/share/terminfo
# Dont clear the screen after quitting a manual page # Dont clear the screen after quitting a manual page
export MANPAGER="less -X" export MANPAGER="less -X"
@@ -36,29 +54,32 @@ export GREP_OPTIONS="--color=auto"
# update the values of LINES and COLUMNS. # update the values of LINES and COLUMNS.
hash shopt 2> /dev/null && shopt -s checkwinsize hash shopt 2> /dev/null && shopt -s checkwinsize
# Load iterm2 shell integration
# https://iterm2.com/documentation-shell-integration.html
[[ -f "$XDG_BIN_HOME/iterm2_shell_integration.zsh" ]] \
&& source "$XDG_BIN_HOME/iterm2_shell_integration.zsh"
# Set dircolors based on the file, if it exists # Set dircolors based on the file, if it exists
have dircolors && eval $(dircolors "$XDG_CONFIG_HOME/dircolors") have dircolors && eval $(dircolors "$XDG_CONFIG_HOME/dircolors")
# If we are using zsh, color our dir lists and such # If we are using zsh, color our dir lists and such
if [ "$SHELL" = "$(which zsh)" ]; then if [ "$DOTFILES_CURRENT_SHELL" = "-zsh" ]; then
x-dc "$XDG_CACHE_HOME/zsh" [[ $ZSH_VERSION != "" ]] && {
x-dc "$XDG_STATE_HOME/zsh" autoload -U colors zsh/terminfo compinit
export HISTFILE="$XDG_STATE_HOME/zsh/history" colors
zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/zcompcache" compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION"
zstyle ':completion:*' list-colors "$LS_COLORS"
# fzf x-dc "$XDG_CACHE_HOME/zsh"
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh ] \ x-dc "$XDG_STATE_HOME/zsh"
&& source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh export HISTFILE="$XDG_STATE_HOME/zsh/history"
zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/zcompcache"
zstyle ':completion:*' list-colors "$LS_COLORS"
# Load iterm2 shell integration
# https://iterm2.com/documentation-shell-integration.html
[[ -f "$XDG_BIN_HOME/iterm2_shell_integration.zsh" ]] \
&& source "$XDG_BIN_HOME/iterm2_shell_integration.zsh"
}
fi fi
# If we are using bash # If we are using bash
if [ "$SHELL" = "$(which bash)" ]; then if [ "$DOTFILES_CURRENT_SHELL" = "bash" ]; then
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash ] \ # shellcheck source=../config/fzf/fzf.bash
&& source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash [ -f "${DOTFILES}/config/fzf/fzf.bash" ] &&
source "${DOTFILES}/config/fzf/fzf.bash"
fi fi

View File

@@ -1,87 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# shell functions # shell functions
#
# shellcheck source="../scripts/shared.sh"
export DOTFILES="$HOME/.dotfiles"
source "$DOTFILES/scripts/shared.sh"
# Weather in Tampere, or other city
weather()
{
# https://github.com/chubin/wttr.in#usage
local city="${1:-Tampere}"
curl "http://wttr.in/${city// /+}?2nFQM&lang=fi"
}
# Docker
ssh-docker()
{
docker exec -it "$@" bash
}
# All the dig info
digga()
{
dig +nocmd "$1" any +multiline +noall +answer
}
# Rector project to php version 8.2 by default.
rector()
{
local php="${1:-82}"
docker run -v "$(pwd)":/project rector/rector:latest process \
"/project/$1" \
--set "php${php}" \
--autoload-file /project/vendor/autoload.php
}
# Commit everything
commit()
{
commitMessage="$*"
if [ "$commitMessage" = "" ]; then
commitMessage="Automated commit"
fi
git add .
eval "git commit -a -m '${commitMessage}'"
}
scheduler()
{
while :; do
php artisan schedule:run
echo "Sleeping 60 seconds..."
sleep 60
done
}
# Defines default antigen bundles
x-default-antigen-bundles()
{
export ZSH_TMUX_AUTOSTART=false
export ZSH_TMUX_CONFIG="$DOTFILES/config/tmux/tmux.conf"
export ZSH_TMUX_UNICODE=true
export ZSH_TMUX_AUTOQUIT=false
export ZSH_TMUX_DEFAULT_SESSION_NAME=main
# these should be always available
antigen bundle tmux
antigen bundle colored-man-pages
antigen bundle command-not-found
antigen bundle ssh-agent
antigen bundle jreese/zsh-titles
antigen bundle unixorn/autoupdate-antigen.zshplugin
antigen bundle zsh-users/zsh-completions
antigen bundle zsh-users/zsh-syntax-highlighting
# these should be available if there's need
have brew && antigen bundle brew
# have nvm && antigen bundle nvm
have nvm && antigen bundle "$DOTFILES/config/zsh/plugins/nvm-auto-use"
have php && antigen bundle php
have python && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
have rvm && antigen bundle unixorn/rvm-plugin
}

View File

@@ -1,19 +1,19 @@
check_for_updates: true check_for_updates: true
excluded_labels: excluded_labels:
- maintenance - maintenance
- dependencies - dependencies
file_name: CHANGELOG.md file_name: CHANGELOG.md
logger: spinner logger: spinner
no_color: false no_color: false
sections: sections:
added: added:
- feature - feature
- enhancement - enhancement
changed: changed:
- backwards-incompatible - backwards-incompatible
fixed: fixed:
- bug - bug
- bugfix - bugfix
- documentation - documentation
show_unreleased: true show_unreleased: true
skip_entries_without_label: false skip_entries_without_label: false

View File

@@ -1,17 +1,17 @@
prSections: prSections:
- title: My Pull Requests - title: My Pull Requests
filters: is:open author:@me filters: is:open author:@me
- title: Needs My Review - title: Needs My Review
filters: is:open review-requested:@me filters: is:open review-requested:@me
- title: Involved - title: Involved
filters: is:open involves:@me -author:@me filters: is:open involves:@me -author:@me
issuesSections: issuesSections:
- title: My Issues - title: My Issues
filters: is:open author:@me filters: is:open author:@me
- title: Assigned - title: Assigned
filters: is:open assignee:@me filters: is:open assignee:@me
- title: Involved - title: Involved
filters: is:open involves:@me -author:@me filters: is:open involves:@me -author:@me
defaults: defaults:
preview: preview:
open: true open: true
@@ -51,4 +51,4 @@ keybindings:
prs: [] prs: []
repoPaths: {} repoPaths: {}
pager: pager:
diff: "" diff: ''

View File

@@ -1,3 +1,3 @@
github.com: github.com:
user: ivuorinen user: ivuorinen
git_protocol: https git_protocol: https

View File

@@ -5,6 +5,9 @@
name = Ismo Vuorinen name = Ismo Vuorinen
email = ismo@ivuorinen.net email = ismo@ivuorinen.net
[github]
user = ivuorinen
[include] [include]
path = ~/.config/git/overrides/config path = ~/.config/git/overrides/config

View File

@@ -200,8 +200,6 @@ brew "m-cli"
brew "mas" brew "mas"
# NCurses Disk Usage # NCurses Disk Usage
brew "ncdu" brew "ncdu"
# Ambitious Vim-fork focused on extensibility and agility
brew "neovim"
# HTTP(S) server and reverse proxy, and IMAP/POP3 proxy server # HTTP(S) server and reverse proxy, and IMAP/POP3 proxy server
brew "nginx" brew "nginx"
# Port scanning utility for large networks # Port scanning utility for large networks

318
config/irssi/config Normal file
View File

@@ -0,0 +1,318 @@
servers = (
{ address = "irc.dal.net"; chatnet = "DALnet"; port = "6667"; },
{
address = "ssl.efnet.org";
chatnet = "EFNet";
port = "9999";
use_tls = "yes";
tls_verify = "no";
},
{
address = "irc.esper.net";
chatnet = "EsperNet";
port = "6697";
use_tls = "yes";
tls_verify = "yes";
},
{
address = "irc.libera.chat";
chatnet = "liberachat";
port = "6697";
use_tls = "yes";
tls_verify = "yes";
},
{
address = "irc.gamesurge.net";
chatnet = "GameSurge";
port = "6667";
},
{
address = "ssl.ircnet.ovh";
chatnet = "IRCnet";
port = "6697";
use_tls = "yes";
tls_verify = "yes";
},
{ address = "open.ircnet.net"; chatnet = "IRCnet"; port = "6667"; },
{
address = "irc.ircsource.net";
chatnet = "IRCSource";
port = "6667";
},
{ address = "irc.netfuze.net"; chatnet = "NetFuze"; port = "6667"; },
{
address = "irc.oftc.net";
chatnet = "OFTC";
port = "6697";
use_tls = "yes";
tls_verify = "yes";
},
{
address = "irc.quakenet.org";
chatnet = "QuakeNet";
port = "6667";
},
{
address = "irc.rizon.net";
chatnet = "Rizon";
port = "6697";
use_tls = "yes";
tls_verify = "yes";
},
{ address = "silc.silcnet.org"; chatnet = "SILC"; port = "706"; },
{
address = "irc.undernet.org";
chatnet = "Undernet";
port = "6667";
}
);
chatnets = {
DALnet = {
type = "IRC";
max_kicks = "4";
max_msgs = "20";
max_whois = "30";
};
EFNet = {
type = "IRC";
max_kicks = "1";
max_msgs = "4";
max_whois = "1";
};
EsperNet = {
type = "IRC";
max_kicks = "1";
max_msgs = "4";
max_whois = "1";
};
liberachat = {
type = "IRC";
max_kicks = "1";
max_msgs = "4";
max_whois = "1";
};
GameSurge = {
type = "IRC";
max_kicks = "1";
max_msgs = "1";
max_whois = "1";
};
IRCnet = {
type = "IRC";
max_kicks = "1";
max_msgs = "1";
max_whois = "1";
};
IRCSource = {
type = "IRC";
max_kicks = "1";
max_msgs = "4";
max_whois = "1";
};
NetFuze = {
type = "IRC";
max_kicks = "1";
max_msgs = "1";
max_whois = "1";
};
OFTC = { type = "IRC"; max_kicks = "1"; max_msgs = "1"; max_whois = "1"; };
QuakeNet = {
type = "IRC";
max_kicks = "1";
max_msgs = "1";
max_whois = "1";
};
Rizon = {
type = "IRC";
max_kicks = "1";
max_msgs = "1";
max_whois = "1";
};
SILC = { type = "SILC"; };
Undernet = {
type = "IRC";
max_kicks = "1";
max_msgs = "1";
max_whois = "1";
};
};
channels = (
{ name = "#lobby"; chatnet = "EsperNet"; autojoin = "No"; },
{ name = "#libera"; chatnet = "liberachat"; autojoin = "No"; },
{ name = "#irssi"; chatnet = "liberachat"; autojoin = "No"; },
{ name = "#gamesurge"; chatnet = "GameSurge"; autojoin = "No"; },
{ name = "#irssi"; chatnet = "IRCNet"; autojoin = "No"; },
{ name = "#ircsource"; chatnet = "IRCSource"; autojoin = "No"; },
{ name = "#netfuze"; chatnet = "NetFuze"; autojoin = "No"; },
{ name = "#oftc"; chatnet = "OFTC"; autojoin = "No"; },
{ name = "silc"; chatnet = "SILC"; autojoin = "No"; }
);
aliases = {
ATAG = "WINDOW SERVER";
ADDALLCHANS = "SCRIPT EXEC foreach my \\$channel (Irssi::channels()) { Irssi::command(\"CHANNEL ADD -auto \\$channel->{visible_name} \\$channel->{server}->{tag} \\$channel->{key}\")\\;}";
B = "BAN";
BACK = "AWAY";
BANS = "BAN";
BYE = "QUIT";
C = "CLEAR";
CALC = "EXEC - if command -v bc >/dev/null 2>&1\\; then printf '%s=' '$*'\\; echo '$*' | bc -l\\; else echo bc was not found\\; fi";
CHAT = "DCC CHAT";
CS = "QUOTE CS";
DATE = "TIME";
DEHIGHLIGHT = "DEHILIGHT";
DESCRIBE = "ACTION";
DHL = "DEHILIGHT";
EXEMPTLIST = "MODE $C +e";
EXIT = "QUIT";
GOTO = "SCROLLBACK GOTO";
HIGHLIGHT = "HILIGHT";
HL = "HILIGHT";
HOST = "USERHOST";
INVITELIST = "MODE $C +I";
J = "JOIN";
K = "KICK";
KB = "KICKBAN";
KN = "KNOCKOUT";
LAST = "LASTLOG";
LEAVE = "PART";
M = "MSG";
MS = "QUOTE MS";
MUB = "UNBAN *";
N = "NAMES";
NMSG = "^MSG";
NS = "QUOTE NS";
OS = "QUOTE OS";
P = "PART";
Q = "QUERY";
RESET = "SET -default";
RUN = "SCRIPT LOAD";
SAY = "MSG *";
SB = "SCROLLBACK";
SBAR = "STATUSBAR";
SHELP = "QUOTE HELP";
SIGNOFF = "QUIT";
SV = "MSG * Irssi $J ($V) - https://irssi.org";
T = "TOPIC";
UB = "UNBAN";
UMODE = "MODE $N";
UNSET = "SET -clear";
W = "WHO";
WC = "WINDOW CLOSE";
WG = "WINDOW GOTO";
WJOIN = "JOIN -window";
WI = "WHOIS";
WII = "WHOIS $0 $0";
WL = "WINDOW LIST";
WN = "WINDOW NEW HIDDEN";
WQUERY = "QUERY -window";
WW = "WHOWAS";
};
statusbar = {
items = {
barstart = "{sbstart}";
barend = "{sbend}";
topicbarstart = "{topicsbstart}";
topicbarend = "{topicsbend}";
time = "{sb $Z}";
user = "{sb {sbnickmode $cumode}$N{sbmode $usermode}{sbaway $A}}";
window = "{sb $winref:$tag/$itemname{sbmode $M}}";
window_empty = "{sb $winref{sbservertag $tag}}";
prompt = "{prompt $[.15]itemname}";
prompt_empty = "{prompt $winname}";
topic = " $topic";
topic_empty = " Irssi v$J - https://irssi.org";
lag = "{sb Lag: $0-}";
act = "{sb Act: $0-}";
more = "-- more --";
};
default = {
window = {
disabled = "no";
type = "window";
placement = "bottom";
position = "1";
visible = "active";
items = {
barstart = { priority = "100"; };
time = { };
user = { };
window = { };
window_empty = { };
lag = { priority = "-1"; };
act = { priority = "10"; };
more = { priority = "-1"; alignment = "right"; };
barend = { priority = "100"; alignment = "right"; };
};
};
window_inact = {
type = "window";
placement = "bottom";
position = "1";
visible = "inactive";
items = {
barstart = { priority = "100"; };
window = { };
window_empty = { };
more = { priority = "-1"; alignment = "right"; };
barend = { priority = "100"; alignment = "right"; };
};
};
prompt = {
type = "root";
placement = "bottom";
position = "100";
visible = "always";
items = {
prompt = { priority = "-1"; };
prompt_empty = { priority = "-1"; };
input = { priority = "10"; };
};
};
topic = {
type = "root";
placement = "top";
position = "1";
visible = "always";
items = {
topicbarstart = { priority = "100"; };
topic = { };
topic_empty = { };
topicbarend = { priority = "100"; alignment = "right"; };
};
};
};
};
settings = {
core = {
real_name = "Ismo Vuorinen";
user_name = "ivuorinen";
nick = "ivuorinen";
};
"fe-common/core" = { theme = "lyynx"; };
};

View File

@@ -120,7 +120,7 @@ abstracts = {
# the basic styling of how to print message, $0 = nick mode, $1 = nick # the basic styling of how to print message, $0 = nick mode, $1 = nick
msgnick = "%K<%n$0$1-%K>%n %|"; msgnick = "%K<%n$0$1-%K>%n %|";
# message from you is printed. "msgownnick" specifies the styling of the # message from you is printed. "ownnick" specifies the styling of the
# nick ($0 part in msgnick) and "ownmsgnick" specifies the styling of the # nick ($0 part in msgnick) and "ownmsgnick" specifies the styling of the
# whole line. # whole line.
@@ -251,6 +251,7 @@ abstracts = {
# default background for all statusbars. You can also give # default background for all statusbars. You can also give
# the default foreground color for statusbar items. # the default foreground color for statusbar items.
sb_background = "%4%w"; sb_background = "%4%w";
window_border = "%4%w";
# default backround for "default" statusbar group # default backround for "default" statusbar group
#sb_default_bg = "%4"; #sb_default_bg = "%4";
@@ -261,8 +262,8 @@ abstracts = {
# background for topicbar (same default) # background for topicbar (same default)
#sb_topic_bg = "%4"; #sb_topic_bg = "%4";
# text at the beginning of statusbars. sb-item already puts # text at the beginning of statusbars. "sb" already puts a space there,
# space there,so we don't use anything by default. # so we don't use anything by default.
sbstart = ""; sbstart = "";
# text at the end of statusbars. Use space so that it's never # text at the end of statusbars. Use space so that it's never
# used for anything. # used for anything.

258
config/irssi/lyynx.theme Normal file
View File

@@ -0,0 +1,258 @@
# LyyNx.theme
# started this by editing agon.theme, but later i noticed that there
# was nothing left from agon :)
# so here it is. i use it with transparent aterm, tint - lightblue,
# shading - 99, foreground - lightyellow
default_color = "-1";
info_eol = "false";
replaces = { "[]=" = "%K$*%n"; };
abstracts = {
##
## generic
##
# text to insert at the beginning of each non-message line
line_start = ". ";
# timestamp styling, nothing by default
timestamp = "%w$*%n";
# any kind of text that needs hilighting, default is to bold
hilight = "%_$*%_";
# any kind of error message, default is bright red
error = "%r$*%n";
# channel name is printed
channel = "%w$0-%n";
# nick is printed
nick = "%_%n$*%_";
# nick host is printed
nickhost = "$*";
# server name is printed
server = "%_$*%_";
# some kind of comment is printed
comment = "$*";
# reason for something is printed (part, quit, kick, ..)
reason = "{comment}";
# mode change is printed ([+o nick])
mode = "{comment $*}";
##
## channel specific messages
##
# highlighted nick/host is printed (joins)
channick_hilight = "%c$0-%n";
chanhost_hilight = "{nickhost %w$0-%n}";
# nick/host is printed (parts, quits, etc.)
channick = "%c$*";
chanhost = "%w{nickhost $*}";
# highlighted channel name is printed
channelhilight = "%n$*%n";
# ban/ban exception/invite list mask is printed
ban = "%n$*%n";
##
## messages
##
# the basic styling of how to print message, $0 = nick mode, $1 = nick
msgnick = "%_%n$0%n$1-%w:%n ";
# message from you is printed. "msgownnick" specifies the styling of the
# nick ($0 part in msgnick) and "ownmsgnick" specifies the styling of the
# whole line.
# Example1: You want the message text to be green:
# ownmsgnick = "{msgnick $0 $1-}%g";
# Example2.1: You want < and> chars to be yellow:
# ownmsgnick = "%Y{msgnick $0 $1-%Y}%n";
# (you'll also have to remove <> from replaces list above)
# Example2.2: But you still want to keep <> grey for other messages:
# pubmsgnick = "%K{msgnick $0 $1-%K}%n";
# pubmsgmenick = "%K{msgnick $0 $1-%K}%n";
# pubmsghinick = "%K{msgnick $1 $0$2-%n%K}%n";
# ownprivmsgnick = "%K{msgnick $*%K}%n";
# privmsgnick = "%K{msgnick %R$*%K}%n";
# $0 = nick mod, $1 = nick
ownmsgnick = "%n{msgnick %n$0$1-%n}%w";
ownnick = "%w$*%n";
# public message in channel, $0 = nick mode, $1 = nick
pubmsgnick = "{msgnick %n$0 %b$1-}";
pubnick = "%w$*%n";
# public message in channel meant for me, $0 = nick mode, $1 = nick
pubmsgmenick = "{msgnick $0 $1-}";
menick = "%w$*";
# public highlighted message in channel
# $0 = highlight color, $1 = nick mode, $2 = nick
pubmsghinick = "{msgnick $1 $0$2-%n}";
# channel name is printed with message
msgchannel = "%K:%c$*%n";
# private message, $0 = nick, $1 = host
privmsg = "[%n$0%K(%W$1-%K)%n] ";
# private message from you, $0 = "msg", $1 = target nick
ownprivmsg = "[%n$0%K(%n$1-%K)%n] ";
# own private message in query
ownprivmsgnick = "{msgnick $*}%W";
ownprivnick = "%n$*%W";
# private message in query
privmsgnick = "{msgnick $*}";
##
## Actions (/ME stuff)
##
# used internally by this theme
action_core = "%c * $*";
# generic one that's used by most actions
action = "{action_core $*} ";
# own action, both private/public
ownaction = "{action $*}";
# own action with target, both private/public
ownaction_target = "{action_core $0}%K:%c$1%n ";
# private action sent by others
pvtaction = "%W (*) $*%n ";
pvtaction_query = "{action $*}";
# public action sent by others
pubaction = "{action $*}";
##
## other IRC events
##
# whois
whois = "$[8]0: $1-";
# notices
ownnotice = "[%n$0%K(%R$1-%K)]%n ";
notice = "%K-%C$*%K-%n ";
pubnotice_channel = "%K:%m$*";
pvtnotice_host = "%K(%m$*%K)";
servernotice = "%g!$*%n ";
# CTCPs
ownctcp = "[%y$0%K(%n$1-%K)] ";
ctcp = "%Y$*%n";
# wallops
wallop = "%W$*%n: ";
wallop_nick = "%n$*";
wallop_action = "%W * $*%n ";
# netsplits
netsplit = "%n$*%n";
netjoin = "%C$*%n";
# /names list
names_prefix = "";
names_nick = "%_$0%_$1- ";
names_nick_op = "{names_nick $*}";
names_nick_halfop = "{names_nick $*}";
names_nick_voice = "{names_nick $*}";
names_users = "%c$*%n";
names_channel = "%C$*%n";
# DCC
dcc = "%g$*%n";
dccfile = "%_$*%_";
# DCC chat, own msg/action
dccownmsg = "[%n$0%K($1-%K)%n] ";
dccownnick = "%n$*%n";
dccownquerynick = "%W$*%n";
dccownaction = "{action $*}";
dccownaction_target = "{action_core $0}%K:%c$1%n ";
# DCC chat, others
dccmsg = "[%G$1-%K(%g$0%K)%n] ";
dccquerynick = "%G$*%n";
dccaction = "%W (*dcc*) $*%n %|";
##
## statusbar
##
# default background for all statusbars. You can also give
# the default foreground color for statusbar items.
sb_background = "%N%w";
# default backround for "default" statusbar group
#sb_default_bg = "%4";
# background for prompt / input line
sb_prompt_bg = "%n";
# background for info statusbar
sb_info_bg = "%8";
# background for topicbar (same default)
#sb_topic_bg = "%4";
# text at the beginning of statusbars. sb-item already puts
# space there,so we don't use anything by default.
sbstart = "";
# text at the end of statusbars. Use space so that it's never
# used for anything.
sbend = " ";
topicsbstart = "{sbstart $*}";
topicsbend = "{sbend $*}";
prompt = "$* ";
sb = " %n$*%n";
sbmode = "";
#sbaway = " (%g[away]%n)";
sbservertag = " $0";
sbnickmode = "$0";
# activity in statusbar
# ',' separator
sb_act_sep = "%K$*";
# normal text
sb_act_text = "%w$*";
# public message
sb_act_msg = "%c$*";
# hilight
sb_act_hilight = "%C$*";
# hilight with specified color, $0 = color, $1 = text
sb_act_hilight_color = "$0$1-%n";
};
formats = {
"fe-common/core" = {
join = "%g{channick $0} {chanhost $1} %cgot in {channel $2}";
part = "%g{channick $0} {chanhost $1} %cgot out of%n $2";
kick = "%g{channick $2} kicked %g{channick $0} ($3)";
quit = "%g{channick $0} {chanhost $1} %cleft irc%n ($2)";
line_start_irssi = "{line_start}";
nick_changed = "%g{channick $0} --> {channick $1}";
new_topic = "%g{nick $0} topic change -> {channel $1} to: $2";
endofnames = "$1 nicks totaly - $2 ops, $3 voices and $4 normal";
timestamp = "{timestamp %%H:%%M:%%S} ";
};
};

View File

@@ -0,0 +1,129 @@
# /AUTOAWAY <n> - Mark user away after <n> seconds of inactivity
# /AWAY - play nice with autoaway
# New, brighter, whiter version of my autoaway script. Actually works :)
# (c) 2000 Larry Daffner (vizzie@airmail.net)
# You may freely use, modify and distribute this script, as long as
# 1) you leave this notice intact
# 2) you don't pretend my code is yours
# 3) you don't pretend your code is mine
#
# share and enjoy!
# A simple script. /autoaway <n> will mark you as away automatically if
# you have not typed any commands in <n> seconds. (<n>=0 disables the feature)
# It will also automatically unmark you away the next time you type a command.
# Note that using the /away command will disable the autoaway mechanism, as
# well as the autoreturn. (when you unmark yourself, the autoaway wil
# restart again)
# Thanks to Adam Monsen for multiserver and config file fix
use strict;
use Irssi;
use Irssi::Irc;
use vars qw($VERSION %IRSSI);
$VERSION = "0.5";
%IRSSI = (
authors => 'Larry "Vizzie" Daffner',
contact => 'vizzie@airmail.net',
name => 'Automagic away setting',
description => 'Automatically goes away after defined inactivity',
license => 'BSD',
url => 'http://www.flamingpackets.net/~vizzie/irssi/',
changed => '2018-12-02',
);
my ($autoaway_sec, $autoaway_to_tag, $autoaway_state);
$autoaway_state = 0;
#
# /AUTOAWAY - set the autoaway timeout
#
sub cmd_autoaway {
my ($data, $server, $channel) = @_;
if (!($data =~ /^[0-9]+$/)) {
Irssi::print("autoaway: usage: /autoaway <seconds>");
return 1;
}
$autoaway_sec = $data;
if ($autoaway_sec) {
Irssi::settings_set_int("autoaway_timeout", $autoaway_sec);
Irssi::print("autoaway timeout set to $autoaway_sec seconds");
} else {
Irssi::print("autoway disabled");
}
if (defined($autoaway_to_tag)) {
Irssi::timeout_remove($autoaway_to_tag);
$autoaway_to_tag = undef;
}
if ($autoaway_sec) {
$autoaway_to_tag =
Irssi::timeout_add($autoaway_sec*1000, "auto_timeout", "");
}
}
#
# away = Set us away or back, within the autoaway system
sub cmd_away {
my ($data, $server, $channel) = @_;
if ($data eq "") {
$autoaway_state = 0;
} else {
if ($autoaway_state eq 0) {
Irssi::timeout_remove($autoaway_to_tag);
$autoaway_to_tag = undef;
$autoaway_state = 2;
}
}
}
sub auto_timeout {
my ($data, $server) = @_;
# we're in the process.. don't touch anything.
$autoaway_state = 3;
foreach my $server (Irssi::servers()) {
$server->command("/AWAY autoaway after $autoaway_sec seconds");
}
Irssi::timeout_remove($autoaway_to_tag);
$autoaway_state = 1;
}
sub reset_timer {
if ($autoaway_state eq 1) {
$autoaway_state = 3;
foreach my $server (Irssi::servers()) {
$server->command("/AWAY");
}
$autoaway_state = 0;
}
if ($autoaway_state eq 0) {
if (defined($autoaway_to_tag)) {
Irssi::timeout_remove($autoaway_to_tag);
$autoaway_to_tag = undef();
}
if ($autoaway_sec) {
$autoaway_to_tag = Irssi::timeout_add($autoaway_sec*1000, "auto_timeout", "");
}
}
}
Irssi::settings_add_int("misc", "autoaway_timeout", 0);
$autoaway_sec = Irssi::settings_get_int("autoaway_timeout");
reset_timer();
Irssi::command_bind('autoaway', 'cmd_autoaway');
Irssi::command_bind('away', 'cmd_away');
Irssi::signal_add('send command', 'reset_timer');
# vim:set expandtab ts=2 sw=2:

View File

@@ -0,0 +1,39 @@
# /WHOIS all the users who send you a private message.
# v1.1 for irssi 0.7.98 by Timo Sirainen
use strict;
use Irssi;
use vars qw($VERSION %IRSSI);
$VERSION = "1.1";
%IRSSI = (
authors => "Timo \'cras\' Sirainen",
contact => "tss\@iki.fi",
name => "autowhois",
description => "/WHOIS all the users who send you a private message.",
license => "Public Domain",
url => "http://irssi.org/",
changed => "2002-03-04T22:47+0100",
changes => "v1.1: don't /WHOIS if query exists for the nick already"
);
# History:
# v1.1: don't /WHOIS if query exists for the nick already
my ($lastfrom, $lastquery);
sub msg_private_first {
my ($server, $msg, $nick, $address) = @_;
$lastquery = $server->query_find($nick);
}
sub msg_private {
my ($server, $msg, $nick, $address) = @_;
return if $lastquery || $lastfrom eq $nick;
$lastfrom = $nick;
$server->command("whois $nick");
}
Irssi::signal_add_first('message private', 'msg_private_first');
Irssi::signal_add('message private', 'msg_private');

View File

@@ -0,0 +1,115 @@
use strict;
use vars qw($VERSION %IRSSI);
use Irssi;
use Irssi::Irc;
# Usage:
# /script load go.pl
# If you are in #irssi you can type /go #irssi or /go irssi or even /go ir ...
# also try /go ir<tab> and /go <tab> (that's two spaces)
#
# The following settings exist:
#
# /SET go_match_case_sensitive [ON|OFF]
# Match window/item names sensitively (the default). Turning this off
# means e.g. "/go foo" would jump to a window named "Foobar", too.
#
# /SET go_match_anchored [ON|OFF]
# Match window/names only at the start of the word (the default). Turning
# this off will mean that strings can match anywhere in the window/names.
# The leading '#' of channel names is optional either way.
#
# /SET go_complete_case_sensitive [ON|OFF]
# When using tab-completion, match case-insensitively (the default).
# Turning this on means that "/go foo<tab>" will *not* suggest "Foobar".
#
# /SET go_complete_anchored [ON|OFF]
# Match window/names only at the start of the word. The default is 'off',
# which causes completion to match anywhere in the window/names during
# completion. The leading '#' of channel names is optional either way.
#
$VERSION = '1.1.1';
%IRSSI = (
authors => 'nohar',
contact => 'nohar@freenode',
name => 'go to window',
description => 'Implements /go command that activates a window given a name/partial name. It features a nice completion.',
license => 'GPLv2 or later',
changed => '2019-02-25'
);
sub _make_regexp {
my ($name, $ci, $aw) = @_;
my $re = "\Q${name}\E";
$re = "(?i:$re)" unless $ci;
$re = "^#?$re" if $aw;
return $re;
}
sub signal_complete_go {
my ($complist, $window, $word, $linestart, $want_space) = @_;
my $channel = $window->get_active_name();
my $k = Irssi::parse_special('$k');
return unless ($linestart =~ /^\Q${k}\Ego\b/i);
my $re = _make_regexp($word,
Irssi::settings_get_bool('go_complete_case_sensitive'),
Irssi::settings_get_bool('go_complete_anchored'));
@$complist = ();
foreach my $w (Irssi::windows) {
my $name = $w->get_active_name();
if ($word ne "") {
if ($name =~ $re) {
push(@$complist, $name)
}
} else {
push(@$complist, $name);
}
}
Irssi::signal_stop();
};
sub cmd_go
{
my($chan,$server,$witem) = @_;
my $case_sensitive = Irssi::settings_get_bool('go_match_case_sensitive');
my $match_anchored = Irssi::settings_get_bool('go_match_anchored');
$chan =~ s/ *//g;
my $re = _make_regexp($chan, $case_sensitive, $match_anchored);
my @matches;
foreach my $w (Irssi::windows) {
my $name = $w->get_active_name();
if (($case_sensitive && $name eq $chan) ||
(!$case_sensitive && CORE::fc $name eq CORE::fc $chan)) {
$w->set_active();
return;
} elsif ($name =~ /$re/) {
push(@matches, $w);
}
}
if (@matches) {
$matches[0]->set_active();
}
}
Irssi::command_bind("go", "cmd_go");
Irssi::signal_add_first('complete word', 'signal_complete_go');
Irssi::settings_add_bool('go', 'go_match_case_sensitive', 1);
Irssi::settings_add_bool('go', 'go_complete_case_sensitive', 0);
Irssi::settings_add_bool('go', 'go_match_anchored', 1);
Irssi::settings_add_bool('go', 'go_complete_anchored', 0);
# Changelog
#
# 2017-02-02 1.1 martin f. krafft <madduck@madduck.net>
# - made case-sensitivity of match configurable
# - made anchoring of search strings configurable
#
# 2019-02-025 1.1.1 dylan lloyd <dylan@disinclined.org>
# - prefer exact channel matches

View File

@@ -0,0 +1,113 @@
use strict;
use Irssi;
use Irssi::Irc;
use vars qw($VERSION %IRSSI);
$VERSION = "1.0";
%IRSSI = (
"authors" => "Mantis",
"contact" => "mantis\@inta-link.com",
"name" => "highlite",
"description" => "shows events happening in all channels you are in that may concern you",
"url" => "http://www.inta-link.com/",
"license" => "GNU GPL v2",
"changed" => "2003-01-03"
);
sub msg_join
{
my ($server, $channame, $nick, $host) = @_;
$channame =~ s/^://;
my $windowname = Irssi::window_find_name('highlite');
$windowname->print("%B%0JOIN : " . $nick . " : " . $channame . " : " . $host, MSGLEVEL_CLIENTCRAP) if ($windowname);
}
sub msg_part
{
my ($server, $channame, $nick, $host) = @_;
$channame =~ s/^://;
my $windowname = Irssi::window_find_name('highlite');
$windowname->print("%b%0PART : " . $nick . " : " . $channame . " : " . $host, MSGLEVEL_CLIENTCRAP) if ($windowname);
}
sub msg_quit
{
my ($server, $nick, $host, $quitmsg) = @_;
if (substr($quitmsg, 0, 14) eq "Read error to ")
{
$quitmsg = "[ General Read Error ]";
}
if (substr($quitmsg, 0, 17) eq "Ping timeout for ")
{
$quitmsg = "[ General Ping Timeout Error ]";
}
my $windowname = Irssi::window_find_name('highlite');
$windowname->print("%R%0QUIT : " . $nick . " : " . $host . " : " . $quitmsg, MSGLEVEL_CLIENTCRAP) if ($windowname);
$quitmsg = "";
}
sub msg_topic
{
my ($server, $channame, $topicmsg, $nick, $host) = @_;
$channame =~ s/^://;
my $windowname = Irssi::window_find_name('highlite');
$windowname->print("%G%0TOPIC : " . $nick . " : " . $channame . " : " . $topicmsg, MSGLEVEL_CLIENTCRAP) if ($windowname);
}
sub msg_nick
{
my ($server, $nick, $old_nick, $host) = @_;
my $windowname = Irssi::window_find_name('highlite');
$windowname->print("%m%0NICK : " . $old_nick . " : " . $nick . " : " . $host, MSGLEVEL_CLIENTCRAP) if ($windowname);
}
sub msg_kick
{
my ($server, $channame, $kicked, $nick, $host, $reason) = @_;
$channame =~ s/^://;
my $windowname = Irssi::window_find_name('highlite');
$windowname->print("%Y%0KICK : " . $kicked . " : " . $channame . " : " . $nick . " : " . $reason, MSGLEVEL_CLIENTCRAP) if ($windowname);
}
sub sig_printtext {
my ($dest, $text, $stripped) = @_;
if (($dest->{level} & (MSGLEVEL_HILIGHT|MSGLEVEL_MSGS)) && ($dest->{level} & MSGLEVEL_NOHILIGHT) == 0)
{
if ($dest->{level} & MSGLEVEL_PUBLIC)
{
my $windowname = Irssi::window_find_name('highlite');
$windowname->print("%W%0HIGHLITE : " . $dest->{target} . " : " . $text, MSGLEVEL_CLIENTCRAP) if ($windowname);
}
}
}
my $windowname = Irssi::window_find_name('highlite');
if (!$windowname)
{
Irssi::command("window new hidden");
Irssi::command("window name highlite");
}
Irssi::signal_add(
{
'message join' => \&msg_join,
'message part' => \&msg_part,
'message quit' => \&msg_quit,
'message topic' => \&msg_topic,
'print text', 'sig_printtext',
'message nick' => \&msg_nick,
'message kick' => \&msg_kick
}
);

View File

@@ -0,0 +1,257 @@
use strict;
use Irssi 20020101.0250 ();
use vars qw($VERSION %IRSSI);
$VERSION = "2.1";
%IRSSI = (
authors => "Timo Sirainen, Ian Peters, David Leadbeater, Bruno Cattáneo",
contact => "tss\@iki.fi",
name => "Nick Color",
description => "assign a different color for each nick",
license => "Public Domain",
url => "http://irssi.org/",
changed => "Mon 08 Jan 21:28:53 BST 2018",
);
# Tweaks to this plugin are:
# - Moved irssi folder under $XDG_CONFIG_HOME/irssi/
# - changed TABs to spaces
# Settings:
# nickcolor_colors: List of color codes to use.
# e.g. /set nickcolor_colors 2 3 4 5 6 7 9 10 11 12 13
# (avoid 8, as used for hilights in the default theme).
#
# nickcolor_enable_prefix: Enables prefix for same nick.
#
# nickcolor_enable_truncate: Enables nick truncation.
#
# nickcolor_prefix_text: Prefix text for succesive messages.
# e.g. /set nickcolor_prefix_text -
#
# nickcolor_truncate_value: Truncate nick value.
# e.g. /set nickcolor_truncate_value -7
# This will truncate nicknames at 7 characters and make them right aligned
my %saved_colors;
my %session_colors = {};
my %saved_nicks; # To store each channel's last nickname
sub load_colors {
open my $color_fh, "<", "$ENV{XDG_CONFIG_HOME}/irssi/saved_colors";
while (<$color_fh>) {
chomp;
my($nick, $color) = split ":";
$saved_colors{$nick} = $color;
}
}
sub save_colors {
open COLORS, ">", "$ENV{XDG_CONFIG_HOME}/irssi/saved_colors";
foreach my $nick (keys %saved_colors) {
print COLORS "$nick:$saved_colors{$nick}\n";
}
close COLORS;
}
# If someone we've colored (either through the saved colors, or the hash
# function) changes their nick, we'd like to keep the same color associated
# with them (but only in the session_colors, ie a temporary mapping).
sub sig_nick {
my ($server, $newnick, $nick, $address) = @_;
my $color;
$newnick = substr ($newnick, 1) if ($newnick =~ /^:/);
if ($color = $saved_colors{$nick}) {
$session_colors{$newnick} = $color;
} elsif ($color = $session_colors{$nick}) {
$session_colors{$newnick} = $color;
}
}
# This gave reasonable distribution values when run across
# /usr/share/dict/words
sub simple_hash {
my ($string) = @_;
chomp $string;
my @chars = split //, $string;
my $counter;
foreach my $char (@chars) {
$counter += ord $char;
}
my @colors = split / /, Irssi::settings_get_str('nickcolor_colors');
$counter = $colors[$counter % @colors];
return $counter;
}
# process public (others) messages
sub sig_public {
my ($server, $msg, $nick, $address, $target) = @_;
my $enable_prefix = Irssi::settings_get_bool('nickcolor_enable_prefix');
my $enable_truncate = Irssi::settings_get_bool('nickcolor_enable_truncate');
my $prefix_text = Irssi::settings_get_str('nickcolor_prefix_text');
my $truncate_value = Irssi::settings_get_int('nickcolor_truncate_value');
# Reference for server/channel
my $tagtarget = "$server->{tag}/$target";
# Set default nick truncate value to 0 if option is disabled
$truncate_value = 0 if (!$enable_truncate);
# Has the user assigned this nick a color?
my $color = $saved_colors{$nick};
# Have -we- already assigned this nick a color?
if (!$color) {
$color = $session_colors{$nick};
}
# Let's assign this nick a color
if (!$color) {
$color = simple_hash $nick;
$session_colors{$nick} = $color;
}
$color = sprintf "\003%02d", $color;
# Optional: We check if it's the same nickname for current target
if ($saved_nicks{$tagtarget} eq $nick && $enable_prefix)
{
# Grouped message
Irssi::command('/^format pubmsg ' . $prefix_text . '$1');
}
else
{
# Normal message
Irssi::command('/^format pubmsg {pubmsgnick $2 {pubnick ' . $color . '$[' . $truncate_value . ']0}}$1');
# Save nickname for next message
$saved_nicks{$tagtarget} = $nick;
}
}
# process public (me) messages
sub sig_me {
my ($server, $msg, $target) = @_;
my $nick = $server->{nick};
my $enable_prefix = Irssi::settings_get_bool('nickcolor_enable_prefix');
my $enable_truncate = Irssi::settings_get_bool('nickcolor_enable_truncate');
my $prefix_text = Irssi::settings_get_str('nickcolor_prefix_text');
my $truncate_value = Irssi::settings_get_int('nickcolor_truncate_value');
# Reference for server/channel
my $tagtarget = "$server->{tag}/$target";
# Set default nick truncate value to 0 if option is disabled
$truncate_value = 0 if (!$enable_truncate);
# Optional: We check if it's the same nickname for current target
if ($saved_nicks{$tagtarget} eq $nick && $enable_prefix)
{
# Grouped message
Irssi::command('/^format own_msg ' . $prefix_text . '$1');
}
else
{
# Normal message
Irssi::command('/^format own_msg {ownmsgnick $2 {ownnick $[' . $truncate_value . ']0}}$1');
# Save nickname for next message
$saved_nicks{$tagtarget} = $nick;
}
}
# process public (others) actions
sub sig_action_public {
my ($server, $msg, $nick, $address, $target) = @_;
my $enable_prefix = Irssi::settings_get_bool('nickcolor_enable_prefix');
# Reference for server/channel
my $tagtarget = "$server->{tag}/$target";
# Empty current target nick if prefix option is enabled
$saved_nicks{$tagtarget} = '' if ($enable_prefix);
}
# process public (me) actions
sub sig_action_me {
my ($server, $msg, $target) = @_;
my $nick = $server->{nick};
my $enable_prefix = Irssi::settings_get_bool('nickcolor_enable_prefix');
# Reference for server/channel
my $tagtarget = "$server->{tag}/$target";
# Empty current target nick if prefix option is enabled
$saved_nicks{$tagtarget} = '' if ($enable_prefix);
}
sub cmd_color {
my ($data, $server, $witem) = @_;
my ($op, $nick, $color) = split " ", $data;
$op = lc $op;
if (!$op) {
Irssi::print ("No operation given (save/set/clear/list/preview)");
} elsif ($op eq "save") {
save_colors;
} elsif ($op eq "set") {
if (!$nick) {
Irssi::print ("Nick not given");
} elsif (!$color) {
Irssi::print ("Color not given");
} elsif ($color < 2 || $color > 14) {
Irssi::print ("Color must be between 2 and 14 inclusive");
} else {
$saved_colors{$nick} = $color;
}
} elsif ($op eq "clear") {
if (!$nick) {
Irssi::print ("Nick not given");
} else {
delete ($saved_colors{$nick});
}
} elsif ($op eq "list") {
Irssi::print ("\nSaved Colors:");
foreach my $nick (keys %saved_colors) {
Irssi::print (chr (3) . sprintf("%02d", $saved_colors{$nick}) . "$nick" .
chr (3) . "1 ($saved_colors{$nick})");
}
} elsif ($op eq "preview") {
Irssi::print ("\nAvailable colors:");
foreach my $i (2..14) {
Irssi::print (chr (3) . "$i" . "Color #$i");
}
}
}
load_colors;
Irssi::settings_add_str('misc', 'nickcolor_colors', '2 3 4 5 6 7 9 10 11 12 13');
Irssi::settings_add_bool('misc', 'nickcolor_enable_prefix', 0);
Irssi::settings_add_bool('misc', 'nickcolor_enable_truncate', 0);
Irssi::settings_add_str('misc', 'nickcolor_prefix_text' => '- ');
Irssi::settings_add_int('misc', 'nickcolor_truncate_value' => 0);
Irssi::command_bind('color', 'cmd_color');
Irssi::signal_add('message public', 'sig_public');
Irssi::signal_add('message own_public', 'sig_me');
Irssi::signal_add('message irc action', 'sig_action_public');
Irssi::signal_add('message irc own_action', 'sig_action_me');
Irssi::signal_add('event nick', 'sig_nick');

View File

@@ -0,0 +1,606 @@
## trackbar.pl
#
# This little script will do just one thing: it will draw a line each time you
# switch away from a window. This way, you always know just upto where you've
# been reading that window :) It also removes the previous drawn line, so you
# don't see double lines.
#
# redraw trackbar only works on irssi 0.8.17 or higher.
#
##
## Usage:
#
# The script works right out of the box, but if you want you can change
# the working by /set'ing the following variables:
#
# Setting: trackbar_style
# Description: This setting will be the color of your trackbar line.
# By default the value will be '%K', only Irssi color
# formats are allowed. If you don't know the color formats
# by heart, you can take a look at the formats documentation.
# You will find the proper docs on http://www.irssi.org/docs.
#
# Setting: trackbar_string
# Description: This is the string that your line will display. This can
# be multiple characters or just one. For example: '~-~-'
# The default setting is '-'.
# Here are some unicode characters you can try:
# "───" => U+2500 => a line
# "═══" => U+2550 => a double line
# "━━━" => U+2501 => a wide line
# "▭ " => U+25ad => a white rectangle
#
# Setting: trackbar_use_status_window
# Description: If this setting is set to OFF, Irssi won't print a trackbar
# in the statuswindow
#
# Setting: trackbar_ignore_windows
# Description: A list of windows where no trackbar should be printed
#
# Setting: trackbar_print_timestamp
# Description: If this setting is set to ON, Irssi will print the formatted
# timestamp in front of the trackbar.
#
# Setting: trackbar_require_seen
# Description: Only clear the trackbar if it has been scrolled to.
#
# Setting: trackbar_all_manual
# Description: Never clear the trackbar until you do /mark.
#
# /mark is a command that will redraw the line at the bottom.
#
# Command: /trackbar, /trackbar goto
# Description: Jump to where the trackbar is, to pick up reading
#
# Command: /trackbar keep
# Description: Keep this window's trackbar where it is the next time
# you switch windows (then this flag is cleared again)
#
# Command: /mark, /trackbar mark
# Description: Remove the old trackbar and mark the bottom of this
# window with a new trackbar
#
# Command: /trackbar markvisible
# Description: Like mark for all visible windows
#
# Command: /trackbar markall
# Description: Like mark for all windows
#
# Command: /trackbar remove
# Description: Remove this window's trackbar
#
# Command: /trackbar removeall
# Description: Remove all windows' trackbars
#
# Command: /trackbar redraw
# Description: Force redraw of trackbars
#
##
##
#
# For bugreports and other improvements contact one of the authors.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
##
use strict;
use warnings;
use vars qw($VERSION %IRSSI);
$VERSION = "2.9"; # a4c78e85092a271
%IRSSI = (
authors => "Peter 'kinlo' Leurs, Uwe Dudenhoeffer, " .
"Michiel Holtkamp, Nico R. Wohlgemuth, " .
"Geert Hauwaerts",
contact => 'peter@pfoe.be',
patchers => 'Johan Kiviniemi (UTF-8), Uwe Dudenhoeffer (on-upgrade-remove-line)',
name => 'trackbar',
description => 'Shows a bar where you have last read a window.',
license => 'GNU General Public License',
url => 'http://www.pfoe.be/~peter/trackbar/',
commands => 'trackbar',
);
## Comments and remarks.
#
# This script uses settings.
# Use /SET to change the value or /TOGGLE to switch it on or off.
#
#
# Tip: The command 'trackbar' is very useful if you bind that to a key,
# so you can easily jump to the trackbar. Please see 'help bind' for
# more information about keybindings in Irssi.
#
# Command: /BIND meta2-P key F1
# /BIND F1 command trackbar
#
##
## Bugfixes and new items in this rewrite.
#
# * Remove all the trackbars before upgrading.
# * New setting trackbar_use_status_window to control the statuswindow trackbar.
# * New setting trackbar_print_timestamp to print a timestamp or not.
# * New command 'trackbar' to scroll up to the trackbar.
# * When resizing your terminal, Irssi will update all the trackbars to the new size.
# * When changing trackbar settings, change all the trackbars to the new settings.
# * New command 'trackbar mark' to draw a new trackbar (The old '/mark').
# * New command 'trackbar markall' to draw a new trackbar in each window.
# * New command 'trackbar remove' to remove the trackbar from the current window.
# * New command 'trackbar removeall' to remove all the trackbars.
# * Don't draw a trackbar in empty windows.
# * Added a version check to prevent Irssi redraw errors.
# * Fixed a bookmark NULL versus 0 bug.
# * Fixed a remove-line bug in Uwe Dudenhoeffer his patch.
# * New command 'help trackbar' to display the trackbar commands.
# * Fixed an Irssi startup bug, now processing each auto-created window.
#
##
## Known bugs and the todolist.
#
# Todo: * Instead of drawing a line, invert the line.
#
##
## Authors:
#
# - Main maintainer & author: Peter 'kinlo' Leurs
# - Many thanks to Timo 'cras' Sirainen for placing me on my way
# - on-upgrade-remove-line patch by Uwe Dudenhoeffer
# - trackbar resizing by Michiel Holtkamp (02 Jul 2012)
# - scroll to trackbar, window excludes, and timestamp options by Nico R.
# Wohlgemuth (22 Sep 2012)
#
##
## Version history:
#
# 2.9: - fix crash on /mark in empty window
# 2.8: - fix /^join bug
# 2.7: - add /set trackbar_all_manual option
# 2.5: - merge back on scripts.irssi.org
# - fix /trackbar redraw broken in 2.4
# - fix legacy encodings
# - add workaround for irssi issue #271
# 2.4: - add support for horizontal splits
# 2.3: - add some features for seen tracking using other scripts
# 2.0: - big rewrite based on 1.4
# * removed /tb, you can have it with /alias tb trackbar if you want
# * subcommand and settings changes:
# /trackbar vmark => /trackbar markvisible
# /trackbar scroll => /trackbar goto (or just /trackbar)
# /trackbar help => /help trackbar
# /set trackbar_hide_windows => /set trackbar_ignore_windows
# /set trackbar_timestamp => /set trackbar_print_timestamp
# * magic line strings were removed, just paste the unicode you want!
# * trackbar_timestamp_styled is not currently supported
# 1.9: - add version guard
# 1.8: - sub draw_bar
# 1.7: - Added /tb scroll, trackbar_hide_windows, trackbar_timestamp_timestamp
# and trackbar_timestamp_styled
# 1.6: - Work around Irssi resize bug, please do /upgrade! (see below)
# 1.5: - Resize trackbars in all windows when terminal is resized
# 1.4: - Changed our's by my's so the irssi script header is valid
# - Removed utf-8 support. In theory, the script should work w/o any
# problems for utf-8, just set trackbar_string to a valid utf-8 character
# and everything *should* work. However, this script is being plagued by
# irssi internal bugs. The function Irssi::settings_get_str does NOT handle
# unicode strings properly, hence you will notice problems when setting the bar
# to a unicode char. For changing your bar to utf-8 symbols, read the line sub.
# 1.3: - Upgrade now removes the trackbars.
# - Some code cleanups, other defaults
# - /mark sets the line to the bottom
# 1.2: - Support for utf-8
# - How the bar looks can now be configured with trackbar_string
# and trackbar_style
# 1.1: - Fixed bug when closing window
# 1.0: - Initial release
#
##
use Irssi;
use Irssi::TextUI;
use Encode;
use POSIX qw(strftime);
sub cmd_help {
my ($args) = @_;
if ($args =~ /^trackbar *$/i) {
print CLIENTCRAP <<HELP
%9Syntax:%9
TRACKBAR
TRACKBAR GOTO
TRACKBAR KEEP
TRACKBAR MARK
TRACKBAR MARKVISIBLE
TRACKBAR MARKALL
TRACKBAR REMOVE
TRACKBAR REMOVEALL
TRACKBAR REDRAW
%9Parameters:%9
GOTO: Jump to where the trackbar is, to pick up reading
KEEP: Keep this window's trackbar where it is the next time
you switch windows (then this flag is cleared again)
MARK: Remove the old trackbar and mark the bottom of this
window with a new trackbar
MARKVISIBLE: Like mark for all visible windows
MARKALL: Like mark for all windows
REMOVE: Remove this window's trackbar
REMOVEALL: Remove all windows' trackbars
REDRAW: Force redraw of trackbars
%9Description:%9
Manage a trackbar. Without arguments, it will scroll up to the trackbar.
%9Examples:%9
/TRACKBAR MARK
/TRACKBAR REMOVE
HELP
}
}
Irssi::theme_register([
'trackbar_loaded', '%R>>%n %_Scriptinfo:%_ Loaded $0 version $1 by $2.',
'trackbar_wrong_version', '%R>>%n %_Trackbar:%_ Please upgrade your client to 0.8.17 or above if you would like to use this feature of trackbar.',
'trackbar_all_removed', '%R>>%n %_Trackbar:%_ All the trackbars have been removed.',
'trackbar_not_found', '%R>>%n %_Trackbar:%_ No trackbar found in this window.',
]);
my $old_irssi = Irssi::version < 20140701;
sub check_version {
if ($old_irssi) {
Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'trackbar_wrong_version');
return;
} else {
return 1;
}
}
sub is_utf8 {
lc Irssi::settings_get_str('term_charset') eq 'utf-8'
}
my (%config, %keep_trackbar, %unseen_trackbar);
sub remove_one_trackbar {
my $win = shift;
my $view = shift || $win->view;
my $line = $view->get_bookmark('trackbar');
if (defined $line) {
my $bottom = $view->{bottom};
$view->remove_line($line);
$win->command('^scrollback end') if $bottom && !$win->view->{bottom};
$view->redraw;
}
}
sub add_one_trackbar_pt1 {
my $win = shift;
my $view = shift || $win->view;
my $last_cur_line = ($view->{buffer}{cur_line}||+{})->{_irssi};
$win->print(line($win->{width}), MSGLEVEL_NEVER);
my $cur_line = ($win->view->{buffer}{cur_line}||+{})->{_irssi}; # get a fresh buffer
($last_cur_line//'') ne ($cur_line//'') # printing was successful
}
sub add_one_trackbar_pt2 {
my $win = shift;
my $view = $win->view;
$view->set_bookmark_bottom('trackbar');
$unseen_trackbar{ $win->{_irssi} } = 1;
Irssi::signal_emit("window trackbar added", $win);
$view->redraw;
}
sub update_one_trackbar {
my $win = shift;
my $view = shift || $win->view;
my $force = shift;
my $ignored = win_ignored($win, $view);
my $success;
$success = add_one_trackbar_pt1($win, $view) ? 1 : 0
if $force || !$ignored;
remove_one_trackbar($win, $view)
if ( $success || !defined $success ) && ( $force || !defined $force || !$ignored );
add_one_trackbar_pt2($win)
if $success;
}
sub win_ignored {
my $win = shift;
my $view = shift || $win->view;
return 1 unless $view->{buffer}{lines_count};
return 1 if $win->{name} eq '(status)' && !$config{use_status_window};
no warnings 'uninitialized';
return 1 if grep { $win->{name} eq $_ || $win->{refnum} eq $_
|| $win->get_active_name eq $_ } @{ $config{ignore_windows} };
return 0;
}
sub sig_window_changed {
my ($newwindow, $oldwindow) = @_;
return unless $oldwindow;
redraw_one_trackbar($newwindow) unless $old_irssi;
trackbar_update_seen($newwindow);
return if delete $keep_trackbar{ $oldwindow->{_irssi} };
trackbar_update_seen($oldwindow);
return if $config{require_seen} && $unseen_trackbar{ $oldwindow->{_irssi } };
return if $config{all_manual};
update_one_trackbar($oldwindow, undef, 0);
}
sub trackbar_update_seen {
my $win = shift;
return unless $win;
return unless $unseen_trackbar{ $win->{_irssi} };
my $view = $win->view;
my $line = $view->get_bookmark('trackbar');
unless ($line) {
delete $unseen_trackbar{ $win->{_irssi} };
Irssi::signal_emit("window trackbar seen", $win);
return;
}
my $startline = $view->{startline};
return unless $startline;
if ($startline->{info}{time} < $line->{info}{time}
|| $startline->{_irssi} == $line->{_irssi}) {
delete $unseen_trackbar{ $win->{_irssi} };
Irssi::signal_emit("window trackbar seen", $win);
}
}
sub screen_length;
{ local $@;
eval { require Text::CharWidth; };
unless ($@) {
*screen_length = sub { Text::CharWidth::mbswidth($_[0]) };
}
else {
*screen_length = sub {
my $temp = shift;
Encode::_utf8_on($temp) if is_utf8();
length($temp)
};
}
}
{ my %strip_table = (
(map { $_ => '' } (split //, '04261537' . 'kbgcrmyw' . 'KBGCRMYW' . 'U9_8I:|FnN>#[' . 'pP')),
(map { $_ => $_ } (split //, '{}%')),
);
sub c_length {
my $o = Irssi::strip_codes($_[0]);
$o =~ s/(%(%|Z.{6}|z.{6}|X..|x..|.))/exists $strip_table{$2} ? $strip_table{$2} :
$2 =~ m{x(?:0[a-f]|[1-6][0-9a-z]|7[a-x])|z[0-9a-f]{6}}i ? '' : $1/gex;
screen_length($o)
}
}
sub line {
my ($width, $time) = @_;
my $string = $config{string};
$string = ' ' unless length $string;
$time ||= time;
Encode::_utf8_on($string) if is_utf8();
my $length = c_length($string);
my $format = '';
if ($config{print_timestamp}) {
$format = $config{timestamp_str};
$format =~ y/%/\01/;
$format =~ s/\01\01/%/g;
$format = strftime($format, localtime $time);
$format =~ y/\01/%/;
}
my $times = $width / $length;
$times += 1 if $times != int $times;
my $style = "$config{style}";
Encode::_utf8_on($style) if is_utf8();
$format .= $style;
$width -= c_length($format);
$string x= $times;
chop $string while length $string && c_length($string) > $width;
return $format . $string;
}
sub remove_all_trackbars {
for my $window (Irssi::windows) {
next unless ref $window;
remove_one_trackbar($window);
}
}
sub UNLOAD {
remove_all_trackbars();
}
sub redraw_one_trackbar {
my $win = shift;
my $view = $win->view;
my $line = $view->get_bookmark('trackbar');
return unless $line;
my $bottom = $view->{bottom};
$win->print_after($line, MSGLEVEL_NEVER, line($win->{width}, $line->{info}{time}),
$line->{info}{time});
$view->set_bookmark('trackbar', $win->last_line_insert);
$view->remove_line($line);
$win->command('^scrollback end') if $bottom && !$win->view->{bottom};
$view->redraw;
}
sub redraw_trackbars {
return unless check_version();
for my $win (Irssi::windows) {
next unless ref $win;
redraw_one_trackbar($win);
}
}
sub goto_trackbar {
my $win = Irssi::active_win;
my $line = $win->view->get_bookmark('trackbar');
if ($line) {
$win->command("scrollback goto ". strftime("%d %H:%M:%S", localtime($line->{info}{time})));
} else {
$win->printformat(MSGLEVEL_CLIENTCRAP, 'trackbar_not_found');
}
}
sub cmd_mark {
update_one_trackbar(Irssi::active_win, undef, 1);
}
sub cmd_markall {
for my $window (Irssi::windows) {
next unless ref $window;
update_one_trackbar($window);
}
}
sub signal_stop {
Irssi::signal_stop;
}
sub cmd_markvisible {
my @wins = Irssi::windows;
my $awin =
my $bwin = Irssi::active_win;
my $awin_counter = 0;
Irssi::signal_add_priority('window changed' => 'signal_stop', -99);
do {
Irssi::active_win->command('window up');
$awin = Irssi::active_win;
update_one_trackbar($awin);
++$awin_counter;
} until ($awin->{refnum} == $bwin->{refnum} || $awin_counter >= @wins);
Irssi::signal_remove('window changed' => 'signal_stop');
}
sub cmd_trackbar_remove_one {
remove_one_trackbar(Irssi::active_win);
}
sub cmd_remove_all_trackbars {
remove_all_trackbars();
Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'trackbar_all_removed');
}
sub cmd_keep_once {
$keep_trackbar{ Irssi::active_win->{_irssi} } = 1;
}
sub trackbar_runsub {
my ($data, $server, $item) = @_;
$data =~ s/\s+$//g;
if ($data) {
Irssi::command_runsub('trackbar', $data, $server, $item);
} else {
goto_trackbar();
}
}
sub update_config {
my $was_status_window = $config{use_status_window};
$config{style} = Irssi::settings_get_str('trackbar_style');
$config{string} = Irssi::settings_get_str('trackbar_string');
$config{require_seen} = Irssi::settings_get_bool('trackbar_require_seen');
$config{all_manual} = Irssi::settings_get_bool('trackbar_all_manual');
$config{ignore_windows} = [ split /[,\s]+/, Irssi::settings_get_str('trackbar_ignore_windows') ];
$config{use_status_window} = Irssi::settings_get_bool('trackbar_use_status_window');
$config{print_timestamp} = Irssi::settings_get_bool('trackbar_print_timestamp');
if (defined $was_status_window && $was_status_window != $config{use_status_window}) {
if (my $swin = Irssi::window_find_name('(status)')) {
if ($config{use_status_window}) {
update_one_trackbar($swin);
}
else {
remove_one_trackbar($swin);
}
}
}
if ($config{print_timestamp}) {
my $ts_format = Irssi::settings_get_str('timestamp_format');
my $ts_theme = Irssi::current_theme->get_format('fe-common/core', 'timestamp');
my $render_str = Irssi::current_theme->format_expand($ts_theme);
(my $ts_escaped = $ts_format) =~ s/([%\$])/$1$1/g;
$render_str =~ s/(?|\$(.)(?!\w)|\$\{(\w+)\})/$1 eq 'Z' ? $ts_escaped : $1/ge;
$config{timestamp_str} = $render_str;
}
redraw_trackbars() unless $old_irssi;
}
Irssi::settings_add_str('trackbar', 'trackbar_string', is_utf8() ? "\x{2500}" : '-');
Irssi::settings_add_str('trackbar', 'trackbar_style', '%K');
Irssi::settings_add_str('trackbar', 'trackbar_ignore_windows', '');
Irssi::settings_add_bool('trackbar', 'trackbar_use_status_window', 1);
Irssi::settings_add_bool('trackbar', 'trackbar_print_timestamp', 0);
Irssi::settings_add_bool('trackbar', 'trackbar_require_seen', 0);
Irssi::settings_add_bool('trackbar', 'trackbar_all_manual', 0);
update_config();
Irssi::signal_add_last( 'mainwindow resized' => 'redraw_trackbars')
unless $old_irssi;
Irssi::signal_register({'window trackbar added' => [qw/Irssi::UI::Window/]});
Irssi::signal_register({'window trackbar seen' => [qw/Irssi::UI::Window/]});
Irssi::signal_register({'gui page scrolled' => [qw/Irssi::UI::Window/]});
Irssi::signal_add_last('gui page scrolled' => 'trackbar_update_seen');
Irssi::signal_add('setup changed' => 'update_config');
Irssi::signal_add_priority('session save' => 'remove_all_trackbars', Irssi::SIGNAL_PRIORITY_HIGH-1);
Irssi::signal_add('window changed' => 'sig_window_changed');
Irssi::command_bind('trackbar goto' => 'goto_trackbar');
Irssi::command_bind('trackbar keep' => 'cmd_keep_once');
Irssi::command_bind('trackbar mark' => 'cmd_mark');
Irssi::command_bind('trackbar markvisible' => 'cmd_markvisible');
Irssi::command_bind('trackbar markall' => 'cmd_markall');
Irssi::command_bind('trackbar remove' => 'cmd_trackbar_remove_one');
Irssi::command_bind('trackbar removeall' => 'cmd_remove_all_trackbars');
Irssi::command_bind('trackbar redraw' => 'redraw_trackbars');
Irssi::command_bind('trackbar' => 'trackbar_runsub');
Irssi::command_bind('mark' => 'cmd_mark');
Irssi::command_bind_last('help' => 'cmd_help');
Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'trackbar_loaded', $IRSSI{name}, $VERSION, $IRSSI{authors});
# workaround for issue #271
{ package Irssi::Nick }

View File

@@ -0,0 +1,171 @@
use Irssi 20020101.0250 ();
$VERSION = "1.16";
%IRSSI = (
authors => 'David Leadbeater, Timo Sirainen, Georg Lukas',
contact => 'dgl@dgl.cx, tss@iki.fi, georg@boerde.de',
name => 'usercount',
description => 'Adds a usercount for a channel as a statusbar item',
license => 'GNU GPLv2 or later',
url => 'http://irssi.dgl.yi.org/',
);
# Once you have loaded this script run the following command:
# /statusbar window add usercount
# You can also add -alignment left|right option
# /set usercount_show_zero on or off to show users when 0 users of that type
# /set usercount_show_ircops (default off)
# /set usercount_show_halfops (default on)
# you can customize the look of this item from theme file:
# sb_usercount = "{sb %_$0%_ nicks ($1-)}";
# sb_uc_ircops = "%_*%_$*";
# sb_uc_ops = "%_@%_$*";
# sb_uc_halfops = "%_%%%_$*";
# sb_uc_voices = "%_+%_$*";
# sb_uc_normal = "$*";
# sb_uc_space = " ";
use strict;
use Irssi::TextUI;
my ($ircops, $ops, $halfops, $voices, $normal, $total);
my ($timeout_tag, $recalc);
# Called to make the status bar item
sub usercount {
my ($item, $get_size_only) = @_;
my $wi = !Irssi::active_win() ? undef : Irssi::active_win()->{active};
if(!ref $wi || $wi->{type} ne "CHANNEL") { # only works on channels
return unless ref $item;
$item->{min_size} = $item->{max_size} = 0;
return;
}
if ($recalc) {
$recalc = 0;
calc_users($wi);
}
my $theme = Irssi::current_theme();
my $format = $theme->format_expand("{sb_usercount}");
if ($format) {
# use theme-specific look
my $ircopstr = $theme->format_expand("{sb_uc_ircops $ircops}",
Irssi::EXPAND_FLAG_IGNORE_EMPTY);
my $opstr = $theme->format_expand("{sb_uc_ops $ops}",
Irssi::EXPAND_FLAG_IGNORE_EMPTY);
my $halfopstr = $theme->format_expand("{sb_uc_halfops $halfops}",
Irssi::EXPAND_FLAG_IGNORE_EMPTY);
my $voicestr = $theme->format_expand("{sb_uc_voices $voices}",
Irssi::EXPAND_FLAG_IGNORE_EMPTY);
my $normalstr = $theme->format_expand("{sb_uc_normal $normal}",
Irssi::EXPAND_FLAG_IGNORE_EMPTY);
my $space = $theme->format_expand('{sb_uc_space}',
Irssi::EXPAND_FLAG_IGNORE_EMPTY);
$space = " " unless $space;
my $str = "";
$str .= $ircopstr.$space if defined $ircops;
$str .= $opstr.$space if defined $ops;
$str .= $halfopstr.$space if defined $halfops;
$str .= $voicestr.$space if defined $voices;
$str .= $normalstr.$space if defined $normal;
$str =~ s/\Q$space\E$//;
$format = $theme->format_expand("{sb_usercount $total $str}",
Irssi::EXPAND_FLAG_IGNORE_REPLACES);
} else {
# use the default look
$format = "{sb \%_$total\%_ nicks \%c(\%n";
$format .= '*'.$ircops.' ' if (defined $ircops);
$format .= '@'.$ops.' ' if (defined $ops);
$format .= '%%'.$halfops.' ' if (defined $halfops);
$format .= "+$voices " if (defined $voices);
$format .= "$normal " if (defined $normal);
$format =~ s/ $//;
$format .= "\%c)}";
}
$item->default_handler($get_size_only, $format, undef, 1);
}
sub calc_users() {
my $channel = shift;
my $server = $channel->{server};
$ircops = $ops = $halfops = $voices = $normal = 0;
for ($channel->nicks()) {
if ($_->{serverop}) {
$ircops++;
}
if ($_->{op}) {
$ops++;
} elsif ($_->{halfop}) {
$halfops++;
} elsif ($_->{voice}) {
$voices++;
} else {
$normal++;
}
}
$total = $ops+$halfops+$voices+$normal;
if (!Irssi::settings_get_bool('usercount_show_zero')) {
$ircops = undef if ($ircops == 0);
$ops = undef if ($ops == 0);
$halfops = undef if ($halfops == 0);
$voices = undef if ($voices == 0);
$normal = undef if ($normal == 0);
}
$halfops = undef unless Irssi::settings_get_bool('usercount_show_halfops');
$ircops = undef unless Irssi::settings_get_bool('usercount_show_ircops');
}
sub refresh {
if ($timeout_tag > 0) {
Irssi::timeout_remove($timeout_tag);
$timeout_tag = 0;
}
Irssi::statusbar_items_redraw('usercount');
}
sub refresh_check {
my $channel = shift;
my $wi = ref Irssi::active_win() ? Irssi::active_win()->{active} : 0;
return unless ref $wi && ref $channel;
return if $wi->{name} ne $channel->{name};
return if $wi->{server}->{tag} ne $channel->{server}->{tag};
# don't refresh immediately, or we'll end up refreshing
# a lot around netsplits
$recalc = 1;
Irssi::timeout_remove($timeout_tag) if ($timeout_tag > 0);
$timeout_tag = Irssi::timeout_add(500, 'refresh', undef);
}
sub refresh_recalc {
$recalc = 1;
refresh();
}
$recalc = 1;
$timeout_tag = 0;
Irssi::settings_add_bool('usercount', 'usercount_show_zero', 1);
Irssi::settings_add_bool('usercount', 'usercount_show_ircops', 0);
Irssi::settings_add_bool('usercount', 'usercount_show_halfops', 1);
Irssi::statusbar_item_register('usercount', undef, 'usercount');
Irssi::statusbars_recreate_items();
Irssi::signal_add_last('nicklist new', 'refresh_check');
Irssi::signal_add_last('nicklist remove', 'refresh_check');
Irssi::signal_add_last('nick mode changed', 'refresh_check');
Irssi::signal_add_last('setup changed', 'refresh_recalc');
Irssi::signal_add_last('window changed', 'refresh_recalc');
Irssi::signal_add_last('window item changed', 'refresh_recalc');

View File

@@ -1,417 +1,410 @@
{ {
"Badge Text" : "", "Badge Text": "",
"Working Directory" : "\/Users\/ivuorinen\/Code", "Working Directory": "/Users/ivuorinen/Code",
"Prompt Before Closing 2" : false, "Prompt Before Closing 2": false,
"Selected Text Color" : { "Selected Text Color": {
"Red Component" : 0.80392156862745101, "Red Component": 0.80392156862745101,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.95686274509803926, "Blue Component": 0.95686274509803926,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.83921568627450982 "Green Component": 0.83921568627450982
}, },
"Rows" : 25, "Rows": 25,
"Ansi 11 Color" : { "Ansi 11 Color": {
"Red Component" : 0.97647058823529409, "Red Component": 0.97647058823529409,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.68627450980392157, "Blue Component": 0.68627450980392157,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.88627450980392153 "Green Component": 0.88627450980392153
}, },
"Use Italic Font" : true, "Use Italic Font": true,
"Foreground Color" : { "Foreground Color": {
"Red Component" : 0.80392156862745101, "Red Component": 0.80392156862745101,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.95686274509803926, "Blue Component": 0.95686274509803926,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.83921568627450982 "Green Component": 0.83921568627450982
}, },
"Right Option Key Sends" : 0, "Right Option Key Sends": 0,
"Character Encoding" : 4, "Character Encoding": 4,
"Selection Color" : { "Selection Color": {
"Red Component" : 0.34509803921568627, "Red Component": 0.34509803921568627,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.4392156862745098, "Blue Component": 0.4392156862745098,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.35686274509803922 "Green Component": 0.35686274509803922
}, },
"Blend" : 0.24709154211956524, "Blend": 0.24709154211956524,
"Mouse Reporting" : true, "Mouse Reporting": true,
"Cursor Boost" : 0, "Cursor Boost": 0,
"Ansi 4 Color" : { "Ansi 4 Color": {
"Red Component" : 0.53725490196078429, "Red Component": 0.53725490196078429,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.98039215686274506, "Blue Component": 0.98039215686274506,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.70588235294117652 "Green Component": 0.70588235294117652
}, },
"Non-ASCII Anti Aliased" : true, "Non-ASCII Anti Aliased": true,
"Sync Title" : false, "Sync Title": false,
"Badge Font" : "JetBrainsMonoNerdFontCompleteM-Bold", "Badge Font": "JetBrainsMonoNerdFontCompleteM-Bold",
"Disable Window Resizing" : true, "Disable Window Resizing": true,
"Description" : "Default", "Description": "Default",
"Close Sessions On End" : true, "Close Sessions On End": true,
"Jobs to Ignore" : [ "Jobs to Ignore": ["rlogin", "ssh", "slogin", "telnet"],
"rlogin", "Scrollback Lines": 0,
"ssh", "Draw Powerline Glyphs": true,
"slogin", "Flashing Bell": true,
"telnet" "Cursor Guide Color": {
], "Red Component": 0.80392156862745101,
"Scrollback Lines" : 0, "Color Space": "sRGB",
"Draw Powerline Glyphs" : true, "Blue Component": 0.95686274509803926,
"Flashing Bell" : true, "Alpha Component": 0.070000000000000007,
"Cursor Guide Color" : { "Green Component": 0.83921568627450982
"Red Component" : 0.80392156862745101,
"Color Space" : "sRGB",
"Blue Component" : 0.95686274509803926,
"Alpha Component" : 0.070000000000000007,
"Green Component" : 0.83921568627450982
}, },
"BM Growl" : true, "BM Growl": true,
"Ansi 3 Color" : { "Ansi 3 Color": {
"Red Component" : 0.97647058823529409, "Red Component": 0.97647058823529409,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.68627450980392157, "Blue Component": 0.68627450980392157,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.88627450980392153 "Green Component": 0.88627450980392153
}, },
"Icon" : 1, "Icon": 1,
"Use Non-ASCII Font" : false, "Use Non-ASCII Font": false,
"Link Color" : { "Link Color": {
"Red Component" : 0.53725490196078429, "Red Component": 0.53725490196078429,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.92156862745098034, "Blue Component": 0.92156862745098034,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.86274509803921573 "Green Component": 0.86274509803921573
}, },
"Shortcut" : "", "Shortcut": "",
"Background Image Location" : "", "Background Image Location": "",
"Bold Color" : { "Bold Color": {
"Red Component" : 0.80392156862745101, "Red Component": 0.80392156862745101,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.95686274509803926, "Blue Component": 0.95686274509803926,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.83921568627450982 "Green Component": 0.83921568627450982
}, },
"Use Cursor Guide" : false, "Use Cursor Guide": false,
"Unlimited Scrollback" : true, "Unlimited Scrollback": true,
"Custom Command" : "No", "Custom Command": "No",
"Title Components" : 512, "Title Components": 512,
"Keyboard Map" : { "Keyboard Map": {
"0xf700-0x260000" : { "0xf700-0x260000": {
"Action" : 10, "Action": 10,
"Text" : "[1;6A" "Text": "[1;6A"
}, },
"0x37-0x40000" : { "0x37-0x40000": {
"Action" : 11, "Action": 11,
"Text" : "0x1f" "Text": "0x1f"
}, },
"0x32-0x40000" : { "0x32-0x40000": {
"Action" : 11, "Action": 11,
"Text" : "0x00" "Text": "0x00"
}, },
"0xf709-0x20000" : { "0xf709-0x20000": {
"Action" : 10, "Action": 10,
"Text" : "[17;2~" "Text": "[17;2~"
}, },
"0xf70c-0x20000" : { "0xf70c-0x20000": {
"Action" : 10, "Action": 10,
"Text" : "[20;2~" "Text": "[20;2~"
}, },
"0xf729-0x20000" : { "0xf729-0x20000": {
"Action" : 10, "Action": 10,
"Text" : "[1;2H" "Text": "[1;2H"
}, },
"0xf72b-0x40000" : { "0xf72b-0x40000": {
"Action" : 10, "Action": 10,
"Text" : "[1;5F" "Text": "[1;5F"
}, },
"0xf705-0x20000" : { "0xf705-0x20000": {
"Action" : 10, "Action": 10,
"Text" : "[1;2Q" "Text": "[1;2Q"
}, },
"0xf703-0x260000" : { "0xf703-0x260000": {
"Action" : 10, "Action": 10,
"Text" : "[1;6C" "Text": "[1;6C"
}, },
"0xf700-0x220000" : { "0xf700-0x220000": {
"Action" : 10, "Action": 10,
"Text" : "[1;2A" "Text": "[1;2A"
}, },
"0xf701-0x280000" : { "0xf701-0x280000": {
"Action" : 11, "Action": 11,
"Text" : "0x1b 0x1b 0x5b 0x42" "Text": "0x1b 0x1b 0x5b 0x42"
}, },
"0x38-0x40000" : { "0x38-0x40000": {
"Action" : 11, "Action": 11,
"Text" : "0x7f" "Text": "0x7f"
}, },
"0x33-0x40000" : { "0x33-0x40000": {
"Action" : 11, "Action": 11,
"Text" : "0x1b" "Text": "0x1b"
}, },
"0xf703-0x220000" : { "0xf703-0x220000": {
"Action" : 10, "Action": 10,
"Text" : "[1;2C" "Text": "[1;2C"
}, },
"0xf701-0x240000" : { "0xf701-0x240000": {
"Action" : 10, "Action": 10,
"Text" : "[1;5B" "Text": "[1;5B"
}, },
"0xf70d-0x20000" : { "0xf70d-0x20000": {
"Action" : 10, "Action": 10,
"Text" : "[21;2~" "Text": "[21;2~"
}, },
"0xf702-0x260000" : { "0xf702-0x260000": {
"Action" : 10, "Action": 10,
"Text" : "[1;6D" "Text": "[1;6D"
}, },
"0xf729-0x40000" : { "0xf729-0x40000": {
"Action" : 10, "Action": 10,
"Text" : "[1;5H" "Text": "[1;5H"
}, },
"0xf706-0x20000" : { "0xf706-0x20000": {
"Action" : 10, "Action": 10,
"Text" : "[1;2R" "Text": "[1;2R"
}, },
"0x34-0x40000" : { "0x34-0x40000": {
"Action" : 11, "Action": 11,
"Text" : "0x1c" "Text": "0x1c"
}, },
"0xf700-0x280000" : { "0xf700-0x280000": {
"Action" : 11, "Action": 11,
"Text" : "0x1b 0x1b 0x5b 0x41" "Text": "0x1b 0x1b 0x5b 0x41"
}, },
"0x2d-0x40000" : { "0x2d-0x40000": {
"Action" : 11, "Action": 11,
"Text" : "0x1f" "Text": "0x1f"
}, },
"0xf70e-0x20000" : { "0xf70e-0x20000": {
"Action" : 10, "Action": 10,
"Text" : "[23;2~" "Text": "[23;2~"
}, },
"0xf702-0x220000" : { "0xf702-0x220000": {
"Action" : 10, "Action": 10,
"Text" : "[1;2D" "Text": "[1;2D"
}, },
"0xf703-0x280000" : { "0xf703-0x280000": {
"Action" : 11, "Action": 11,
"Text" : "0x1b 0x1b 0x5b 0x43" "Text": "0x1b 0x1b 0x5b 0x43"
}, },
"0xf700-0x240000" : { "0xf700-0x240000": {
"Action" : 10, "Action": 10,
"Text" : "[1;5A" "Text": "[1;5A"
}, },
"0xf707-0x20000" : { "0xf707-0x20000": {
"Action" : 10, "Action": 10,
"Text" : "[1;2S" "Text": "[1;2S"
}, },
"0xf70a-0x20000" : { "0xf70a-0x20000": {
"Action" : 10, "Action": 10,
"Text" : "[18;2~" "Text": "[18;2~"
}, },
"0x35-0x40000" : { "0x35-0x40000": {
"Action" : 11, "Action": 11,
"Text" : "0x1d" "Text": "0x1d"
}, },
"0xf70f-0x20000" : { "0xf70f-0x20000": {
"Action" : 10, "Action": 10,
"Text" : "[24;2~" "Text": "[24;2~"
}, },
"0xf703-0x240000" : { "0xf703-0x240000": {
"Action" : 10, "Action": 10,
"Text" : "[1;5C" "Text": "[1;5C"
}, },
"0xf701-0x260000" : { "0xf701-0x260000": {
"Action" : 10, "Action": 10,
"Text" : "[1;6B" "Text": "[1;6B"
}, },
"0xf702-0x280000" : { "0xf702-0x280000": {
"Action" : 11, "Action": 11,
"Text" : "0x1b 0x1b 0x5b 0x44" "Text": "0x1b 0x1b 0x5b 0x44"
}, },
"0xf72b-0x20000" : { "0xf72b-0x20000": {
"Action" : 10, "Action": 10,
"Text" : "[1;2F" "Text": "[1;2F"
}, },
"0x36-0x40000" : { "0x36-0x40000": {
"Action" : 11, "Action": 11,
"Text" : "0x1e" "Text": "0x1e"
}, },
"0xf708-0x20000" : { "0xf708-0x20000": {
"Action" : 10, "Action": 10,
"Text" : "[15;2~" "Text": "[15;2~"
}, },
"0xf701-0x220000" : { "0xf701-0x220000": {
"Action" : 10, "Action": 10,
"Text" : "[1;2B" "Text": "[1;2B"
}, },
"0xf70b-0x20000" : { "0xf70b-0x20000": {
"Action" : 10, "Action": 10,
"Text" : "[19;2~" "Text": "[19;2~"
}, },
"0xf702-0x240000" : { "0xf702-0x240000": {
"Action" : 10, "Action": 10,
"Text" : "[1;5D" "Text": "[1;5D"
}, },
"0xf704-0x20000" : { "0xf704-0x20000": {
"Action" : 10, "Action": 10,
"Text" : "[1;2P" "Text": "[1;2P"
} }
}, },
"Ansi 14 Color" : { "Ansi 14 Color": {
"Red Component" : 0.58039215686274515, "Red Component": 0.58039215686274515,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.83529411764705885, "Blue Component": 0.83529411764705885,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.88627450980392153 "Green Component": 0.88627450980392153
}, },
"Ansi 2 Color" : { "Ansi 2 Color": {
"Red Component" : 0.65098039215686276, "Red Component": 0.65098039215686276,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.63137254901960782, "Blue Component": 0.63137254901960782,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.8901960784313725 "Green Component": 0.8901960784313725
}, },
"Send Code When Idle" : false, "Send Code When Idle": false,
"ASCII Anti Aliased" : true, "ASCII Anti Aliased": true,
"Tags" : [ "Tags": [],
"Ansi 9 Color": {
], "Red Component": 0.95294117647058818,
"Ansi 9 Color" : { "Color Space": "sRGB",
"Red Component" : 0.95294117647058818, "Blue Component": 0.6588235294117647,
"Color Space" : "sRGB", "Alpha Component": 1,
"Blue Component" : 0.6588235294117647, "Green Component": 0.54509803921568623
"Alpha Component" : 1,
"Green Component" : 0.54509803921568623
}, },
"Badge Right Margin" : 10, "Badge Right Margin": 10,
"Use Bold Font" : true, "Use Bold Font": true,
"Silence Bell" : false, "Silence Bell": false,
"Ansi 12 Color" : { "Ansi 12 Color": {
"Red Component" : 0.53725490196078429, "Red Component": 0.53725490196078429,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.98039215686274506, "Blue Component": 0.98039215686274506,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.70588235294117652 "Green Component": 0.70588235294117652
}, },
"Window Type" : 0, "Window Type": 0,
"Use Bright Bold" : true, "Use Bright Bold": true,
"Cursor Text Color" : { "Cursor Text Color": {
"Red Component" : 0.80392156862745101, "Red Component": 0.80392156862745101,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.95686274509803926, "Blue Component": 0.95686274509803926,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.83921568627450982 "Green Component": 0.83921568627450982
}, },
"Default Bookmark" : "No", "Default Bookmark": "No",
"Cursor Color" : { "Cursor Color": {
"Red Component" : 0.96078431372549022, "Red Component": 0.96078431372549022,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.86274509803921573, "Blue Component": 0.86274509803921573,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.8784313725490196 "Green Component": 0.8784313725490196
}, },
"Ansi 1 Color" : { "Ansi 1 Color": {
"Red Component" : 0.95294117647058818, "Red Component": 0.95294117647058818,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.6588235294117647, "Blue Component": 0.6588235294117647,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.54509803921568623 "Green Component": 0.54509803921568623
}, },
"Name" : "Default", "Name": "Default",
"Blinking Cursor" : false, "Blinking Cursor": false,
"Guid" : "82636119-EA17-4A26-9AA7-408172F4A9C8", "Guid": "82636119-EA17-4A26-9AA7-408172F4A9C8",
"Badge Max Width" : 0.45000000000000001, "Badge Max Width": 0.45000000000000001,
"Idle Code" : 0, "Idle Code": 0,
"Ansi 10 Color" : { "Ansi 10 Color": {
"Red Component" : 0.65098039215686276, "Red Component": 0.65098039215686276,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.63137254901960782, "Blue Component": 0.63137254901960782,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.8901960784313725 "Green Component": 0.8901960784313725
}, },
"Ansi 8 Color" : { "Ansi 8 Color": {
"Red Component" : 0.34509803921568627, "Red Component": 0.34509803921568627,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.4392156862745098, "Blue Component": 0.4392156862745098,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.35686274509803922 "Green Component": 0.35686274509803922
}, },
"Badge Color" : { "Badge Color": {
"Red Component" : 1, "Red Component": 1,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0, "Blue Component": 0,
"Alpha Component" : 0.5, "Alpha Component": 0.5,
"Green Component" : 0.14910030364990234 "Green Component": 0.14910030364990234
}, },
"Smart Cursor Color" : true, "Smart Cursor Color": true,
"Ambiguous Double Width" : false, "Ambiguous Double Width": false,
"Blur Radius" : 9.5927277260638313, "Blur Radius": 9.5927277260638313,
"Badge Max Height" : 0.10000000000000001, "Badge Max Height": 0.10000000000000001,
"Ansi 0 Color" : { "Ansi 0 Color": {
"Red Component" : 0.27058823529411763, "Red Component": 0.27058823529411763,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.35294117647058826, "Blue Component": 0.35294117647058826,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.27843137254901962 "Green Component": 0.27843137254901962
}, },
"Blur" : true, "Blur": true,
"Normal Font" : "JetBrainsMonoNerdFontCompleteM-Light 15", "Normal Font": "JetBrainsMonoNerdFontCompleteM-Light 15",
"Vertical Spacing" : 1, "Vertical Spacing": 1,
"Ansi 7 Color" : { "Ansi 7 Color": {
"Red Component" : 0.72941176470588232, "Red Component": 0.72941176470588232,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.87058823529411766, "Blue Component": 0.87058823529411766,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.76078431372549016 "Green Component": 0.76078431372549016
}, },
"Command" : "", "Command": "",
"Terminal Type" : "xterm-256color", "Terminal Type": "xterm-256color",
"Horizontal Spacing" : 1, "Horizontal Spacing": 1,
"Option Key Sends" : 0, "Option Key Sends": 0,
"Only The Default BG Color Uses Transparency" : true, "Only The Default BG Color Uses Transparency": true,
"Minimum Contrast" : 0.14973958333333334, "Minimum Contrast": 0.14973958333333334,
"Ansi 15 Color" : { "Ansi 15 Color": {
"Red Component" : 0.65098039215686276, "Red Component": 0.65098039215686276,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.78431372549019607, "Blue Component": 0.78431372549019607,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.67843137254901964 "Green Component": 0.67843137254901964
}, },
"Ansi 6 Color" : { "Ansi 6 Color": {
"Red Component" : 0.58039215686274515, "Red Component": 0.58039215686274515,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.83529411764705885, "Blue Component": 0.83529411764705885,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.88627450980392153 "Green Component": 0.88627450980392153
}, },
"Badge Top Margin" : 10, "Badge Top Margin": 10,
"Transparency" : 0.10293218085106381, "Transparency": 0.10293218085106381,
"Background Color" : { "Background Color": {
"Red Component" : 0.11764705882352941, "Red Component": 0.11764705882352941,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.1803921568627451, "Blue Component": 0.1803921568627451,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.11764705882352941 "Green Component": 0.11764705882352941
}, },
"Screen" : -2, "Screen": -2,
"Non Ascii Font" : "Monaco 12", "Non Ascii Font": "Monaco 12",
"Ansi 13 Color" : { "Ansi 13 Color": {
"Red Component" : 0.96078431372549022, "Red Component": 0.96078431372549022,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.90588235294117647, "Blue Component": 0.90588235294117647,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.76078431372549016 "Green Component": 0.76078431372549016
}, },
"Columns" : 120, "Columns": 120,
"Visual Bell" : true, "Visual Bell": true,
"ASCII Ligatures" : false, "ASCII Ligatures": false,
"Ansi 5 Color" : { "Ansi 5 Color": {
"Red Component" : 0.96078431372549022, "Red Component": 0.96078431372549022,
"Color Space" : "sRGB", "Color Space": "sRGB",
"Blue Component" : 0.90588235294117647, "Blue Component": 0.90588235294117647,
"Alpha Component" : 1, "Alpha Component": 1,
"Green Component" : 0.76078431372549016 "Green Component": 0.76078431372549016
}, },
"Custom Directory" : "Yes" "Custom Directory": "Yes"
} }

5
config/nvim/.luarc.json Normal file
View File

@@ -0,0 +1,5 @@
{
"diagnostics.globals": [
"vim"
]
}

View File

@@ -1,27 +1,27 @@
{ {
"LazyVim": { "branch": "main", "commit": "a72a84972d85e5bbc6b9d60a0983b37efef21b8a" }, "LazyVim": { "branch": "main", "commit": "ecac59c9823c86ac4c916a4cc1aa761f43e040ec" },
"LuaSnip": { "branch": "master", "commit": "1fd22fa96c11573248f9fdd09f25e724c7bb3dd4" }, "LuaSnip": { "branch": "master", "commit": "480b032f6708573334f4437d3f83307d143f1a72" },
"SchemaStore.nvim": { "branch": "main", "commit": "d2a3d1da007549c921f7b0e22521d1c20d09c8a7" }, "SchemaStore.nvim": { "branch": "main", "commit": "08ab25507a92e22cec433f6750bb4a56a8cec22d" },
"alpha-nvim": { "branch": "main", "commit": "234822140b265ec4ba3203e3e0be0e0bb826dff5" }, "alpha-nvim": { "branch": "main", "commit": "234822140b265ec4ba3203e3e0be0e0bb826dff5" },
"animation.nvim": { "branch": "main", "commit": "fb77091ab72ec9971aee0562e7081182527aaa6a" }, "animation.nvim": { "branch": "main", "commit": "fb77091ab72ec9971aee0562e7081182527aaa6a" },
"bufdelete.nvim": { "branch": "master", "commit": "07d1f8ba79dec59d42b975a4df1c732b2e4e37b4" }, "bufdelete.nvim": { "branch": "master", "commit": "07d1f8ba79dec59d42b975a4df1c732b2e4e37b4" },
"bufferline.nvim": { "branch": "main", "commit": "6ecd37e0fa8b156099daedd2191130e083fb1490" }, "bufferline.nvim": { "branch": "main", "commit": "357cc8f8eeb64702e6fcf2995e3b9becee99a5d3" },
"catppuccin": { "branch": "main", "commit": "3d9a5ed556e289bce6c1fb0af89ec838360641b2" }, "catppuccin": { "branch": "main", "commit": "7a4bcdadafc59a5bedbd866c643fa486d8cca4a1" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
"comment-box.nvim": { "branch": "main", "commit": "dd1a48f8d06102e9b87ae1e0069bc365c006979b" }, "comment-box.nvim": { "branch": "main", "commit": "dd1a48f8d06102e9b87ae1e0069bc365c006979b" },
"dressing.nvim": { "branch": "master", "commit": "c1e1d5fa44fe08811b6ef4aadac2b50e602f9504" }, "dressing.nvim": { "branch": "master", "commit": "8f4d62b7817455896a3c73cab642002072c114bc" },
"edgy.nvim": { "branch": "main", "commit": "4ccc1c67ae2b1a0c55f18c83d03b714e2bb1bae4" }, "edgy.nvim": { "branch": "main", "commit": "70e334c9cd7915aedde3255ade01ceeebe735b53" },
"flash.nvim": { "branch": "main", "commit": "cc8c7e03987134997d74ee87e55a5717279f2d05" }, "flash.nvim": { "branch": "main", "commit": "79e79ae45c3512ff1edc5da55f38ca8ee8d857b9" },
"friendly-snippets": { "branch": "main", "commit": "ebf6d6e83494cdd88a54a429340256f4dbb6a052" }, "friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" },
"gitsigns.nvim": { "branch": "main", "commit": "bdeba1cec3faddd89146690c10b9a87949c0ee66" }, "gitsigns.nvim": { "branch": "main", "commit": "b14b9fba7d085ed8c11392aa51e575de84822bb1" },
"harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" }, "indent-blankline.nvim": { "branch": "master", "commit": "ce2e8e410bc8b46a6938bfa3520bc6b85ca8a743" },
"indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" }, "lazy.nvim": { "branch": "main", "commit": "59335c5b9d116f5d3948f833288a89e2a829a005" },
"lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" },
"lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "2451adb9bdb0fd32140bf3aa8dbc17ff60050db3" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "e2705063f395b44f676cd26596a11007a2cbd3bd" },
"mason.nvim": { "branch": "main", "commit": "d66c60e17dd6fd8165194b1d14d21f7eb2c1697a" }, "mason.nvim": { "branch": "main", "commit": "d66c60e17dd6fd8165194b1d14d21f7eb2c1697a" },
"middleclass": { "branch": "master", "commit": "9fab4d5bca67262614960960ca35c4740eb2be2c" }, "middleclass": { "branch": "master", "commit": "9fab4d5bca67262614960960ca35c4740eb2be2c" },
"mini.ai": { "branch": "main", "commit": "7ae226f331885e6f30e9a8229e113debc59308ae" }, "mini.ai": { "branch": "main", "commit": "7ae226f331885e6f30e9a8229e113debc59308ae" },
@@ -32,36 +32,36 @@
"mini.pairs": { "branch": "main", "commit": "dfa9f6e2576bb8853be277d96b735af59d9be7c2" }, "mini.pairs": { "branch": "main", "commit": "dfa9f6e2576bb8853be277d96b735af59d9be7c2" },
"mini.surround": { "branch": "main", "commit": "9d1956b576d7051da3a483b251dfc778121c60db" }, "mini.surround": { "branch": "main", "commit": "9d1956b576d7051da3a483b251dfc778121c60db" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "71f1841ba6c652908678cece623f52c1fea8a6cd" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "71f1841ba6c652908678cece623f52c1fea8a6cd" },
"neoconf.nvim": { "branch": "main", "commit": "360805250fe45391d30b96b6640d03e2c35597ee" }, "neoconf.nvim": { "branch": "main", "commit": "466ba6f645f63f91ac84d3dd986acede5d107f39" },
"neodev.nvim": { "branch": "main", "commit": "ddf29935af5a510307850919d6772ea6a4e2c008" }, "neodev.nvim": { "branch": "main", "commit": "5147640bc8435ca3557a105ebd1143bc20420b60" },
"neogen": { "branch": "main", "commit": "cb1f384df804c1bf729332c4f728253fe17962d4" }, "neogen": { "branch": "main", "commit": "cb1f384df804c1bf729332c4f728253fe17962d4" },
"noice.nvim": { "branch": "main", "commit": "74c2902146b080035beb19944baf6f014a954720" }, "noice.nvim": { "branch": "main", "commit": "396f9146529130904e07c45e90ecdbfa607534f3" },
"none-ls.nvim": { "branch": "main", "commit": "f39f627bbdfb33cc4ae4a95b4708e7dba7b9aafc" },
"nui.nvim": { "branch": "main", "commit": "c8de23342caf8d50b15d6b28368d36a56a69d76f" }, "nui.nvim": { "branch": "main", "commit": "c8de23342caf8d50b15d6b28368d36a56a69d76f" },
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
"nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" }, "nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" },
"nvim-lspconfig": { "branch": "master", "commit": "ede4114e1fd41acb121c70a27e1b026ac68c42d6" }, "nvim-lspconfig": { "branch": "master", "commit": "ac478757efcde1ac346f7044ab774e7cbb482533" },
"nvim-navic": { "branch": "master", "commit": "0ffa7ffe6588f3417e680439872f5049e38a24db" }, "nvim-navic": { "branch": "master", "commit": "0ffa7ffe6588f3417e680439872f5049e38a24db" },
"nvim-notify": { "branch": "master", "commit": "94859430020f5cf32a1b97ddd9e596fed9db7981" }, "nvim-notify": { "branch": "master", "commit": "e4a2022f4fec2d5ebc79afa612f96d8b11c627b3" },
"nvim-regexplainer": { "branch": "main", "commit": "4250c8f3c1307876384e70eeedde5149249e154f" }, "nvim-regexplainer": { "branch": "main", "commit": "4250c8f3c1307876384e70eeedde5149249e154f" },
"nvim-spectre": { "branch": "master", "commit": "97cfd1b0f5a6ab35979ce1bee6c17f54745fd1e5" }, "nvim-spectre": { "branch": "master", "commit": "97cfd1b0f5a6ab35979ce1bee6c17f54745fd1e5" },
"nvim-treesitter": { "branch": "master", "commit": "0960322686bfa38afd4f1e0b9660473cf77e24b6" }, "nvim-treesitter": { "branch": "master", "commit": "d96c216c54cc2d48d3c66ba7f0fc3c7c5b71b3b1" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "bd103502252027434ec42f628d2dbf54821d4ce6" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "bd103502252027434ec42f628d2dbf54821d4ce6" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "95e9ba9de4289d221666b66fd930d157c7ca08c6" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "0c136439fb93fd94db9106250ff6f6858101422b" },
"nvim-ufo": { "branch": "main", "commit": "6f2ccdf2da390d62f8f9e15fc5ddbcbd312e1e66" }, "nvim-ufo": { "branch": "main", "commit": "6f2ccdf2da390d62f8f9e15fc5ddbcbd312e1e66" },
"nvim-web-devicons": { "branch": "master", "commit": "480a756df82a0c231622c9bf2173bb6634713716" }, "nvim-web-devicons": { "branch": "master", "commit": "45d0237c427baba8cd05e0ab26d30e2ee58c2c82" },
"persistence.nvim": { "branch": "main", "commit": "4b8051c01f696d8849a5cb8afa9767be8db16e40" }, "persistence.nvim": { "branch": "main", "commit": "4b8051c01f696d8849a5cb8afa9767be8db16e40" },
"plenary.nvim": { "branch": "master", "commit": "9ce85b0f7dcfe5358c0be937ad23e456907d410b" }, "plenary.nvim": { "branch": "master", "commit": "9ce85b0f7dcfe5358c0be937ad23e456907d410b" },
"promise-async": { "branch": "main", "commit": "e94f35161b8c5d4a4ca3b6ff93dd073eb9214c0e" }, "promise-async": { "branch": "main", "commit": "e94f35161b8c5d4a4ca3b6ff93dd073eb9214c0e" },
"stickybuf.nvim": { "branch": "master", "commit": "e3db41f2c1bb2df3ee6ff964ee74fe991f6f9566" }, "stickybuf.nvim": { "branch": "master", "commit": "e3db41f2c1bb2df3ee6ff964ee74fe991f6f9566" },
"symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" },
"tabnine": { "branch": "master", "commit": "2c06b4865415701dc638549032824664e114ee23" },
"tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "bc25c56083939f274edcfe395c6ff7de23b67c50" }, "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "bc25c56083939f274edcfe395c6ff7de23b67c50" },
"telescope.nvim": { "branch": "master", "commit": "ed9574dd6dde143d009b2528ea6d79bd34bbe6c8" }, "telescope.nvim": { "branch": "master", "commit": "7d51950854a3f8853c5c0d570757095e9a5af313" },
"todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" }, "todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" },
"tokyonight.nvim": { "branch": "main", "commit": "9a01eada39558dc3243278e6805d90e8dff45dc0" }, "tokyonight.nvim": { "branch": "main", "commit": "e89caa3ad6d8da9d0dd981ec74a82c55adc61ffd" },
"transparent.nvim": { "branch": "main", "commit": "3af6232c8d39d51062702e875ff6407c1eeb0391" },
"trouble.nvim": { "branch": "main", "commit": "3f85d8ed30e97ceeddbbcf80224245d347053711" }, "trouble.nvim": { "branch": "main", "commit": "3f85d8ed30e97ceeddbbcf80224245d347053711" },
"typescript.nvim": { "branch": "main", "commit": "4de85ef699d7e6010528dcfbddc2ed4c2c421467" },
"venv-selector.nvim": { "branch": "main", "commit": "14d6e866070f759e9014a8053954f835294f56f9" }, "venv-selector.nvim": { "branch": "main", "commit": "14d6e866070f759e9014a8053954f835294f56f9" },
"vim-illuminate": { "branch": "master", "commit": "6acf7d4a18255a3ddc43770866c8e148fe85af7b" }, "vim-illuminate": { "branch": "master", "commit": "1b5d70332a51a1de05f281069851865a2bb1e6d7" },
"vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" }, "vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" },
"vim-wakatime": { "branch": "master", "commit": "0d2efa2daff34b27b0d227d4c3b136811c93db93" }, "vim-wakatime": { "branch": "master", "commit": "0d2efa2daff34b27b0d227d4c3b136811c93db93" },
"which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" }, "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" },

View File

@@ -12,8 +12,17 @@ require("lazy").setup({
{ {
"LazyVim/LazyVim", "LazyVim/LazyVim",
import = "lazyvim.plugins", import = "lazyvim.plugins",
},
{
"folke/tokyonight.nvim",
opts = { opts = {
colorscheme = "catppuccin", style = "night",
transparent = true,
sidebars = { "qf", "vista_kind", "terminal", "packer" },
styles = {
sidebars = "transparent",
floats = "transparent",
},
}, },
}, },
-- import any extras modules here -- import any extras modules here
@@ -41,7 +50,7 @@ require("lazy").setup({
version = false, -- always use the latest git commit version = false, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver -- version = "*", -- try installing the latest stable version for plugins that support semver
}, },
install = { colorscheme = { "catppuccin" } }, install = { colorscheme = { "tokyonight" } },
checker = { enabled = true }, -- automatically check for plugin updates checker = { enabled = true }, -- automatically check for plugin updates
performance = { performance = {
rtp = { rtp = {

View File

@@ -7,7 +7,6 @@ local opt = vim.opt
opt.number = true opt.number = true
opt.relativenumber = true opt.relativenumber = true
opt.modeline = true opt.modeline = true
opt.spelllang = { "en", "fi" }
-- The line beneath this is called `modeline`. See `:help modeline` -- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et -- vim: ts=2 sts=2 sw=2 et

View File

@@ -65,17 +65,46 @@ return {
auto = true, auto = true,
}, },
}, },
-- Clarify and beautify your comments using boxes and lines. -- Clarify and beautify your comments using boxes and lines.
-- https://github.com/LudoPinelli/comment-box.nvim -- https://github.com/LudoPinelli/comment-box.nvim
{ "LudoPinelli/comment-box.nvim", opts = {} }, { "LudoPinelli/comment-box.nvim", opts = {} },
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"actionlint",
"ansible-language-server",
"ansible-lint",
"bash-language-server",
"blade-formatter",
"cfn-lint",
"codeql",
"codespell",
"commitlint",
"diagnostic-languageserver",
"docker-compose-language-service",
"dockerfile-language-server",
"editorconfig-checker",
"fixjson",
"html-lsp",
"jq",
"nginx-language-server",
"php-cs-fixer",
"semgrep",
"sonarlint-language-server",
"stylua",
"shellcheck",
"shfmt",
"flake8",
},
},
},
-- Tabnine Client for Neovim -- Tabnine Client for Neovim
-- https://github.com/codota/tabnine-nvim -- https://github.com/codota/tabnine-nvim
{ {
"codota/tabnine-nvim", "codota/tabnine-nvim",
name = "tabnine", name = "tabnine",
enabled = false, -- enabled = false,
build = vim.loop.os_uname().sysname == "Windows_NT" and "pwsh.exe -file .\\dl_binaries.ps1" or "./dl_binaries.sh", build = vim.loop.os_uname().sysname == "Windows_NT" and "pwsh.exe -file .\\dl_binaries.ps1" or "./dl_binaries.sh",
cmd = { "TabnineStatus", "TabnineDisable", "TabnineEnable", "TabnineToggle" }, cmd = { "TabnineStatus", "TabnineDisable", "TabnineEnable", "TabnineToggle" },
event = "User", event = "User",
@@ -84,7 +113,6 @@ return {
dismiss_keymap = "<C-Esc>", dismiss_keymap = "<C-Esc>",
}, },
}, },
-- Vim plugin for automatic time tracking and metrics generated from your programming activity. -- Vim plugin for automatic time tracking and metrics generated from your programming activity.
-- https://github.com/wakatime/vim-wakatime -- https://github.com/wakatime/vim-wakatime
{ "wakatime/vim-wakatime", lazy = false, enabled = true }, { "wakatime/vim-wakatime", lazy = false, enabled = true },

View File

@@ -0,0 +1,53 @@
return {
-- Use <tab> for completion and snippets (supertab)
-- first: disable default <tab> and <s-tab> behavior in LuaSnip
{
"L3MON4D3/LuaSnip",
keys = function()
return {}
end,
},
-- then: setup supertab in cmp
{
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-emoji",
},
---@param opts cmp.ConfigSchema
opts = function(_, opts)
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
local luasnip = require("luasnip")
local cmp = require("cmp")
opts.mapping = vim.tbl_extend("force", opts.mapping, {
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
-- this way you will only jump inside the snippet region
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
})
end,
},
}

View File

@@ -1,43 +1,5 @@
-- luacheck: globals vim -- luacheck: globals vim
return { return {
-- The theme of choise, catppuccin
-- https://github.com/catppuccin/nvim
{
"catppuccin/nvim",
name = "catppuccin",
priority = 1000,
enabled = true,
config = function()
vim.cmd.colorscheme("catppuccin")
end,
opts = {
flavour = "mocha",
},
},
-- Remove all background colors to make nvim transparent
-- https://github.com/xiyaowong/transparent.nvim
{
"xiyaowong/transparent.nvim",
lazy = false,
enabled = true,
config = function()
vim.g.transparent_groups = vim.list_extend(
vim.g.transparent_groups or {},
vim.tbl_map(function(v)
return v.hl_group
end, vim.tbl_values(require("bufferline.config").highlights))
)
end,
},
-- A fancy, configurable, notification manager for NeoVim
-- https://github.com/rcarriga/nvim-notify
{
"rcarriga/nvim-notify",
opts = {
-- Set background color to black so transparent doesn't mess stuff up
background_colour = "#000000",
},
},
-- Not UFO in the sky, but an ultra fold in Neovim. -- Not UFO in the sky, but an ultra fold in Neovim.
-- https://github.com/kevinhwang91/nvim-ufo/ -- https://github.com/kevinhwang91/nvim-ufo/
{ {
@@ -71,7 +33,7 @@ return {
jumpBot = "]", jumpBot = "]",
}, },
}, },
provider_selector = function(bufnr, filetype, buftype) provider_selector = function(_, _, _) -- bufnr, filetype, buftype
return { "treesitter", "indent" } return { "treesitter", "indent" }
end, end,
fold_virt_text_handler = function(virtText, lnum, endLnum, width, truncate) fold_virt_text_handler = function(virtText, lnum, endLnum, width, truncate)
@@ -103,15 +65,18 @@ return {
end, end,
}, },
}, },
{
"simrat39/symbols-outline.nvim",
cmd = "SymbolsOutline",
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
config = true,
},
-- Indent guides for Neovim -- Indent guides for Neovim
-- https://github.com/lukas-reineke/indent-blankline.nvim -- https://github.com/lukas-reineke/indent-blankline.nvim
{ "lukas-reineke/indent-blankline.nvim" }, { "lukas-reineke/indent-blankline.nvim" },
-- Git integration for buffers -- Git integration for buffers
-- https://github.com/lewis6991/gitsigns.nvim -- https://github.com/lewis6991/gitsigns.nvim
{ "lewis6991/gitsigns.nvim" }, { "lewis6991/gitsigns.nvim" },
-- Getting you where you want with the fewest keystrokes.
-- https://github.com/ThePrimeagen/harpoon
{ "ThePrimeagen/harpoon" },
-- Close buffer without messing up with the window. -- Close buffer without messing up with the window.
-- https://github.com/famiu/bufdelete.nvim -- https://github.com/famiu/bufdelete.nvim
{ "famiu/bufdelete.nvim" }, { "famiu/bufdelete.nvim" },

View File

@@ -40,6 +40,8 @@ disabled = true
[directory] [directory]
read_only = " 󰌾" read_only = " 󰌾"
style = "blue" style = "blue"
before_repo_root_style = "white"
truncation_symbol = "…/"
[docker_context] [docker_context]
symbol = " " symbol = " "

View File

@@ -67,6 +67,9 @@ bind p paste-buffer
# │ Settings │ # │ Settings │
# ╰──────────────────────────────────────────────────────────╯ # ╰──────────────────────────────────────────────────────────╯
# Expose window title
set-option -g set-titles on
# Mouse support # Mouse support
set -g mouse on set -g mouse on
@@ -82,62 +85,44 @@ set-option -g renumber-windows on
# set vi-mode # set vi-mode
set-window-option -g mode-keys vi set-window-option -g mode-keys vi
# Set theme to tokyonight
source-file ~/.dotfiles/config/tmux/tokyonight_storm.tmux
# ╭──────────────────────────────────────────────────────────╮ # ╭──────────────────────────────────────────────────────────╮
# │ Plugins │ # │ Plugins │
# ╰──────────────────────────────────────────────────────────╯ # ╰──────────────────────────────────────────────────────────╯
# Set plugins install dir run-shell ~/.dotfiles/config/tmux/plugins/tmux-sensible/sensible.tmux
set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.dotfiles/config/tmux/plugins' run-shell ~/.dotfiles/config/tmux/plugins/tmux-continuum/continuum.tmux
run-shell ~/.dotfiles/config/tmux/plugins/tmux-resurrect/resurrect.tmux
## Install plugins, starting with plugin manager run-shell ~/.dotfiles/config/tmux/plugins/tmux-sessionist/sessionist.tmux
set -g @tpm_plugins ' \ run-shell ~/.dotfiles/config/tmux/plugins/tmux-mode-indicator/mode_indicator.tmux
catppuccin/tmux \ run-shell ~/.dotfiles/config/tmux/plugins/tmux-suspend/suspend.tmux
tmux-plugins/tmux-continuum \ run-shell ~/.dotfiles/config/tmux/plugins/tmux-yank/yank.tmux
jaclu/tmux-menus \ run-shell ~/.dotfiles/config/tmux/plugins/tmux-window-name/tmux_window_name.tmux
ofirgall/tmux-window-name \
tmux-plugins/tmux-resurrect \
tmux-plugins/tmux-sensible \
tmux-plugins/tmux-sessionist \
tmux-plugins/tmux-yank \
tmux-plugins/tpm \
'
# ╭──────────────────────────────────────────────────────────╮ # ╭──────────────────────────────────────────────────────────╮
# │ Plugins related configurations │ # │ Plugins related configurations │
# ╰──────────────────────────────────────────────────────────╯ # ╰──────────────────────────────────────────────────────────╯
## https://github.com/jaclu/tmux-menus # Plugin that lets you suspend local tmux session,
set -g @menus_trigger 'm' # so that you can work with nested remote tmux session painlessly.
# https://github.com/MunifTanjim/tmux-suspend
set -g @suspend_key 'F12'
## A plugin to name your tmux windows smartly. ## A plugin to name your tmux windows smartly.
## https://github.com/ofirgall/tmux-window-name ## https://github.com/ofirgall/tmux-window-name
### Maximum name length of a window ### Maximum name length of a window
set -g @tmux_window_name_max_name_len "20" set -g @tmux_window_name_max_name_len "30"
### Replace $HOME with ~ in window names ### Replace $HOME with ~ in window names
set -g @tmux_window_name_use_tilde "True" set -g @tmux_window_name_use_tilde "True"
## https://github.com/catppuccin/tmux
set -g @catppuccin_flavour "mocha" # latte/frappe/macchiato/mocha
set -g @catppuccin_window_tabs_enabled on # or off to disable window_tabs
set -g @catppuccin_window_status_enable "yes"
## set -g @catppuccin_window_right_separator "█"
set -g @catppuccin_window_number_position "left"
set -g @catppuccin_window_middle_separator ": "
set -g @catppuccin_window_default_fill "none"
set -g @catppuccin_window_current_fill "all"
set -g @catppuccin_status_modules "application session date_time"
set -g @catppuccin_status_left_separator "█"
set -g @catppuccin_status_right_separator "█"
set -g @catppuccin_date_time_text "%Y-%m-%d %H:%M"
## https://github.com/tmux-plugins/tmux-continuum ## https://github.com/tmux-plugins/tmux-continuum
set -g @continuum-restore 'on' set -g @continuum-restore 'on'
set -g @continuum-boot 'on' set -g @continuum-boot 'on'
set -g @continuum-boot-options 'alacritty'
## https://github.com/tmux-plugins/tmux-resurrect ## https://github.com/tmux-plugins/tmux-resurrect
set -g @resurrect-strategy-nvim 'session' set -g @resurrect-strategy-nvim 'session'
set -g @resurrect-dir '$HOME/.local/state/tmux/tmux-resurrect' set -g @resurrect-dir '$HOME/.local/state/tmux/tmux-resurrect'
# Finally run the tmux plugin manager
run '~/.dotfiles/config/tmux/plugins/tpm/tpm'

View File

@@ -0,0 +1,38 @@
#!/usr/bin/env bash
# TokyoNight colors for Tmux
set -g mode-style "fg=#7aa2f7,bg=#3b4261"
set -g message-style "fg=#7aa2f7,bg=#3b4261"
set -g message-command-style "fg=#7aa2f7,bg=#3b4261"
set -g pane-border-style "fg=#3b4261"
set -g pane-active-border-style "fg=#7aa2f7"
set -g status "on"
set -g status-justify "left"
set -g status-style "fg=#7aa2f7,bg=#1f2335"
set -g status-left-length "100"
set -g status-right-length "100"
set -g status-left-style NONE
set -g status-right-style NONE
set -g status-left "#[fg=#1d202f,bg=#7aa2f7,bold] #S #[fg=#7aa2f7,bg=#1f2335,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#1f2335] #{prefix_highlight} #[fg=#3b4261,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261] %Y-%m-%d  %I:%M %p #[fg=#7aa2f7,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#1d202f,bg=#7aa2f7,bold] #h "
if-shell '[ "$(tmux show-option -gqv "clock-mode-style")" == "24" ]' {
set -g status-right "#[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#1f2335] #{prefix_highlight} #[fg=#3b4261,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261] %Y-%m-%d  %H:%M #[fg=#7aa2f7,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#1d202f,bg=#7aa2f7,bold] #h "
}
setw -g window-status-activity-style "underscore,fg=#a9b1d6,bg=#1f2335"
setw -g window-status-separator ""
setw -g window-status-style "NONE,fg=#a9b1d6,bg=#1f2335"
setw -g window-status-format "#[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]#[default] #I  #W #F #[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]"
setw -g window-status-current-format "#[fg=#1f2335,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261,bold] #I  #W #F #[fg=#3b4261,bg=#1f2335,nobold,nounderscore,noitalics]"
# tmux-plugins/tmux-prefix-highlight support
set -g @prefix_highlight_output_prefix "#[fg=#e0af68]#[bg=#1f2335]#[fg=#1f2335]#[bg=#e0af68]"
set -g @prefix_highlight_output_suffix ""

View File

@@ -20,62 +20,62 @@ wtf:
# that support ten line of text and one of four. # that support ten line of text and one of four.
rows: [10, 10, 10, 20, 10, 4] rows: [10, 10, 10, 20, 10, 4]
refreshInterval: 1 refreshInterval: 1
openFileUtil: "open" openFileUtil: 'open'
mods: mods:
# You can have multiple widgets of the same type. # You can have multiple widgets of the same type.
# The "key" is the name of the widget and the type is the actual # The "key" is the name of the widget and the type is the actual
# widget you want to implement. # widget you want to implement.
europe_time: europe_time:
title: "Europe" title: 'Europe'
type: clocks type: clocks
colors: colors:
rows: rows:
even: "lightblue" even: 'lightblue'
odd: "white" odd: 'white'
enabled: true enabled: true
locations: locations:
GMT: "Etc/GMT" GMT: 'Etc/GMT'
Amsterdam: "Europe/Amsterdam" Amsterdam: 'Europe/Amsterdam'
Berlin: "Europe/Berlin" Berlin: 'Europe/Berlin'
Barcelona: "Europe/Madrid" Barcelona: 'Europe/Madrid'
Copenhagen: "Europe/Copenhagen" Copenhagen: 'Europe/Copenhagen'
London: "Europe/London" London: 'Europe/London'
Rome: "Europe/Rome" Rome: 'Europe/Rome'
Stockholm: "Europe/Stockholm" Stockholm: 'Europe/Stockholm'
position: position:
top: 0 top: 0
left: 0 left: 0
height: 1 height: 1
width: 1 width: 1
refreshInterval: 15 refreshInterval: 15
sort: "alphabetical" sort: 'alphabetical'
americas_time: americas_time:
title: "Americas" title: 'Americas'
type: clocks type: clocks
colors: colors:
rows: rows:
even: "lightblue" even: 'lightblue'
odd: "white" odd: 'white'
enabled: true enabled: true
locations: locations:
UTC: "Etc/UTC" UTC: 'Etc/UTC'
Vancouver: "America/Vancouver" Vancouver: 'America/Vancouver'
New_York: "America/New_York" New_York: 'America/New_York'
Sao_Paulo: "America/Sao_Paulo" Sao_Paulo: 'America/Sao_Paulo'
Denver: "America/Denver" Denver: 'America/Denver'
Iqaluit: "America/Iqaluit" Iqaluit: 'America/Iqaluit'
Bahamas: "America/Nassau" Bahamas: 'America/Nassau'
Chicago: "America/Chicago" Chicago: 'America/Chicago'
position: position:
top: 0 top: 0
left: 1 left: 1
height: 1 height: 1
width: 1 width: 1
refreshInterval: 15 refreshInterval: 15
sort: "alphabetical" sort: 'alphabetical'
battery: battery:
type: power type: power
title: "⚡️" title: '⚡️'
enabled: true enabled: true
position: position:
top: 1 top: 1
@@ -85,14 +85,14 @@ wtf:
refreshInterval: 15 refreshInterval: 15
todolist: todolist:
type: todo type: todo
checkedIcon: "X" checkedIcon: 'X'
colors: colors:
checked: gray checked: gray
highlight: highlight:
fore: "black" fore: 'black'
back: "orange" back: 'orange'
enabled: true enabled: true
filename: "todo.yml" filename: 'todo.yml'
position: position:
top: 1 top: 1
left: 0 left: 0
@@ -101,10 +101,10 @@ wtf:
refreshInterval: 3600 refreshInterval: 3600
ip: ip:
type: ipinfo type: ipinfo
title: "My IP" title: 'My IP'
colors: colors:
name: "lightblue" name: 'lightblue'
value: "white" value: 'white'
enabled: true enabled: true
position: position:
top: 0 top: 0
@@ -114,7 +114,7 @@ wtf:
refreshInterval: 150 refreshInterval: 150
security_info: security_info:
type: security type: security
title: "Staying safe" title: 'Staying safe'
enabled: true enabled: true
position: position:
top: 1 top: 1
@@ -126,9 +126,9 @@ wtf:
type: textfile type: textfile
enabled: true enabled: true
filePaths: filePaths:
- "~/.config/wtf/config.yml" - '~/.config/wtf/config.yml'
format: true format: true
formatStyle: "monokai" formatStyle: 'monokai'
position: position:
top: 3 top: 3
left: 0 left: 0
@@ -137,7 +137,7 @@ wtf:
refreshInterval: 15 refreshInterval: 15
news: news:
type: hackernews type: hackernews
title: "HackerNews" title: 'HackerNews'
enabled: true enabled: true
numberOfStories: 10 numberOfStories: 10
position: position:
@@ -159,7 +159,7 @@ wtf:
uptime: uptime:
type: cmdrunner type: cmdrunner
args: [] args: []
cmd: "uptime" cmd: 'uptime'
enabled: true enabled: true
position: position:
top: 5 top: 5
@@ -169,8 +169,8 @@ wtf:
refreshInterval: 30 refreshInterval: 30
disks: disks:
type: cmdrunner type: cmdrunner
cmd: "df" cmd: 'df'
args: ["-h"] args: ['-h']
enabled: true enabled: true
position: position:
top: 4 top: 4

View File

@@ -1,6 +1,6 @@
# nvim keybindings # nvim keybindings
```md ```
n ! * <Cmd>lua require("which-key").show("!", {mode = "n", auto = true})<CR> n ! * <Cmd>lua require("which-key").show("!", {mode = "n", auto = true})<CR>
n ' * <Cmd>lua require("which-key").show("'", {mode = "n", auto = true})<CR> n ' * <Cmd>lua require("which-key").show("'", {mode = "n", auto = true})<CR>
n " * <Cmd>lua require("which-key").show("\"", {mode = "n", auto = true})<CR> n " * <Cmd>lua require("which-key").show("\"", {mode = "n", auto = true})<CR>

View File

@@ -1,9 +1,7 @@
# tmux keybindings # tmux keybindings
Leader: `<ctrl><space>` Leader: `<ctrl><space>`
``` ```
bind-key -T copy-mode C-Space send-keys -X begin-selection bind-key -T copy-mode C-Space send-keys -X begin-selection
bind-key -T copy-mode C-a send-keys -X start-of-line bind-key -T copy-mode C-a send-keys -X start-of-line
@@ -298,4 +296,3 @@ bind-key -T root M-Right select-pane -R
bind-key -T root C-Tab previous-window bind-key -T root C-Tab previous-window
bind-key -T root C-S-Tab next-window bind-key -T root C-S-Tab next-window
``` ```

View File

@@ -1,4 +1,4 @@
- include: "tools/dotbot-defaults.yaml" - include: 'tools/dotbot-defaults.yaml'
- shell: - shell:
- echo "Configuring air" - echo "Configuring air"
- brewfile: - brewfile:
@@ -8,7 +8,7 @@
force: true force: true
glob: true glob: true
path: hosts/air/base/** path: hosts/air/base/**
prefix: "." prefix: '.'
~/.config/: ~/.config/:
glob: true glob: true
force: true force: true

View File

@@ -1,59 +0,0 @@
# Lakka zsh configuration.
#
# shellcheck shell=bash
export PATH="$HOME/bin:/usr/local/bin:/usr/bin:/usr/sbin:$PATH"
# Defaults
export DOTFILES="$HOME/.dotfiles"
# Run x-load-configs in your terminal to reload the files.
function x-load-configs()
{
HOST="$(hostname -s)"
# Load the shell dotfiles, and then some:
for file in $DOTFILES/config/{exports,alias,functions}; do
# global (exports|alias|functions) file for all hosts
# shellcheck source=../../../config/exports
[ -r "$file" ] && source "$file"
# shellcheck source=../../../config/exports
[ -r "$file-secret" ] && source "$file-secret"
# shellcheck source=../../../config/exports
[ -r "$file-$HOST" ] && source "$file-$HOST"
# shellcheck source=../../../config/exports
[ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret"
done
}
x-load-configs
export PATH="$XDG_BIN_HOME:$PATH"
export LC_ALL=fi_FI.utf8
export RVM_PATH="$HOME/.rvm"
export PATH="$RVM_PATH/bin:$PATH"
# shellcheck source=$HOME/.rvm/scripts/rvm
[[ -s "$RVM_PATH/scripts/rvm" ]] && source "$RVM_PATH/scripts/rvm" # Load RVM into a shell session *as a function*
# Try to load antigen, if present
ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh"
# shellcheck source=$HOME/.local/bin/antigen.zsh
[[ -f "$ANTIGEN_ZSH_PATH" ]] && source "$ANTIGEN_ZSH_PATH"
# If antigen was loaded
if command -v antigen &>/dev/null; then
antigen use oh-my-zsh
# config/functions
x-default-antigen-bundles
antigen theme oskarkrawczyk/honukai-iterm-zsh honukai
antigen apply
fi
alias logrotate='/usr/sbin/logrotate -s $HOME/logs/state'
alias nano='nano -wS -$'
alias gpg=gpg2
ACME_PATH="$HOME/.acme.sh"
# shellcheck source=$HOME/.acme.sh/acme.sh.env
[[ -s "$ACME_PATH/acme.sh.env" ]] && . "$ACME_PATH/acme.sh.env"

View File

@@ -1,4 +1,4 @@
- include: "tools/dotbot-defaults.yaml" - include: 'tools/dotbot-defaults.yaml'
- shell: - shell:
- echo "Configuring lakka" - echo "Configuring lakka"
- link: - link:
@@ -6,7 +6,7 @@
force: true force: true
glob: true glob: true
path: hosts/lakka/base/** path: hosts/lakka/base/**
prefix: "." prefix: '.'
~/.config/: ~/.config/:
glob: true glob: true
force: true force: true

View File

@@ -1,4 +1,4 @@
- include: "tools/dotbot-defaults.yaml" - include: 'tools/dotbot-defaults.yaml'
- shell: - shell:
- echo "Configuring tunkki" - echo "Configuring tunkki"
- link: - link:
@@ -6,8 +6,11 @@
force: true force: true
glob: true glob: true
path: hosts/tunkki/base/** path: hosts/tunkki/base/**
prefix: "." prefix: '.'
~/.config/: ~/.config/:
glob: true glob: true
force: true force: true
path: hosts/tunkki/config/** path: hosts/tunkki/config/**
- snap:
- nvim:
classic: true

View File

@@ -1,4 +1,4 @@
- include: "tools/dotbot-defaults.yaml" - include: 'tools/dotbot-defaults.yaml'
- shell: - shell:
- echo "Configuring v" - echo "Configuring v"
- link: - link:
@@ -6,7 +6,7 @@
force: true force: true
glob: true glob: true
path: hosts/v/base/** path: hosts/v/base/**
prefix: "." prefix: '.'
~/.config/: ~/.config/:
glob: true glob: true
force: true force: true

10
install
View File

@@ -18,8 +18,6 @@ git submodule update --init --recursive "${DOTBOT_DIR}"
-d "${BASEDIR}" \ -d "${BASEDIR}" \
--plugin-dir=tools/dotbot-brew \ --plugin-dir=tools/dotbot-brew \
--plugin-dir=tools/dotbot-include \ --plugin-dir=tools/dotbot-include \
--plugin-dir=tools/dotbot-crontab \
--plugin-dir=tools/dotbot-snap \
--plugin-dir=tools/dotbot-pip \ --plugin-dir=tools/dotbot-pip \
-c "${CONFIG}" \ -c "${CONFIG}" \
"${@}" "${@}"
@@ -27,14 +25,12 @@ git submodule update --init --recursive "${DOTBOT_DIR}"
if [ "${DOTBOT_HOST}" != "" ]; then if [ "${DOTBOT_HOST}" != "" ]; then
DOTBOT_HOST_CONFIG="${BASEDIR}/hosts/${DOTBOT_HOST}/${CONFIG}" DOTBOT_HOST_CONFIG="${BASEDIR}/hosts/${DOTBOT_HOST}/${CONFIG}"
echo "-> Trying if host config can be found: ${DOTBOT_HOST_CONFIG}" echo "-> Trying if host config can be found: ${DOTBOT_HOST_CONFIG}"
[ -r "$DOTBOT_HOST_CONFIG" ] && [ -f "$DOTBOT_HOST_CONFIG" ] \ [ -r "$DOTBOT_HOST_CONFIG" ] && [ -f "$DOTBOT_HOST_CONFIG" ] &&
&& echo "(!) Found $DOTBOT_HOST_CONFIG" \ echo "(!) Found $DOTBOT_HOST_CONFIG" &&
&& "$DOTBOT_BIN_PATH" \ "$DOTBOT_BIN_PATH" \
-d "$BASEDIR" \ -d "$BASEDIR" \
--plugin-dir=tools/dotbot-brew \ --plugin-dir=tools/dotbot-brew \
--plugin-dir=tools/dotbot-include \ --plugin-dir=tools/dotbot-include \
--plugin-dir=tools/dotbot-crontab \
--plugin-dir=tools/dotbot-snap \
--plugin-dir=tools/dotbot-pip \ --plugin-dir=tools/dotbot-pip \
-c "$DOTBOT_HOST_CONFIG" \ -c "$DOTBOT_HOST_CONFIG" \
"${@}" "${@}"

View File

@@ -1,4 +1,4 @@
- include: "tools/dotbot-defaults.yaml" - include: 'tools/dotbot-defaults.yaml'
- clean: - clean:
~/: ~/:
~/.config: ~/.config:
@@ -26,7 +26,7 @@
force: true force: true
glob: true glob: true
path: base/* path: base/*
prefix: "." prefix: '.'
~/.config/: ~/.config/:
glob: true glob: true
relink: true relink: true
@@ -56,15 +56,3 @@
file: tools/requirements-pipx.txt file: tools/requirements-pipx.txt
stdout: false stdout: false
stderr: true stderr: true
- crontab:
- time: 0 5 * * *
command: brew update && brew upgrade
platform: darwin # Optional
- time: 0 5 * * *
command: apt update && apt upgrade
platform: linux # Optional
- time: 0 5 * * *
command: task sync
- snap:
- nvim:
classic: true

View File

@@ -13,7 +13,7 @@ Some problematic code has been fixed per `shellcheck` suggestions.
## Sourced ## Sourced
| Script | Source | | Script | Source |
|-------------------------|-------------------| | ----------------------- | ----------------- |
| `x-dupes` | skx/sysadmin-util | | `x-dupes` | skx/sysadmin-util |
| `x-foreach` | mvdan/dotfiles | | `x-foreach` | mvdan/dotfiles |
| `x-multi-ping` | skx/sysadmin-util | | `x-multi-ping` | skx/sysadmin-util |

View File

@@ -9,8 +9,6 @@
# Helper variables, override with ENVs like `VERBOSE=1 dfm help` # Helper variables, override with ENVs like `VERBOSE=1 dfm help`
: "${VERBOSE:=0}" : "${VERBOSE:=0}"
: "${DOTFILES:=$HOME/.dotfiles}" : "${DOTFILES:=$HOME/.dotfiles}"
: "${SHARED_SCRIPT:=$DOTFILES/scripts/shared.sh}"
: "${INSTALL_SCRIPT:=$DOTFILES/scripts/install-dotfiles.sh}"
: "${BREWFILE:=$DOTFILES/config/homebrew/Brewfile}" : "${BREWFILE:=$DOTFILES/config/homebrew/Brewfile}"
: "${HOSTFILES:=$DOTFILES/hosts}" : "${HOSTFILES:=$DOTFILES/hosts}"
@@ -18,8 +16,12 @@ SCRIPT=$(basename "$0")
VERSION_NVM="v0.39.5" VERSION_NVM="v0.39.5"
export DOTFILES="$HOME/.dotfiles"
# shellcheck source=./../../scripts/shared.sh # shellcheck source=./../../scripts/shared.sh
source "$SHARED_SCRIPT" source "$HOME/.dotfiles/scripts/shared.sh"
# Loads configs for better installation experience
x-load-configs
function section_install function section_install
{ {
@@ -48,6 +50,8 @@ function section_install
case "$1" in case "$1" in
all) all)
msgr msg "Starting to install all and reloading configurations..."
x-load-configs
$0 install macos $0 install macos
$0 install fonts $0 install fonts
$0 install antigen $0 install antigen
@@ -66,6 +70,9 @@ function section_install
$0 install npm $0 install npm
$0 install ntfy $0 install ntfy
$0 install z $0 install z
msgr msg "Reloading configurations again..."
x-load-configs
msgr yay "All done!"
;; ;;
antigen) antigen)
curl -sSfL git.io/antigen -o "$DOTFILES/local/bin/antigen.zsh" \ curl -sSfL git.io/antigen -o "$DOTFILES/local/bin/antigen.zsh" \
@@ -140,10 +147,7 @@ function section_install
bash "$DOTFILES/scripts/install-ntfy.sh" \ bash "$DOTFILES/scripts/install-ntfy.sh" \
&& msg_yay "ntfy installed!" && msg_yay "ntfy installed!"
;; ;;
pip) pip) bash "$DOTFILES/scripts/install-pip-packages.sh" ;;
bash "$DOTFILES/scripts/install-pip-packages.sh" \
&& msg_yay "pip/python packages installed!"
;;
z) z)
bash "$DOTFILES/scripts/install-z.sh" \ bash "$DOTFILES/scripts/install-z.sh" \
&& msg_yay "z has been installed!" && msg_yay "z has been installed!"

222
local/bin/msgr Executable file
View File

@@ -0,0 +1,222 @@
#!/usr/bin/env bash
# msgr / Messanger helper
# Copyright (c) 2023 Ismo Vuorinen. All Rights Reserved.
# MIT License, https://opensource.org/license/mit/
# Modified from https://stackoverflow.com/a/28776166
(
[[ -n $ZSH_VERSION && $ZSH_EVAL_CONTEXT =~ :file$ ]] \
|| [[ -n $BASH_VERSION ]] && (return 0 2> /dev/null)
) && sourced=1 || sourced=0
# ╭──────────────────────────────────────────────────────────╮
# │ Colors │
# ╰──────────────────────────────────────────────────────────╯
CLR_RED="\033[1;31m"
CLR_YELLOW="\033[1;33m"
CLR_GREEN="\033[1;32m"
CLR_BLUE="\033[1;34m"
CLR_RESET="\033[0m"
# ╭──────────────────────────────────────────────────────────╮
# │ Color functions │
# ╰──────────────────────────────────────────────────────────╯
function __color_red()
{
local MSG="$1"
echo -e "${CLR_RED}${MSG}${CLR_RESET}"
}
function __color_yellow()
{
local MSG="$1"
echo -e "${CLR_YELLOW}${MSG}${CLR_RESET}"
}
function __color_green()
{
local MSG="$1"
echo -e "${CLR_GREEN}${MSG}${CLR_RESET}"
}
function __color_blue()
{
local MSG="$1"
echo -e "${CLR_BLUE}${MSG}${CLR_RESET}"
}
# ╭──────────────────────────────────────────────────────────╮
# │ Helpers │
# ╰──────────────────────────────────────────────────────────╯
function __log_marker()
{
echo -e "${CLR_BLUE}➜${CLR_RESET}"
}
function __log_marker_ok()
{
echo -e "${CLR_GREEN}✔${CLR_RESET}"
}
function __log_marker_ok_blue()
{
echo -e "${CLR_BLUE}✔${CLR_RESET}"
}
function __log_marker_warn()
{
echo -e "${CLR_YELLOW}⁕${CLR_RESET}"
}
function __log_marker_question()
{
echo -e "${CLR_YELLOW}?${CLR_RESET}"
}
function __log_marker_err()
{
echo -e "${CLR_RED}⛌${CLR_RESET}"
}
function __log_indent()
{
echo " "
}
# ╭──────────────────────────────────────────────────────────╮
# │ Log functions │
# ╰──────────────────────────────────────────────────────────╯
function msg()
{
echo -e "$(__log_marker) $1"
}
function msg_yay()
{
echo -e "🎉 $1"
}
function msg_yay_done()
{
echo -e "🎉 $1 ...$(__log_marker_ok)"
}
function msg_done()
{
echo -e "$(__log_marker) $1 ...$(__log_marker_ok)"
}
function msg_done_suffix()
{
echo -e "$(__log_marker) ...$(__log_marker_ok)"
}
function msg_prompt()
{
echo -e "$(__log_marker_question) $1"
}
function msg_prompt_done()
{
echo -e "$(__log_marker_question) $1 ...$(__log_marker_ok)"
}
function msg_nested()
{
echo -e "$(__log_indent)$(__log_marker) $1"
}
function msg_nested_done()
{
echo -e "$(__log_indent)$(__log_marker) $1 ...$(__log_marker_ok)"
}
function msg_run()
{
echo -e "${CLR_GREEN}➜ $1${CLR_RESET} $2"
}
function msg_run_done()
{
echo -e "${CLR_GREEN}➜ $1${CLR_RESET} $2 ...$(__log_marker_ok)"
}
function msg_ok()
{
echo -e "$(__log_marker_ok) $1"
}
function msg_warn()
{
echo -e "$(__log_marker_warn) $1"
}
function msg_err()
{
echo -e "$(__log_marker_err) $1"
}
# Create a prompt which you have to answer y/n to continue
ask()
{
while true; do
read -p "$1 ([y]/n) " -r
REPLY=${REPLY:-"y"}
if [[ $REPLY =~ ^[Yy]$ ]]; then
return 1
elif [[ $REPLY =~ ^[Nn]$ ]]; then
return 0
fi
done
}
# If this is being sourced, no need to run the next steps.
[ "$sourced" = 1 ] && return
function __tests()
{
msg "[ msg ]"
msg_done "[ done ]"
msg_done_suffix "[ done_suffix ]" && echo " ^-- (done_suffix)"
msg_err "[ err ]"
msg_nested "[ nested ]"
msg_nested_done "[ nested_done ]"
msg_ok "[ ok ]"
msg_prompt "[ prompt ]"
msg_prompt_done "[ prompt_done ]"
msg_run "[ run ]" "[ second_param ]"
msg_run_done "[ run_done ]" "[ second_param ]"
msg_warn "[ warn ]"
msg_yay "[ yay ]"
msg_yay_done "[ yay_done ]"
}
function usage()
{
echo "usage: msgr [type] [message] [optional second message]"
echo ""
echo "-- types and examples: --"
__tests
echo ""
}
# The main loop. first keyword after $0 triggers type, or help and usage examples.
case "$1" in
msg) msg "$2" ;;
done) msg_done "$2" ;;
done_suffix) msg_done_suffix "$2" ;;
err) msg_err "$2" ;;
nested) msg_nested "$2" ;;
nested_done) msg_nested_done "$2" ;;
ok) msg_ok "$2" ;;
prompt) msg_prompt "$2" ;;
prompt_done) msg_prompt_done "$2" ;;
run) msg_run "$2" ;;
run_done) msg_run_done "$2" "$3" ;;
warn) msg_warn "$2" ;;
yay) msg_yay "$2" ;;
yay_done) msg_yay_done "$2" ;;
tests) __tests "[first]" "[second]" ;;
*) usage && exit 0 ;;
esac

16
local/bin/x-dc Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Create directory if it doesn't exist already
#
# Copyright (c) 2023 Ismo Vuorinen. All Rights Reserved.
# Licensed under MIT License. http://www.opensource.org/licenses/mit-license.
dir="$1"
[ $# -eq 0 ] && {
echo "Usage: $0 full/path/to/dir/to/create"
exit 1
}
if [ ! -d "$dir" ]; then
mkdir -p "$dir" && exit 0
fi

View File

@@ -4,6 +4,7 @@
# Updates $HOME/.dotfiles/docs/tmux.md with my keybindings. # Updates $HOME/.dotfiles/docs/tmux.md with my keybindings.
# shellcheck source=./../../scripts/shared.sh # shellcheck source=./../../scripts/shared.sh
DOTFILES_SHARED_LOADED=""
source "$HOME/.dotfiles/scripts/shared.sh" source "$HOME/.dotfiles/scripts/shared.sh"
have tmux || { have tmux || {
@@ -15,7 +16,7 @@ TMUX_KEYBINDINGS_DOCS="$DOTFILES/docs/tmux-keybindings.md"
CB="\n\`\`\`\n" CB="\n\`\`\`\n"
KB=$(tmux list-keys) KB=$(tmux list-keys)
H="# tmux keybindings\n" H="# tmux keybindings\n"
L="\n\nLeader: \`<ctrl><space>\`\n\n" L="\nLeader: \`<ctrl><space>\`\n"
# Generalize expanded $HOME to "$HOME" # Generalize expanded $HOME to "$HOME"
KB="${KB//$HOME/\$HOME}" KB="${KB//$HOME/\$HOME}"

9
local/bin/x-have Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Returns which status
which "$1" >&/dev/null
if [ $? -eq 0 ]; then
echo 0
else
echo 1
fi

31
local/bin/x-load-configs Executable file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
# Load our configuration files
# Copyright (c) 2023 Ismo Vuorinen. All Rights Reserved.
DOTFILES="$HOME/.dotfiles"
source "$HOME/.dotfiles/scripts/shared.sh"
CONFIG_PATH="$DOTFILES/config"
# Load the shell dotfiles, and then some:
function x-load-config-fn()
{
for FILE in $CONFIG_PATH/{exports,alias,functions}; do
FILENAME="$FILE"
HOST="$(hostname -s)"
# global (exports|alias|functions) FILENAME for all hosts
# shellcheck source=../config/exports
[ -r "$FILENAME" ] && source "$FILENAME"
# global secret FILENAME, git ignored
# shellcheck source=../config/exports-secret
[ -r "$FILENAME-secret" ] && source "$FILENAME-secret"
# host specific (exports|alias|functions) FILENAME
# shellcheck source=../config/exports
[ -r "$FILENAME-$HOST" ] && source "$FILENAME-$HOST"
# host specific (exports|alias|functions) FILENAME, git ignored
# shellcheck source=../config/exports
[ -r "$FILENAME-$HOST-secret" ] && source "$FILENAME-$HOST-secret"
done
}
x-load-config-fn

36
package.json Normal file
View File

@@ -0,0 +1,36 @@
{
"name": "ivuorinen-dotfiles",
"version": "1.0.0",
"description": "ivuorinen's dotfiles, this is for linting and formatters",
"main": "index.js",
"directories": {
"doc": "docs"
},
"scripts": {
"lint:markdown": "npx markdownlint -d .",
"fix:markdown": "npx markdownlint -df .",
"lint:prettier": "npx prettier . --check",
"fix:prettier": "npx prettier . --write",
"test": "echo \"Error: no test specified\" && exit 0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ivuorinen/dotfiles.git"
},
"keywords": [
"dotfiles",
"ivuorinen"
],
"author": "Ismo Vuorinen",
"license": "ISC",
"bugs": {
"url": "https://github.com/ivuorinen/dotfiles/issues"
},
"homepage": "https://github.com/ivuorinen/dotfiles#readme",
"devDependencies": {
"@ivuorinen/commitlint-config": "^0.1.10",
"@ivuorinen/eslint-config": "^0.2.13",
"@ivuorinen/markdownlint-config": "^0.1.6",
"@ivuorinen/prettier-config": "^0.1.1"
}
}

View File

@@ -4,12 +4,20 @@
# shellcheck source=shared.sh # shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh" source "$HOME/.dotfiles/scripts/shared.sh"
! have cargo && { msg "Starting to install rust/cargo packages"
[[ $(x-have "cargo") == "1" ]] && {
msg "cargo could not be found. installing cargo with rustup.rs" msg "cargo could not be found. installing cargo with rustup.rs"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path
} }
source "$CARGO_HOME/env"
packages=( packages=(
# starship.rs
"starship"
# An incremental parsing system for programming tools
"tree-sitter-cli"
# a subprocess caching utility # a subprocess caching utility
"bkt" "bkt"
# a structural diff that understands syntax # a structural diff that understands syntax
@@ -18,9 +26,14 @@ packages=(
"eza" "eza"
# A simple, fast and user-friendly alternative to 'find' # A simple, fast and user-friendly alternative to 'find'
"fd-find" "fd-find"
# A cargo subcommand for checking and applying
# updates to installed executables
"cargo-update" "cargo-update"
"pijul" # recursively searches directories for a
# regex pattern while respecting your gitignore
"ripgrep" "ripgrep"
# A version manager for neovim
"bob-nvim"
) )
for pkg in "${packages[@]}"; do for pkg in "${packages[@]}"; do
@@ -34,3 +47,14 @@ for pkg in "${packages[@]}"; do
echo "" echo ""
done done
msg_done "Installed cargo packages!"
msg_run "Now doing the next steps for cargo packages"
# use bob to install nvim
have bob && {
bob use stable && path_append "$XDG_DATA_HOME/bob/nvim-bin"
}
msg_done "All next steps done!"

View File

@@ -3,9 +3,9 @@
# shellcheck source=shared.sh # shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh" source "$HOME/.dotfiles/scripts/shared.sh"
PBB_REQUIRED_TOOLS=(basename git mkdir cheat ls grep head awk cp echo rm) PBB_REQUIRED_TOOLS=(git cheat)
for t in ${PBB_REQUIRED_TOOLS[@]}; do for t in ${PBB_REQUIRED_TOOLS[@]}; do
! have "$t" && echo "(!) $t is missing, can't continue..." && exit 1 [[ $(x-have "$t") == "1" ]] && echo "(!) $t is missing, can't continue..." && exit 1
done done
PBB_GIT="https://github.com/dylanaraps/pure-bash-bible.git" PBB_GIT="https://github.com/dylanaraps/pure-bash-bible.git"

View File

@@ -3,9 +3,9 @@
# shellcheck source=shared.sh # shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh" source "$HOME/.dotfiles/scripts/shared.sh"
TLDR_REQUIRED_TOOLS=(basename git mkdir cheat ls grep head awk cp echo rm) TLDR_REQUIRED_TOOLS=(git cheat)
for t in ${TLDR_REQUIRED_TOOLS[@]}; do for t in ${TLDR_REQUIRED_TOOLS[@]}; do
! have "$t" && echo "(!) $t is missing, can't continue..." && exit 1 [[ $(x-have "$t") == "1" ]] && echo "(!) $t is missing, can't continue..." && exit 1
done done
TLDR_GIT="https://github.com/tldr-pages/tldr.git" TLDR_GIT="https://github.com/tldr-pages/tldr.git"

View File

@@ -4,7 +4,7 @@
# shellcheck source="shared.sh" # shellcheck source="shared.sh"
source "$HOME/.dotfiles/scripts/shared.sh" source "$HOME/.dotfiles/scripts/shared.sh"
! have php && msg_err "PHP Not Available, cannot install composer" && exit 0 [[ $(x-have "php") == "1" ]] && msg_err "PHP Not Available, cannot install composer" && exit 0
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')" EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

View File

@@ -4,7 +4,9 @@
# shellcheck source="shared.sh" # shellcheck source="shared.sh"
source "$HOME/.dotfiles/scripts/shared.sh" source "$HOME/.dotfiles/scripts/shared.sh"
! have gh \ msg_run "Installing gh (GitHub Client) extensions"
[[ $(x-have "gh") == "1" ]] \
&& msg_err "gh (GitHub Client) could not be found, please install it first" \ && msg_err "gh (GitHub Client) could not be found, please install it first" \
&& exit 0 && exit 0
@@ -28,15 +30,13 @@ extensions=(
rsese/gh-actions-status rsese/gh-actions-status
) )
msg "Starting to install GitHub CLI extensions..."
for ext in "${extensions[@]}"; do for ext in "${extensions[@]}"; do
# Trim spaces # Trim spaces
ext=${ext// /} ext=${ext// /}
# Skip comments # Skip comments
if [[ ${ext:0:1} == "#" ]]; then continue; fi if [[ ${ext:0:1} == "#" ]]; then continue; fi
msg_run "Installing $ext" msg_nested "Installing $ext"
gh extensions install "$ext" gh extensions install "$ext"
echo "" echo ""
done done

View File

@@ -6,9 +6,9 @@
# shellcheck source=shared.sh # shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh" source "$HOME/.dotfiles/scripts/shared.sh"
msg "Installing git-crypt" msg_run "Installing git-crypt"
! have git-crypt && { [[ $(x-have "git-crypt") == "1" ]] && {
REPO_URL="https://github.com/AGWA/git-crypt.git" REPO_URL="https://github.com/AGWA/git-crypt.git"
CHECK_PATH="${XDG_BIN_HOME}/git-crypt" CHECK_PATH="${XDG_BIN_HOME}/git-crypt"

View File

@@ -4,7 +4,9 @@
# shellcheck source=shared.sh # shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh" source "$HOME/.dotfiles/scripts/shared.sh"
! have go && msg "go hasn't been installed yet." && exit 0 msg_run "Installing go packages"
[[ $(x-have "go") == "1" ]] && msg "go hasn't been installed yet." && exit 0
packages=( packages=(
# A shell parser, formatter, and interpreter with bash support; includes shfmt # A shell parser, formatter, and interpreter with bash support; includes shfmt
@@ -25,6 +27,8 @@ packages=(
github.com/charmbracelet/glow@latest github.com/charmbracelet/glow@latest
# Static checker for GitHub Actions workflow files # Static checker for GitHub Actions workflow files
github.com/rhysd/actionlint/cmd/actionlint@latest github.com/rhysd/actionlint/cmd/actionlint@latest
# simple terminal UI for git commands
github.com/jesseduffield/lazygit@latest
) )
for pkg in "${packages[@]}"; do for pkg in "${packages[@]}"; do
@@ -33,16 +37,17 @@ for pkg in "${packages[@]}"; do
# Skip comments # Skip comments
if [[ ${pkg:0:1} == "#" ]]; then continue; fi if [[ ${pkg:0:1} == "#" ]]; then continue; fi
msg_run "Installing go package:" "$pkg" msg_nested "Installing go package: $pkg"
go install "$pkg" go install "$pkg"
echo "" echo ""
done done
msg "Installing completions for selected packages" msg_run "Installing completions for selected packages"
have git-profile && { have git-profile && {
git-profile completion zsh > "$ZSH_CUSTOM_COMPLETION_PATH/_git-profile" \ git-profile completion zsh > "$ZSH_CUSTOM_COMPLETION_PATH/_git-profile" \
&& msg_yay "Installed completions for git-profile" && msg_ok "Installed completions for git-profile"
} }
echo ""
msg_ok "Done" msg_ok "Done"

View File

@@ -11,7 +11,7 @@ NEOFETCH_URL="${NEOFETCH_REPO}/archive/refs/tags/${NEOFETCH_VERSION}.tar.gz"
NEOFETCH_TEMP="/tmp/neofetch" NEOFETCH_TEMP="/tmp/neofetch"
NEOFETCH_INSTALL_PREFIX="$HOME/.local" NEOFETCH_INSTALL_PREFIX="$HOME/.local"
have neofetch || { [[ $(x-have "neofetch") == "1" ]] && {
LC_ALL=C LC_ALL=C
mkdir -p "$NEOFETCH_TEMP" "$NEOFETCH_INSTALL_PREFIX" mkdir -p "$NEOFETCH_TEMP" "$NEOFETCH_INSTALL_PREFIX"

View File

@@ -4,7 +4,9 @@
# shellcheck source=shared.sh # shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh" source "$HOME/.dotfiles/scripts/shared.sh"
! have npm && msg_err "npm could not be found." && exit 0 msg "Starting to install npm packages"
[[ $(x-have "npm") == "1" ]] && msg_err "npm could not be found." && exit 0
packages=( packages=(
# This is a tool to check if your files consider your .editorconfig rules. # This is a tool to check if your files consider your .editorconfig rules.

View File

@@ -6,7 +6,7 @@
source "$HOME/.dotfiles/scripts/shared.sh" source "$HOME/.dotfiles/scripts/shared.sh"
set -e set -e
have ntfy && msg "ntfy already installed" && exit 0 [[ $(x-have "ntfy") == "0" ]] && msg "ntfy already installed" && exit 0
case $(dfm check arch) in case $(dfm check arch) in
Linux) Linux)

View File

@@ -4,13 +4,16 @@
# shellcheck source=shared.sh # shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh" source "$HOME/.dotfiles/scripts/shared.sh"
! have pip && { msg "Starting to install pip packages"
msg_err "Could not find pip, something really terrible is going on." && exit 1
[[ $(x-have "python3") == "1" ]] && {
msg_err "Could not find python3, something really weird is going on." && exit 1
} }
packages=( packages=(
"pipx" "pipx"
"libtmux" "libtmux"
"ensurepath"
) )
for pkg in "${packages[@]}"; do for pkg in "${packages[@]}"; do
@@ -19,7 +22,10 @@ for pkg in "${packages[@]}"; do
# Skip comments # Skip comments
if [[ ${pkg:0:1} == "#" ]]; then continue; fi if [[ ${pkg:0:1} == "#" ]]; then continue; fi
msg_nested "Installing pip package: $pkg"
python3 -m pip install --user "$pkg" python3 -m pip install --user "$pkg"
echo "" echo ""
done done
msg_yay "Run pip package installations"

View File

@@ -8,6 +8,11 @@
[ "$(uname)" != "Darwin" ] && echo "Not a macOS system" && exit 0 [ "$(uname)" != "Darwin" ] && echo "Not a macOS system" && exit 0
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
msg_run "Starting to set macOS defaults, these require sudo privileges:"
# Ask for the administrator password upfront # Ask for the administrator password upfront
sudo -v sudo -v
@@ -19,6 +24,8 @@ while true; do
kill -0 "$$" || exit kill -0 "$$" || exit
done 2> /dev/null & done 2> /dev/null &
msg_nested "Change user shell to zsh if it is available and not the current"
# Change user shell to zsh if not that already. # Change user shell to zsh if not that already.
if hash zsh 2> /dev/null; then if hash zsh 2> /dev/null; then
[[ "$SHELL" != $(which zsh) ]] && chsh -s "$(which zsh)" [[ "$SHELL" != $(which zsh) ]] && chsh -s "$(which zsh)"
@@ -28,6 +35,8 @@ fi
# General UI/UX # # General UI/UX #
############################################################################### ###############################################################################
msg_nested "Setting General UI/UX settings"
# Disable the sound effects on boot # Disable the sound effects on boot
sudo nvram SystemAudioVolume=" " sudo nvram SystemAudioVolume=" "
@@ -80,6 +89,8 @@ defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
# SSD-specific tweaks # # SSD-specific tweaks #
############################################################################### ###############################################################################
msg_nested "Setting SSD-specific tweaks"
# Disable hibernation (speeds up entering sleep mode) # Disable hibernation (speeds up entering sleep mode)
sudo pmset -a hibernatemode 0 sudo pmset -a hibernatemode 0
@@ -90,6 +101,8 @@ sudo pmset -a sms 0
# Trackpad, mouse, keyboard, Bluetooth accessories, and input # # Trackpad, mouse, keyboard, Bluetooth accessories, and input #
############################################################################### ###############################################################################
msg_nested "Settings for Trackpad, mouse, keyboard, Bluetooth accessories, and input"
# Increase sound quality for Bluetooth headphones/headsets # Increase sound quality for Bluetooth headphones/headsets
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 80 defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 80 defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 80
@@ -124,6 +137,8 @@ defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
# Screen # # Screen #
############################################################################### ###############################################################################
msg_nested "Settings for Screen"
# Require password immediately after sleep or screen saver begins # Require password immediately after sleep or screen saver begins
defaults write com.apple.screensaver askForPassword -int 1 defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0 defaults write com.apple.screensaver askForPasswordDelay -int 0
@@ -132,6 +147,8 @@ defaults write com.apple.screensaver askForPasswordDelay -int 0
# Finder # # Finder #
############################################################################### ###############################################################################
msg_nested "Settings for Finder"
# Set Desktop as the default location for new Finder windows # Set Desktop as the default location for new Finder windows
# For other paths, use `PfLo` and `file:///full/path/here/` # For other paths, use `PfLo` and `file:///full/path/here/`
defaults write com.apple.finder NewWindowTarget -string "PfDe" defaults write com.apple.finder NewWindowTarget -string "PfDe"
@@ -190,6 +207,8 @@ defaults write com.apple.finder FXInfoPanesExpanded -dict \
# Screenshots # # Screenshots #
############################################################################### ###############################################################################
msg_nested "Settings for Screenshots"
# Set default screenshot location # Set default screenshot location
mkdir -p "$HOME/Documents/Screenshots" mkdir -p "$HOME/Documents/Screenshots"
defaults write com.apple.screencapture "location" -string "$HOME/Documents/Screenshots" defaults write com.apple.screencapture "location" -string "$HOME/Documents/Screenshots"
@@ -204,6 +223,8 @@ defaults write com.apple.screencapture "name" -string "screenshot"
# Dock, Dashboard, and hot corners # # Dock, Dashboard, and hot corners #
############################################################################### ###############################################################################
msg_nested "Settings for Dock, Dashboard, and hot corners"
# Prevent applications from bouncing in Dock # Prevent applications from bouncing in Dock
defaults write com.apple.dock no-bouncing -bool true defaults write com.apple.dock no-bouncing -bool true
@@ -234,6 +255,8 @@ defaults write com.apple.dock showhidden -bool true
# Safari & WebKit # # Safari & WebKit #
############################################################################### ###############################################################################
msg_nested "Settings for Safari & WebKit"
# Enable Safaris debug menu # Enable Safaris debug menu
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
@@ -258,6 +281,8 @@ defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
# Activity Monitor # # Activity Monitor #
############################################################################### ###############################################################################
msg_nested "Settings for ActivityMonitor"
# Show the main window when launching Activity Monitor # Show the main window when launching Activity Monitor
defaults write com.apple.ActivityMonitor OpenMainWindow -bool true defaults write com.apple.ActivityMonitor OpenMainWindow -bool true
@@ -275,6 +300,8 @@ defaults write com.apple.ActivityMonitor SortDirection -int 0
# Address Book, Dashboard, iCal, TextEdit, and Disk Utility # # Address Book, Dashboard, iCal, TextEdit, and Disk Utility #
############################################################################### ###############################################################################
msg_nested "Settings for Address Book, Dashboard, iCal, TextEdit, and Disk Utility"
# Use plain text mode for new TextEdit documents # Use plain text mode for new TextEdit documents
defaults write com.apple.TextEdit RichText -int 0 defaults write com.apple.TextEdit RichText -int 0
@@ -286,6 +313,8 @@ defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4
# Messages # # Messages #
############################################################################### ###############################################################################
msg_nested "Settings for Messages"
# Disable smart quotes as its annoying for messages that contain code # Disable smart quotes as its annoying for messages that contain code
defaults write com.apple.messageshelper.MessageController \ defaults write com.apple.messageshelper.MessageController \
SOInputLineSettings \ SOInputLineSettings \
@@ -298,6 +327,8 @@ defaults write com.apple.messageshelper.MessageController \
-dict-add "continuousSpellCheckingEnabled" \ -dict-add "continuousSpellCheckingEnabled" \
-bool false -bool false
msg_nested "Restarting applications to apply changes"
############################################################################### ###############################################################################
# Kill affected applications # # Kill affected applications #
############################################################################### ###############################################################################
@@ -307,4 +338,5 @@ for app in "Activity Monitor" "Address Book" "Calendar" "Contacts" "cfprefsd" \
"Terminal" "Transmission" "Twitter" "iCal"; do "Terminal" "Transmission" "Twitter" "iCal"; do
killall "${app}" > /dev/null 2>&1 killall "${app}" > /dev/null 2>&1
done done
echo "Done. Note that some of these changes require a logout/restart to take effect."
msg_yay "Done. Note that some of these changes require a logout/restart to take effect."

View File

@@ -6,141 +6,160 @@
# Helper env variables. Use like this: VERBOSE=1 ./script.sh # Helper env variables. Use like this: VERBOSE=1 ./script.sh
: "${VERBOSE:=0}" : "${VERBOSE:=0}"
# -- Colors -- # # Modified from https://stackoverflow.com/a/28776166
CLR_RED="\033[1;31m" (
CLR_YELLOW="\033[1;33m" [[ -n $ZSH_VERSION && $ZSH_EVAL_CONTEXT =~ :file$ ]] \
CLR_GREEN="\033[1;32m" || [[ -n $BASH_VERSION ]] && (return 0 2> /dev/null)
CLR_BLUE="\033[1;34m" ) && sourced=1 || sourced=0
CLR_RESET="\033[0m"
# -- Color functions -- # export DOTFILES="$HOME/.dotfiles"
function __color_red() DOTFILES_CURRENT_SHELL=$(ps -p $$ -oargs=)
export DOTFILES_CURRENT_SHELL
# Explicitly set XDG folders
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_STATE_HOME="$HOME/.local/state"
# custom variables
export XDG_BIN_HOME="$HOME/.local/bin"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_RUNTIME_DIR="$HOME/.local/run"
# Remove directory from the PATH variable
# usage: path_remove ~/.local/bin
function path_remove
{ {
local MSG="$1" PATH=$(echo -n "$PATH" | awk -v RS=: -v ORS=: "\$0 != \"$1\"" | sed 's/:$//')
echo -e "${CLR_RED}${MSG}${CLR_RESET}"
}
function __color_yellow()
{
local MSG="$1"
echo -e "${CLR_YELLOW}${MSG}${CLR_RESET}"
}
function __color_green()
{
local MSG="$1"
echo -e "${CLR_GREEN}${MSG}${CLR_RESET}"
}
function __color_blue()
{
local MSG="$1"
echo -e "${CLR_BLUE}${MSG}${CLR_RESET}"
} }
# -- Helpers -- # # Append directory to the PATH
function __log_marker() # usage: path_append ~/.local/bin
function path_append
{ {
echo -e "${CLR_BLUE}${CLR_RESET}" path_remove "$1"
PATH="${PATH:+"$PATH:"}$1"
} }
function __log_marker_ok() # Prepend directory to the PATH
# usage: path_prepend ~/.local/bin
function path_prepend
{ {
echo -e "${CLR_GREEN}${CLR_RESET}" path_remove "$1"
PATH="$1${PATH:+":$PATH"}"
} }
function __log_marker_ok_blue() # Create directory if it doesn't exist already
x-dc()
{ {
echo -e "${CLR_BLUE}${CLR_RESET}" dir="$1"
[ $# -eq 0 ] && {
echo "Usage: $0 full/path/to/dir/to/create"
exit 1
}
if [ ! -d "$dir" ]; then
mkdir -p "$dir" && exit 0
fi
} }
function __log_marker_warn() # Create a new directory and enter it
mkd()
{ {
echo -e "${CLR_YELLOW}${CLR_RESET}" mkdir -p "$@" && cd "$@" || exit
} }
function __log_marker_question() # Run command silently
# Usage: silent uptime
silent()
{ {
echo -e "${CLR_YELLOW}?${CLR_RESET}" "$@" >&/dev/null
} }
function __log_marker_err() # Check if a file contains non-ascii characters
nonascii()
{ {
echo -e "${CLR_RED}${CLR_RESET}" LC_ALL=C grep -n '[^[:print:][:space:]]' "${@}"
} }
function __log_indent() # Cache commands using bkt if installed
if command -v bkt >&/dev/null; then
bkt()
{
command bkt --cache-dir="$XDG_CACHE_HOME/bkt" "$@"
}
else
# If bkt isn't installed skip its arguments and just execute directly.
# Optionally write a msg to stderr suggesting users install bkt.
bkt()
{
while [[ "$1" == --* ]]; do shift; done
"$@"
}
fi
# shorthand for checking if the system has the bin in path,
# this version does not use caching
# usage: have_command php && php -v
function have_command
{ {
echo " " command -v "$1" >&/dev/null
} }
# -- Log -- # # shorthand for checking if the system has the bin in path,
function msg() # this version uses caching
# usage: have php && php -v
function have
{ {
echo -e "$(__log_marker) $1" bkt -- which "$1" >&/dev/null
} }
function msg_yay() function brew_installed
{ {
echo -e "🎉 $1" bkt -- brew list
} }
function msg_yay_done() # shorthand for checking if brew package is installed
# usage: have_brew php && php -v
function have_brew
{ {
echo -e "🎉 $1 ...$(__log_marker_ok)" ! have brew && return 125
if bkt -- brew list "$1" &> /dev/null; then
return 0
else
return 1
fi
} }
function msg_done() CONFIG_PATH="$DOTFILES/config"
# Load the shell dotfiles, and then some:
function x-load-config-fn()
{ {
echo -e "$(__log_marker) $1 ...$(__log_marker_ok)" for FILE in $CONFIG_PATH/{exports,alias,functions}; do
FILENAME="$FILE"
HOST="$(hostname -s)"
# global (exports|alias|functions) FILENAME for all hosts
# shellcheck source=../config/exports
[ -r "$FILENAME" ] && source "$FILENAME"
# global secret FILENAME, git ignored
# shellcheck source=../config/exports-secret
[ -r "$FILENAME-secret" ] && source "$FILENAME-secret"
# host specific (exports|alias|functions) FILENAME
# shellcheck source=../config/exports
[ -r "$FILENAME-$HOST" ] && source "$FILENAME-$HOST"
# host specific (exports|alias|functions) FILENAME, git ignored
# shellcheck source=../config/exports
[ -r "$FILENAME-$HOST-secret" ] && source "$FILENAME-$HOST-secret"
done
} }
function msg_done_suffix() x-load-config-fn
{
echo -e "$(__log_marker) ...$(__log_marker_ok)"
}
function msg_prompt() source "$DOTFILES/local/bin/msgr"
{
echo -e "$(__log_marker_question) $1"
}
function msg_prompt_done()
{
echo -e "$(__log_marker_question) $1 ...$(__log_marker_ok)"
}
function msg_nested()
{
echo -e "$(__log_indent)$(__log_marker) $1"
}
function msg_nested_done()
{
echo -e "$(__log_indent)$(__log_marker) $1 ...$(__log_marker_ok)"
}
function msg_run()
{
echo -e "${CLR_GREEN}$1${CLR_RESET} $2"
}
function msg_run_done()
{
echo -e "${CLR_GREEN}$1${CLR_RESET} $2 ...$(__log_marker_ok)"
}
function msg_ok()
{
echo -e "$(__log_marker_ok) $1"
}
function msg_warn()
{
echo -e "$(__log_marker_warn) $1"
}
function msg_err()
{
echo -e "$(__log_marker_err) $1"
}
# -- Menu builder -- # # -- Menu builder -- #
function menu_section() function menu_section()
@@ -197,70 +216,6 @@ function menu_usage()
done done
} }
# Cache commands using bkt if installed
if command -v bkt >&/dev/null; then
bkt()
{
command bkt "$@"
}
else
# If bkt isn't installed skip its arguments and just execute directly.
# Optionally write a msg to stderr suggesting users install bkt.
bkt()
{
while [[ "$1" == --* ]]; do shift; done
"$@"
}
fi
# shorthand for checking if the system has the bin in path.
# usage: have php && php -v
function have
{
bkt -- command -v "$1" >&/dev/null
}
function brew_installed
{
bkt -- brew list
}
# shorthand for checking if brew package is installed
# usage: have_brew php && php -v
function have_brew
{
! have brew && return 125
if bkt -- brew list "$1" &> /dev/null; then
return 0
else
return 1
fi
}
# Remove directory from the PATH variable
# usage: path_remove ~/.local/bin
function path_remove
{
PATH=$(echo -n "$PATH" | awk -v RS=: -v ORS=: "\$0 != \"$1\"" | sed 's/:$//')
}
# Append directory to the PATH
# usage: path_append ~/.local/bin
function path_append
{
path_remove "$1"
PATH="${PATH:+"$PATH:"}$1"
}
# Prepend directory to the PATH
# usage: path_prepend ~/.local/bin
function path_prepend
{
path_remove "$1"
PATH="$1${PATH:+":$PATH"}"
}
# Creates a random string # Creates a random string
rnd() rnd()
{ {
@@ -315,45 +270,3 @@ function replacable()
return 1 return 1
} }
# Create directory if it doesn't exist already
x-dc()
{
dir="$1"
[ $# -eq 0 ] && {
echo "Usage: $0 full/path/to/dir/to/create"
exit 1
}
if [ ! -d "$dir" ]; then
mkdir -p "$dir" && exit 0
fi
}
# Create a new directory and enter it
mkd()
{
mkdir -p "$@" && cd "$@" || exit
}
# Run command silently
# Usage: silent uptime
silent()
{
"$@" >&/dev/null
}
# Create a prompt which you have to answer y/n to continue
ask()
{
while true; do
read -p "$1 ([y]/n) " -r
REPLY=${REPLY:-"y"}
if [[ $REPLY =~ ^[Yy]$ ]]; then
return 1
elif [[ $REPLY =~ ^[Nn]$ ]]; then
return 0
fi
done
}

View File

@@ -1,2 +1 @@
openapi-python-client openapi-python-client
libtmux

2918
yarn.lock Normal file

File diff suppressed because it is too large Load Diff