diff options
| author | Loek Le Blansch <loek@pipeframe.xyz> | 2026-08-02 14:48:29 +0200 |
|---|---|---|
| committer | Loek Le Blansch <loek@pipeframe.xyz> | 2026-08-02 14:48:29 +0200 |
| commit | e43eb1177872f52e949fb5f0f93396ed94b0d093 (patch) | |
| tree | 78b73af6a989fa2996d71b112e161b70d35081ef /home | |
| parent | 2f14a896e4b897bd747c24d7ad8e9e7bb3237d03 (diff) | |
move to chezmoi
Diffstat (limited to 'home')
290 files changed, 7478 insertions, 0 deletions
diff --git a/home/dot_config/BetterDiscord/data/stable/custom.css b/home/dot_config/BetterDiscord/data/stable/custom.css new file mode 100644 index 0000000..c2a6d52 --- /dev/null +++ b/home/dot_config/BetterDiscord/data/stable/custom.css @@ -0,0 +1,2 @@ +li:has(a[href="/shop"]) { display: none; } +li:has(a[href="/store"]) { display: none; }
\ No newline at end of file diff --git a/home/dot_config/BetterDiscord/data/stable/plugins.json b/home/dot_config/BetterDiscord/data/stable/plugins.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/home/dot_config/BetterDiscord/data/stable/plugins.json @@ -0,0 +1 @@ +{}
\ No newline at end of file diff --git a/home/dot_config/BetterDiscord/data/stable/settings.json b/home/dot_config/BetterDiscord/data/stable/settings.json new file mode 100644 index 0000000..bf9a764 --- /dev/null +++ b/home/dot_config/BetterDiscord/data/stable/settings.json @@ -0,0 +1,53 @@ +{ + "general": { + "voiceDisconnect": false, + "showToasts": true, + "mediaKeys": false, + "themeAttributes": true, + "notificationPosition": "top-right", + "notificationEnabled": true + }, + "addons": { + "addonErrors": true, + "editAction": "detached", + "checkForUpdates": true, + "updateInterval": 4 + }, + "store": { + "bdAddonStore": true, + "alwaysEnable": false, + "addonEmbeds": true + }, + "customcss": { + "customcss": true, + "liveUpdate": true, + "openAction": "settings" + }, + "editor": { + "theme": "system", + "lineNumbers": true, + "minimap": true, + "hover": true, + "quickSuggestions": true, + "insertSpaces": false, + "tabSize": 4, + "fontSize": 14, + "renderWhitespace": "selection" + }, + "window": { + "transparency": false, + "removeMinimumSize": true, + "frame": false, + "inAppTrafficLights": false + }, + "developer": { + "debugLogs": false, + "devTools": true, + "debuggerHotkey": false, + "reactDevTools": false, + "inspectElement": false, + "devToolsWarning": false, + "recovery": true, + "canary": false + } +}
\ No newline at end of file diff --git a/home/dot_config/BetterDiscord/data/stable/themes.json b/home/dot_config/BetterDiscord/data/stable/themes.json new file mode 100644 index 0000000..3afcd03 --- /dev/null +++ b/home/dot_config/BetterDiscord/data/stable/themes.json @@ -0,0 +1,5 @@ +{ + "Horizontal Server List": true, + "flat": true, + "mode": true +}
\ No newline at end of file diff --git a/home/dot_config/BetterDiscord/themes/flat.theme.css b/home/dot_config/BetterDiscord/themes/flat.theme.css new file mode 100644 index 0000000..fdac8d1 --- /dev/null +++ b/home/dot_config/BetterDiscord/themes/flat.theme.css @@ -0,0 +1,580 @@ +/** + * @name flat + * @author lonkaars + * @version 0 +*/ + +/** this is a lazy theme, do not report bugs */ + +.theme-darker { + + --app-frame-border: var(--background-primary) !important; + --background-base-low: var(--background-primary) !important; + --background-base-lower: var(--background-primary) !important; + --background-base-lowest: var(--background-primary) !important; + --card-background-default: var(--background-primary) !important; + --chat-background-default: var(--background-primary) !important; + --background-surface-high: var(--background-primary) !important; + + --background-mod-subtle: var(--background-secondary) !important; + + --background-mod-muted: var(--background-tertiary) !important; + --background-mod-normal: var(--background-tertiary) !important; + --interactive-background-hover: var(--background-tertiary) !important; + --interactive-background-selected: var(--background-tertiary) !important; + + --text-default: var(--text-primary) !important; + + /* --ansi-black: #ff00ff !important; */ + /* --ansi-blue: #ff00ff !important; */ + /* --ansi-bright-black: #ff00ff !important; */ + /* --ansi-bright-blue: #ff00ff !important; */ + /* --ansi-bright-cyan: #ff00ff !important; */ + /* --ansi-bright-green: #ff00ff !important; */ + /* --ansi-bright-magenta: #ff00ff !important; */ + /* --ansi-bright-red: #ff00ff !important; */ + /* --ansi-bright-white: #ff00ff !important; */ + /* --ansi-bright-yellow: #ff00ff !important; */ + /* --ansi-cyan: #ff00ff !important; */ + /* --ansi-green: #ff00ff !important; */ + /* --ansi-magenta: #ff00ff !important; */ + /* --ansi-red: #ff00ff !important; */ + /* --ansi-white: #ff00ff !important; */ + /* --ansi-yellow: #ff00ff !important; */ + /* --app-frame-background: #ff00ff !important; */ + /* --app-frame-border: #ff00ff !important; */ + /* --app-message-embed-secondary-text: #ff00ff !important; */ + /* --background-accent: #ff00ff !important; */ + /* --background-brand: #ff00ff !important; */ + /* --background-code-addition: #ff00ff !important; */ + /* --background-code-deletion: #ff00ff !important; */ + /* --background-code: #ff00ff !important; */ + /* --background-feedback-critical: #ff00ff !important; */ + /* --background-feedback-info: #ff00ff !important; */ + /* --background-feedback-notification: #ff00ff !important; */ + /* --background-feedback-positive: #ff00ff !important; */ + /* --background-feedback-warning: #ff00ff !important; */ + /* --background-scrim-lightbox: #ff00ff !important; */ + /* --background-scrim: #ff00ff !important; */ + /* --background-secondary-alt: #ff00ff !important; */ + /* --background-surface-higher: #ff00ff !important; */ + /* --background-surface-highest: #ff00ff !important; */ + /* --background-tile-gradient-pink-end: #ff00ff !important; */ + /* --background-tile-gradient-pink-start: #ff00ff !important; */ + /* --background-voice-muted: #ff00ff !important; */ + /* --badge-background-brand: #ff00ff !important; */ + /* --badge-background-default: #ff00ff !important; */ + /* --badge-common-background: #ff00ff !important; */ + /* --badge-common-border: #ff00ff !important; */ + /* --badge-common-text: #ff00ff !important; */ + /* --badge-epic-background: #ff00ff !important; */ + /* --badge-epic-border-gradient-end: #ff00ff !important; */ + /* --badge-epic-border-gradient-start: #ff00ff !important; */ + /* --badge-epic-text: #ff00ff !important; */ + /* --badge-expressive-background-default: #ff00ff !important; */ + /* --badge-expressive-text-default: #ff00ff !important; */ + /* --badge-mythic-background: #ff00ff !important; */ + /* --badge-mythic-border-gradient-end: #ff00ff !important; */ + /* --badge-mythic-border-gradient-start: #ff00ff !important; */ + /* --badge-mythic-text: #ff00ff !important; */ + /* --badge-notification-background: #ff00ff !important; */ + /* --badge-rare-background: #ff00ff !important; */ + /* --badge-rare-border-gradient-end: #ff00ff !important; */ + /* --badge-rare-border-gradient-start: #ff00ff !important; */ + /* --badge-rare-text: #ff00ff !important; */ + /* --badge-text-brand: #ff00ff !important; */ + /* --badge-text-default: #ff00ff !important; */ + /* --bg-surface-raised: #ff00ff !important; */ + /* --border-feedback-critical: #ff00ff !important; */ + /* --border-feedback-info: #ff00ff !important; */ + /* --border-feedback-positive: #ff00ff !important; */ + /* --border-feedback-warning: #ff00ff !important; */ + /* --border-focus: #ff00ff !important; */ + /* --border-muted: #ff00ff !important; */ + /* --border-normal: #ff00ff !important; */ + /* --border-strong: #ff00ff !important; */ + /* --border-subtle: #ff00ff !important; */ + /* --border-voice-muted: #ff00ff !important; */ + /* --button-danger-background-disabled: #ff00ff !important; */ + /* --button-outline-brand-background-hover: #ff00ff !important; */ + /* --button-outline-brand-border-active: #ff00ff !important; */ + /* --button-outline-primary-text: #ff00ff !important; */ + /* --card-border-default: #ff00ff !important; */ + /* --card-primary-pressed-bg: #ff00ff !important; */ + /* --card-secondary-bg: #ff00ff !important; */ + /* --card-secondary-pressed-bg: #ff00ff !important; */ + /* --channel-background-default: #ff00ff !important; */ + /* --channel-icon: #ff00ff !important; */ + /* --channel-text-area-placeholder: #ff00ff !important; */ + /* --channels-default: #ff00ff !important; */ + /* --channeltextarea-background: #ff00ff !important; */ + /* --chart-brand: #ff00ff !important; */ + /* --chart-categorical-10: #ff00ff !important; */ + /* --chart-categorical-1: #ff00ff !important; */ + /* --chart-categorical-2: #ff00ff !important; */ + /* --chart-categorical-3: #ff00ff !important; */ + /* --chart-categorical-4: #ff00ff !important; */ + /* --chart-categorical-5: #ff00ff !important; */ + /* --chart-categorical-6: #ff00ff !important; */ + /* --chart-categorical-7: #ff00ff !important; */ + /* --chart-categorical-8: #ff00ff !important; */ + /* --chart-categorical-9: #ff00ff !important; */ + /* --chart-mono-1: #ff00ff !important; */ + /* --chart-mono-2: #ff00ff !important; */ + /* --chart-mono-3: #ff00ff !important; */ + /* --chart-mono-4: #ff00ff !important; */ + /* --chart-mono-5: #ff00ff !important; */ + /* --chart-mono-6: #ff00ff !important; */ + /* --chart-mono-7: #ff00ff !important; */ + /* --chart-mono-text-1: #ff00ff !important; */ + /* --chart-mono-text-2: #ff00ff !important; */ + /* --chart-mono-text-3: #ff00ff !important; */ + /* --chart-mono-text-4: #ff00ff !important; */ + /* --chart-mono-text-5: #ff00ff !important; */ + /* --chart-mono-text-6: #ff00ff !important; */ + /* --chart-mono-text-7: #ff00ff !important; */ + /* --chart-negative: #ff00ff !important; */ + /* --chart-neutral: #ff00ff !important; */ + /* --chart-positive: #ff00ff !important; */ + /* --chat-background-default: #ff00ff !important; */ + /* --chat-background: #ff00ff !important; */ + /* --chat-border: #ff00ff !important; */ + /* --chat-text-muted: #ff00ff !important; */ + /* --checkbox-background-active: #ff00ff !important; */ + /* --checkbox-background-default: #ff00ff !important; */ + /* --checkbox-background-hover: #ff00ff !important; */ + /* --checkbox-background-selected-default: #ff00ff !important; */ + /* --checkbox-background-selected-hover: #ff00ff !important; */ + /* --checkbox-border-active: #ff00ff !important; */ + /* --checkbox-border-default: #ff00ff !important; */ + /* --checkbox-border-hover: #ff00ff !important; */ + /* --checkbox-border-selected-default: #ff00ff !important; */ + /* --checkbox-border-selected-hover: #ff00ff !important; */ + /* --checkbox-icon-active: #ff00ff !important; */ + /* --chip-blurple-dark-background: #ff00ff !important; */ + /* --chip-blurple-dark-text: #ff00ff !important; */ + /* --chip-blurple-light-background: #ff00ff !important; */ + /* --chip-blurple-light-text: #ff00ff !important; */ + /* --chip-blurple-medium-background: #ff00ff !important; */ + /* --chip-blurple-medium-text: #ff00ff !important; */ + /* --chip-gray-dark-background: #ff00ff !important; */ + /* --chip-gray-dark-text: #ff00ff !important; */ + /* --chip-gray-light-background: #ff00ff !important; */ + /* --chip-gray-light-text: #ff00ff !important; */ + /* --chip-gray-medium-background: #ff00ff !important; */ + /* --chip-gray-medium-text: #ff00ff !important; */ + /* --chip-green-dark-background: #ff00ff !important; */ + /* --chip-green-dark-text: #ff00ff !important; */ + /* --chip-green-light-background: #ff00ff !important; */ + /* --chip-green-light-text: #ff00ff !important; */ + /* --chip-green-medium-background: #ff00ff !important; */ + /* --chip-green-medium-text: #ff00ff !important; */ + /* --chip-orange-dark-background: #ff00ff !important; */ + /* --chip-orange-dark-text: #ff00ff !important; */ + /* --chip-orange-light-background: #ff00ff !important; */ + /* --chip-orange-light-text: #ff00ff !important; */ + /* --chip-orange-medium-background: #ff00ff !important; */ + /* --chip-orange-medium-text: #ff00ff !important; */ + /* --chip-pink-dark-background: #ff00ff !important; */ + /* --chip-pink-dark-text: #ff00ff !important; */ + /* --chip-pink-light-background: #ff00ff !important; */ + /* --chip-pink-light-text: #ff00ff !important; */ + /* --chip-pink-medium-background: #ff00ff !important; */ + /* --chip-pink-medium-text: #ff00ff !important; */ + /* --chip-purple-dark-background: #ff00ff !important; */ + /* --chip-purple-dark-text: #ff00ff !important; */ + /* --chip-purple-light-background: #ff00ff !important; */ + /* --chip-purple-light-text: #ff00ff !important; */ + /* --chip-purple-medium-background: #ff00ff !important; */ + /* --chip-purple-medium-text: #ff00ff !important; */ + /* --chip-red-dark-background: #ff00ff !important; */ + /* --chip-red-dark-text: #ff00ff !important; */ + /* --chip-red-light-background: #ff00ff !important; */ + /* --chip-red-light-text: #ff00ff !important; */ + /* --chip-red-medium-background: #ff00ff !important; */ + /* --chip-red-medium-text: #ff00ff !important; */ + /* --chip-yellow-dark-background: #ff00ff !important; */ + /* --chip-yellow-dark-text: #ff00ff !important; */ + /* --chip-yellow-light-background: #ff00ff !important; */ + /* --chip-yellow-light-text: #ff00ff !important; */ + /* --chip-yellow-medium-background: #ff00ff !important; */ + /* --chip-yellow-medium-text: #ff00ff !important; */ + /* --collectibles-tab-gradient-center: #ff00ff !important; */ + /* --collectibles-tab-gradient-inner: #ff00ff !important; */ + /* --collectibles-tab-gradient-outer: #ff00ff !important; */ + /* --content-inventory-media-seekbar-container: #ff00ff !important; */ + /* --content-inventory-overlay-text-primary: #ff00ff !important; */ + /* --content-inventory-overlay-text-secondary: #ff00ff !important; */ + /* --context-menu-backdrop-background: #ff00ff !important; */ + /* --control-brand-foreground-new: #ff00ff !important; */ + /* --control-brand-foreground: #ff00ff !important; */ + /* --control-connected-background-active: #ff00ff !important; */ + /* --control-connected-background-default: #ff00ff !important; */ + /* --control-connected-background-hover: #ff00ff !important; */ + /* --control-connected-border-active: #ff00ff !important; */ + /* --control-connected-border-default: #ff00ff !important; */ + /* --control-connected-border-hover: #ff00ff !important; */ + /* --control-connected-icon-active: #ff00ff !important; */ + /* --control-connected-icon-default: #ff00ff !important; */ + /* --control-connected-icon-hover: #ff00ff !important; */ + /* --control-connected-text-active: #ff00ff !important; */ + /* --control-connected-text-default: #ff00ff !important; */ + /* --control-connected-text-hover: #ff00ff !important; */ + /* --control-critical-primary-background-active: #ff00ff !important; */ + /* --control-critical-primary-background-default: #ff00ff !important; */ + /* --control-critical-primary-background-hover: #ff00ff !important; */ + /* --control-critical-primary-border-active: #ff00ff !important; */ + /* --control-critical-primary-border-default: #ff00ff !important; */ + /* --control-critical-primary-border-hover: #ff00ff !important; */ + /* --control-critical-primary-icon-active: #ff00ff !important; */ + /* --control-critical-primary-icon-default: #ff00ff !important; */ + /* --control-critical-primary-icon-hover: #ff00ff !important; */ + /* --control-critical-primary-text-active: #ff00ff !important; */ + /* --control-critical-primary-text-default: #ff00ff !important; */ + /* --control-critical-primary-text-hover: #ff00ff !important; */ + /* --control-critical-secondary-background-active: #ff00ff !important; */ + /* --control-critical-secondary-background-default: #ff00ff !important; */ + /* --control-critical-secondary-background-hover: #ff00ff !important; */ + /* --control-critical-secondary-border-active: #ff00ff !important; */ + /* --control-critical-secondary-border-default: #ff00ff !important; */ + /* --control-critical-secondary-border-hover: #ff00ff !important; */ + /* --control-critical-secondary-icon-active: #ff00ff !important; */ + /* --control-critical-secondary-icon-default: #ff00ff !important; */ + /* --control-critical-secondary-icon-hover: #ff00ff !important; */ + /* --control-critical-secondary-text-active: #ff00ff !important; */ + /* --control-critical-secondary-text-default: #ff00ff !important; */ + /* --control-critical-secondary-text-hover: #ff00ff !important; */ + /* --control-expressive-background-active: #ff00ff !important; */ + /* --control-expressive-background-default: #ff00ff !important; */ + /* --control-expressive-background-hover: #ff00ff !important; */ + /* --control-expressive-border-active: #ff00ff !important; */ + /* --control-expressive-border-default: #ff00ff !important; */ + /* --control-expressive-border-hover: #ff00ff !important; */ + /* --control-expressive-icon-active: #ff00ff !important; */ + /* --control-expressive-icon-default: #ff00ff !important; */ + /* --control-expressive-icon-hover: #ff00ff !important; */ + /* --control-expressive-text-active: #ff00ff !important; */ + /* --control-expressive-text-default: #ff00ff !important; */ + /* --control-expressive-text-hover: #ff00ff !important; */ + /* --control-icon-only-background-active: #ff00ff !important; */ + /* --control-icon-only-background-hover: #ff00ff !important; */ + /* --control-icon-only-border-active: #ff00ff !important; */ + /* --control-icon-only-border-hover: #ff00ff !important; */ + /* --control-icon-only-icon-active: #ff00ff !important; */ + /* --control-icon-only-icon-default: #ff00ff !important; */ + /* --control-icon-only-icon-hover: #ff00ff !important; */ + /* --control-overlay-primary-background-active: #ff00ff !important; */ + /* --control-overlay-primary-background-default: #ff00ff !important; */ + /* --control-overlay-primary-background-hover: #ff00ff !important; */ + /* --control-overlay-primary-border-active: #ff00ff !important; */ + /* --control-overlay-primary-border-default: #ff00ff !important; */ + /* --control-overlay-primary-border-hover: #ff00ff !important; */ + /* --control-overlay-primary-icon-active: #ff00ff !important; */ + /* --control-overlay-primary-icon-default: #ff00ff !important; */ + /* --control-overlay-primary-icon-hover: #ff00ff !important; */ + /* --control-overlay-primary-text-active: #ff00ff !important; */ + /* --control-overlay-primary-text-default: #ff00ff !important; */ + /* --control-overlay-primary-text-hover: #ff00ff !important; */ + /* --control-overlay-secondary-background-active: #ff00ff !important; */ + /* --control-overlay-secondary-background-default: #ff00ff !important; */ + /* --control-overlay-secondary-background-hover: #ff00ff !important; */ + /* --control-overlay-secondary-border-active: #ff00ff !important; */ + /* --control-overlay-secondary-border-default: #ff00ff !important; */ + /* --control-overlay-secondary-border-hover: #ff00ff !important; */ + /* --control-overlay-secondary-icon-active: #ff00ff !important; */ + /* --control-overlay-secondary-icon-default: #ff00ff !important; */ + /* --control-overlay-secondary-icon-hover: #ff00ff !important; */ + /* --control-overlay-secondary-text-active: #ff00ff !important; */ + /* --control-overlay-secondary-text-default: #ff00ff !important; */ + /* --control-overlay-secondary-text-hover: #ff00ff !important; */ + /* --control-primary-background-active: #ff00ff !important; */ + /* --control-primary-background-default: #ff00ff !important; */ + /* --control-primary-background-hover: #ff00ff !important; */ + /* --control-primary-border-active: #ff00ff !important; */ + /* --control-primary-border-default: #ff00ff !important; */ + /* --control-primary-border-hover: #ff00ff !important; */ + /* --control-primary-icon-active: #ff00ff !important; */ + /* --control-primary-icon-default: #ff00ff !important; */ + /* --control-primary-icon-hover: #ff00ff !important; */ + /* --control-primary-text-active: #ff00ff !important; */ + /* --control-primary-text-default: #ff00ff !important; */ + /* --control-primary-text-hover: #ff00ff !important; */ + /* --control-secondary-background-active: #ff00ff !important; */ + /* --control-secondary-background-default: #ff00ff !important; */ + /* --control-secondary-background-hover: #ff00ff !important; */ + /* --control-secondary-border-active: #ff00ff !important; */ + /* --control-secondary-border-default: #ff00ff !important; */ + /* --control-secondary-border-hover: #ff00ff !important; */ + /* --control-secondary-icon-active: #ff00ff !important; */ + /* --control-secondary-icon-default: #ff00ff !important; */ + /* --control-secondary-icon-hover: #ff00ff !important; */ + /* --control-secondary-text-active: #ff00ff !important; */ + /* --control-secondary-text-default: #ff00ff !important; */ + /* --control-secondary-text-hover: #ff00ff !important; */ + /* --creator-revenue-icon-gradient-end: #ff00ff !important; */ + /* --creator-revenue-icon-gradient-start: #ff00ff !important; */ + /* --creator-revenue-info-box-background: #ff00ff !important; */ + /* --creator-revenue-info-box-border: #ff00ff !important; */ + /* --creator-revenue-locked-channel-icon: #ff00ff !important; */ + /* --creator-revenue-progress-bar: #ff00ff !important; */ + /* --datepicker-range-background-default: #ff00ff !important; */ + /* --datepicker-range-background-hover: #ff00ff !important; */ + /* --embed-background-alternate: #ff00ff !important; */ + /* --embed-background: #ff00ff !important; */ + /* --experimental-avatar-embed-bg: #ff00ff !important; */ + /* --expressive-gradient-blue-end: #ff00ff !important; */ + /* --expressive-gradient-blue-start: #ff00ff !important; */ + /* --expressive-gradient-green-end: #ff00ff !important; */ + /* --expressive-gradient-green-start: #ff00ff !important; */ + /* --expressive-gradient-nitro-green-end: #ff00ff !important; */ + /* --expressive-gradient-nitro-green-start: #ff00ff !important; */ + /* --expressive-gradient-nitro-pink-end: #ff00ff !important; */ + /* --expressive-gradient-nitro-pink-start: #ff00ff !important; */ + /* --expressive-gradient-pink-end: #ff00ff !important; */ + /* --expressive-gradient-pink-start: #ff00ff !important; */ + /* --expressive-gradient-purple-end: #ff00ff !important; */ + /* --expressive-gradient-purple-start: #ff00ff !important; */ + /* --expressive-gradient-tenure-badge-bronze-end: #ff00ff !important; */ + /* --expressive-gradient-tenure-badge-bronze-start: #ff00ff !important; */ + /* --expressive-gradient-tenure-badge-diamond-end: #ff00ff !important; */ + /* --expressive-gradient-tenure-badge-diamond-start: #ff00ff !important; */ + /* --expressive-gradient-tenure-badge-emerald-end: #ff00ff !important; */ + /* --expressive-gradient-tenure-badge-emerald-start: #ff00ff !important; */ + /* --expressive-gradient-tenure-badge-gold-end: #ff00ff !important; */ + /* --expressive-gradient-tenure-badge-gold-start: #ff00ff !important; */ + /* --expressive-gradient-tenure-badge-opal-end: #ff00ff !important; */ + /* --expressive-gradient-tenure-badge-opal-start: #ff00ff !important; */ + /* --expressive-gradient-tenure-badge-platinum-end: #ff00ff !important; */ + /* --expressive-gradient-tenure-badge-platinum-start: #ff00ff !important; */ + /* --expressive-gradient-tenure-badge-ruby-end: #ff00ff !important; */ + /* --expressive-gradient-tenure-badge-ruby-start: #ff00ff !important; */ + /* --expressive-gradient-tenure-badge-silver-end: #ff00ff !important; */ + /* --expressive-gradient-tenure-badge-silver-start: #ff00ff !important; */ + /* --gradient-progress-pill-background: #ff00ff !important; */ + /* --guild-profile-banner-background-default: #ff00ff !important; */ + /* --home-background: #ff00ff !important; */ + /* --icon-default: #ff00ff !important; */ + /* --icon-feedback-critical: #ff00ff !important; */ + /* --icon-feedback-info: #ff00ff !important; */ + /* --icon-feedback-notification: #ff00ff !important; */ + /* --icon-feedback-positive: #ff00ff !important; */ + /* --icon-feedback-warning: #ff00ff !important; */ + /* --icon-invert: #ff00ff !important; */ + /* --icon-link: #ff00ff !important; */ + /* --icon-muted: #ff00ff !important; */ + /* --icon-overlay-dark: #ff00ff !important; */ + /* --icon-overlay-light: #ff00ff !important; */ + /* --icon-status-dnd: #ff00ff !important; */ + /* --icon-status-idle: #ff00ff !important; */ + /* --icon-status-offline: #ff00ff !important; */ + /* --icon-status-online: #ff00ff !important; */ + /* --icon-strong: #ff00ff !important; */ + /* --icon-subtle: #ff00ff !important; */ + /* --icon-transparent: #ff00ff !important; */ + /* --icon-voice-connected: #ff00ff !important; */ + /* --icon-voice-disconnected: #ff00ff !important; */ + /* --icon-voice-muted: #ff00ff !important; */ + /* --icon-voice-speaking: #ff00ff !important; */ + /* --inlinenotice-border-critical: #ff00ff !important; */ + /* --inlinenotice-border-info: #ff00ff !important; */ + /* --inlinenotice-border-positive: #ff00ff !important; */ + /* --inlinenotice-border-warning: #ff00ff !important; */ + /* --input-background-default: #ff00ff !important; */ + /* --input-background-error-default: #ff00ff !important; */ + /* --input-border-active: #ff00ff !important; */ + /* --input-border-default: #ff00ff !important; */ + /* --input-border-error-default: #ff00ff !important; */ + /* --input-border-hover: #ff00ff !important; */ + /* --input-border-readonly: #ff00ff !important; */ + /* --input-icon-default: #ff00ff !important; */ + /* --input-placeholder-text-default: #ff00ff !important; */ + /* --input-text-default: #ff00ff !important; */ + /* --input-text-error-default: #ff00ff !important; */ + /* --interactive-accent-background-active: #ff00ff !important; */ + /* --interactive-accent-background-default: #ff00ff !important; */ + /* --interactive-accent-background-hover: #ff00ff !important; */ + /* --interactive-accent-background-selected: #ff00ff !important; */ + /* --interactive-background-active: #ff00ff !important; */ + /* --interactive-background-hover: #ff00ff !important; */ + /* --interactive-icon-active: #ff00ff !important; */ + /* --interactive-icon-default: #ff00ff !important; */ + /* --interactive-icon-hover: #ff00ff !important; */ + /* --interactive-muted: #ff00ff !important; */ + /* --interactive-text-active: #ff00ff !important; */ + /* --interactive-text-default: #ff00ff !important; */ + /* --interactive-text-hover: #ff00ff !important; */ + /* --keyword-highlight-background: #ff00ff !important; */ + /* --logo-primary: #ff00ff !important; */ + /* --mention-background: #ff00ff !important; */ + /* --mention-foreground: #ff00ff !important; */ + /* --message-automod-background-default: #ff00ff !important; */ + /* --message-automod-background-hover: #ff00ff !important; */ + /* --message-background-hover: #ff00ff !important; */ + /* --message-highlight-background-default: #ff00ff !important; */ + /* --message-highlight-background-hover: #ff00ff !important; */ + /* --message-mentioned-background-default: #ff00ff !important; */ + /* --message-mentioned-background-hover: #ff00ff !important; */ + /* --mobile-background-scrim-opaque: #ff00ff !important; */ + /* --mobile-expression-picker-background-default: #ff00ff !important; */ + /* --mobile-guildbar-icon-default: #ff00ff !important; */ + /* --mobile-searchbar-gradient-background: #ff00ff !important; */ + /* --mobile-text-heading-primary: #ff00ff !important; */ + /* --modal-background: #ff00ff !important; */ + /* --modal-footer-background: #ff00ff !important; */ + /* --navigator-header-tint: #ff00ff !important; */ + /* --nitro-tab-gradient-center: #ff00ff !important; */ + /* --nitro-tab-gradient-inner-ring: #ff00ff !important; */ + /* --nitro-tab-gradient-outer-ring: #ff00ff !important; */ + /* --notice-background-critical: #ff00ff !important; */ + /* --notice-background-info: #ff00ff !important; */ + /* --notice-background-positive: #ff00ff !important; */ + /* --notice-background-warning: #ff00ff !important; */ + /* --notice-text-critical: #ff00ff !important; */ + /* --notice-text-info: #ff00ff !important; */ + /* --notice-text-positive: #ff00ff !important; */ + /* --notice-text-warning: #ff00ff !important; */ + /* --overlay-backdrop-lightbox: #ff00ff !important; */ + /* --panel-bg: #ff00ff !important; */ + /* --polls-normal-image-background: #ff00ff !important; */ + /* --polls-victor-fill: #ff00ff !important; */ + /* --polls-voted-fill: #ff00ff !important; */ + /* --premium-nitro-pink-text: #ff00ff !important; */ + /* --profile-gradient-note-background: #ff00ff !important; */ + /* --profile-gradient-overlay-synced-with-user-theme: #ff00ff !important; */ + /* --profile-gradient-overlay: #ff00ff !important; */ + /* --profile-gradient-role-pill-background: #ff00ff !important; */ + /* --profile-gradient-role-pill-border: #ff00ff !important; */ + /* --profile-gradient-section-box: #ff00ff !important; */ + /* --progressbar-indicator-background: #ff00ff !important; */ + /* --progressbar-track-background: #ff00ff !important; */ + /* --quest-home-tab-gradient-blurple-center: #ff00ff !important; */ + /* --quest-home-tab-gradient-blurple-inner: #ff00ff !important; */ + /* --quest-home-tab-gradient-blurple-outer: #ff00ff !important; */ + /* --radio-background-active: #ff00ff !important; */ + /* --radio-background-default: #ff00ff !important; */ + /* --radio-background-hover: #ff00ff !important; */ + /* --radio-background-selected-default: #ff00ff !important; */ + /* --radio-background-selected-hover: #ff00ff !important; */ + /* --radio-border-active: #ff00ff !important; */ + /* --radio-border-default: #ff00ff !important; */ + /* --radio-border-hover: #ff00ff !important; */ + /* --radio-border-selected-default: #ff00ff !important; */ + /* --radio-border-selected-hover: #ff00ff !important; */ + /* --radio-foreground-active: #ff00ff !important; */ + /* --radio-foreground-default: #ff00ff !important; */ + /* --radio-foreground-hover: #ff00ff !important; */ + /* --radio-thumb-background-active: #ff00ff !important; */ + /* --reaction-background-active: #ff00ff !important; */ + /* --reaction-background-default: #ff00ff !important; */ + /* --reaction-background-hover: #ff00ff !important; */ + /* --reaction-background-reacted-default: #ff00ff !important; */ + /* --reaction-background-reacted-hover: #ff00ff !important; */ + /* --reaction-border-active: #ff00ff !important; */ + /* --reaction-border-default: #ff00ff !important; */ + /* --reaction-border-hover: #ff00ff !important; */ + /* --reaction-border-reacted-default: #ff00ff !important; */ + /* --reaction-text-active: #ff00ff !important; */ + /* --reaction-text-default: #ff00ff !important; */ + /* --reaction-text-hover: #ff00ff !important; */ + /* --reaction-text-reacted-default: #ff00ff !important; */ + /* --redesign-button-premium-primary-pink-for-gradient: #ff00ff !important; */ + /* --redesign-button-premium-primary-pressed-background: #ff00ff !important; */ + /* --redesign-button-premium-primary-purple-for-gradient-2: #ff00ff !important; */ + /* --redesign-button-premium-primary-purple-for-gradient: #ff00ff !important; */ + /* --redesign-button-tertiary-background: #ff00ff !important; */ + /* --redesign-button-tertiary-pressed-background: #ff00ff !important; */ + /* --redesign-button-tertiary-pressed-text: #ff00ff !important; */ + /* --redesign-button-tertiary-text: #ff00ff !important; */ + /* --scrollbar-auto-scrollbar-color-thumb: #ff00ff !important; */ + /* --scrollbar-auto-scrollbar-color-track: #ff00ff !important; */ + /* --scrollbar-auto-thumb: #ff00ff !important; */ + /* --scrollbar-auto-track: #ff00ff !important; */ + /* --scrollbar-thin-thumb: #ff00ff !important; */ + /* --scrollbar-thin-track: #ff00ff !important; */ + /* --slider-track-background: #ff00ff !important; */ + /* --spine-default: #ff00ff !important; */ + /* --spoiler-hidden-background-hover: #ff00ff !important; */ + /* --spoiler-hidden-background: #ff00ff !important; */ + /* --spoiler-revealed-background: #ff00ff !important; */ + /* --standard-tab-gradient-center: #ff00ff !important; */ + /* --standard-tab-gradient-inner-ring: #ff00ff !important; */ + /* --standard-tab-gradient-outer-ring: #ff00ff !important; */ + /* --status-danger: #ff00ff !important; */ + /* --status-online: #ff00ff !important; */ + /* --status-positive-background: #ff00ff !important; */ + /* --status-positive-text: #ff00ff !important; */ + /* --status-positive: #ff00ff !important; */ + /* --status-speaking: #ff00ff !important; */ + /* --status-warning-background: #ff00ff !important; */ + /* --status-warning-text: #ff00ff !important; */ + /* --status-warning: #ff00ff !important; */ + /* --steam-review-text-mixed: #ff00ff !important; */ + /* --steam-review-text-negative: #ff00ff !important; */ + /* --steam-review-text-positive: #ff00ff !important; */ + /* --switch-background-active: #ff00ff !important; */ + /* --switch-background-default: #ff00ff !important; */ + /* --switch-background-hover: #ff00ff !important; */ + /* --switch-background-selected-default: #ff00ff !important; */ + /* --switch-background-selected-hover: #ff00ff !important; */ + /* --switch-border-default: #ff00ff !important; */ + /* --switch-border-hover: #ff00ff !important; */ + /* --switch-border-selected-default: #ff00ff !important; */ + /* --switch-border-selected-hover: #ff00ff !important; */ + /* --switch-thumb-background-default: #ff00ff !important; */ + /* --switch-thumb-background-selected-default: #ff00ff !important; */ + /* --switch-thumb-icon-active: #ff00ff !important; */ + /* --switch-thumb-icon-default: #ff00ff !important; */ + /* --text-brand: #ff00ff !important; */ + /* --text-code-addition: #ff00ff !important; */ + /* --text-code-attribute: #ff00ff !important; */ + /* --text-code-builtin: #ff00ff !important; */ + /* --text-code-bullet: #ff00ff !important; */ + /* --text-code-comment: #ff00ff !important; */ + /* --text-code-decorator: #ff00ff !important; */ + /* --text-code-deletion: #ff00ff !important; */ + /* --text-code-error: #ff00ff !important; */ + /* --text-code-escape: #ff00ff !important; */ + /* --text-code-keyword: #ff00ff !important; */ + /* --text-code-link: #ff00ff !important; */ + /* --text-code-namespace: #ff00ff !important; */ + /* --text-code-number: #ff00ff !important; */ + /* --text-code-operator: #ff00ff !important; */ + /* --text-code-property: #ff00ff !important; */ + /* --text-code-regexp: #ff00ff !important; */ + /* --text-code-section: #ff00ff !important; */ + /* --text-code-string: #ff00ff !important; */ + /* --text-code-tag: #ff00ff !important; */ + /* --text-code-title: #ff00ff !important; */ + /* --text-code-type: #ff00ff !important; */ + /* --text-code-variable: #ff00ff !important; */ + /* --text-code: #ff00ff !important; */ + /* --text-feedback-critical: #ff00ff !important; */ + /* --text-feedback-info: #ff00ff !important; */ + /* --text-feedback-positive: #ff00ff !important; */ + /* --text-feedback-warning: #ff00ff !important; */ + /* --text-invert: #ff00ff !important; */ + /* --text-link: #ff00ff !important; */ + /* --text-muted: #ff00ff !important; */ + /* --text-overlay-dark: #ff00ff !important; */ + /* --text-overlay-light: #ff00ff !important; */ + /* --text-status-dnd: #ff00ff !important; */ + /* --text-status-idle: #ff00ff !important; */ + /* --text-status-offline: #ff00ff !important; */ + /* --text-status-online: #ff00ff !important; */ + /* --text-strong: #ff00ff !important; */ + /* --text-subtle: #ff00ff !important; */ + /* --text-voice-connected: #ff00ff !important; */ + /* --text-voice-disconnected: #ff00ff !important; */ + /* --text-voice-speaking: #ff00ff !important; */ + /* --textbox-markdown-syntax: #ff00ff !important; */ + /* --thread-channel-spine: #ff00ff !important; */ + /* --user-profile-activity-toolbar-background: #ff00ff !important; */ + /* --user-profile-background-hover: #ff00ff !important; */ + /* --user-profile-border: #ff00ff !important; */ + /* --user-profile-note-background-focus: #ff00ff !important; */ + /* --user-profile-overlay-background-hover: #ff00ff !important; */ + /* --user-profile-overlay-background: #ff00ff !important; */ + /* --user-profile-toolbar-background: #ff00ff !important; */ + /* --user-profile-toolbar-border: #ff00ff !important; */ +} + diff --git a/home/dot_config/X11/base b/home/dot_config/X11/base new file mode 100644 index 0000000..a538320 --- /dev/null +++ b/home/dot_config/X11/base @@ -0,0 +1,13 @@ +*.font: monospace:size=7.5:antialias=true:autohint=true +*.borderpx: 10 +*.termname: st-256color +*.tabspaces: 2 + +Xft.dpi: 96 +Xft.hinting: 1 +Xft.hintstyle: hintslight +Xft.antialias: 1 +Xft.rgba: rgb + +Xcursor.theme: OpenZone_Black_Slim + diff --git a/home/dot_config/bat/config b/home/dot_config/bat/config new file mode 100644 index 0000000..dd5778b --- /dev/null +++ b/home/dot_config/bat/config @@ -0,0 +1,4 @@ +--style=plain +--paging=never +--theme=base16 +--tabs=2 diff --git a/home/dot_config/clangd/config.yaml b/home/dot_config/clangd/config.yaml new file mode 100644 index 0000000..17947a1 --- /dev/null +++ b/home/dot_config/clangd/config.yaml @@ -0,0 +1,9 @@ +CompileFlags: + Add: + - -Wno-unknown-warning-option + - -Wno-gnu-folding-constant + - -fgnuc-version=8.0.0 + Remove: + - -m* + - -f* + BuiltinHeaders: QueryDriver diff --git a/home/dot_config/coc/extensions/package.json b/home/dot_config/coc/extensions/package.json new file mode 100644 index 0000000..b648463 --- /dev/null +++ b/home/dot_config/coc/extensions/package.json @@ -0,0 +1,22 @@ +{ + "dependencies": { + "coc-css": ">=2.1.0", + "coc-emmet": ">=1.1.6", + "coc-go": ">=1.3.35", + "coc-html": ">=1.8.0", + "coc-java": ">=1.26.1", + "coc-json": ">=1.9.3", + "coc-rust-analyzer": ">=0.85.0", + "coc-tsserver": ">=2.3.1", + "coc-vimtex": ">=1.1.5", + "coc-lua": ">=2.0.6", + "coc-deno": ">=3.15.0", + "coc-sh": ">=1.2.4", + "coc-solargraph": ">=1.2.4", + "coc-pyright": ">=1.1.405", + "coc-cmake": ">=0.2.2" + }, + "disabled": [], + "locked": [], + "lastUpdate": 1762931212912 +}
\ No newline at end of file diff --git a/home/dot_config/dircolors b/home/dot_config/dircolors new file mode 100644 index 0000000..9997fcf --- /dev/null +++ b/home/dot_config/dircolors @@ -0,0 +1,177 @@ +# vim:ft=conf +TERM Eterm +TERM ansi +TERM *color* +TERM con[0-9]*x[0-9]* +TERM cons25 +TERM console +TERM cygwin +TERM dtterm +TERM gnome +TERM hurd +TERM jfbterm +TERM konsole +TERM kterm +TERM linux +TERM linux-c +TERM mlterm +TERM putty +TERM rxvt* +TERM screen* +TERM st +TERM terminator +TERM tmux* +TERM vt100 +TERM xterm* + +NORMAL 00 # no color code at all +# FILE 00 # regular file: use no color at all +RESET 0 # reset to "normal" color +DIR 01;37 # directory +# LINK 01;36 # symbolic link. (If you set this to 'target' instead of a +MULTIHARDLINK 00 # regular file with more than one link +FIFO 40;33 # pipe +SOCK 01;35 # socket +DOOR 01;35 # door +BLK 40;33;01 # block device driver +CHR 40;33;01 # character device driver +ORPHAN 40;31;01 # symlink to nonexistent file, or non-stat'able file ... +MISSING 00 # ... and the files they point to +SETUID 37;41 # file that is setuid (u+s) +SETGID 30;43 # file that is setgid (g+s) +CAPABILITY 30;41 # file with capability +STICKY_OTHER_WRITABLE 0;47 # dir that is sticky and other-writable (+t,o+w) +OTHER_WRITABLE 01;34 # dir that is other-writable (o+w) and not sticky +STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable +EXEC 0;37 + +# List any file extensions like '.gz' or '.tar' that you would like ls +# to colorize below. Put the extension, a space, and the color init string. +# (and any comments you want to add after a '#') +# If you use DOS-style suffixes, you may want to uncomment the following: +#.cmd 01;32 # executables (bright green) +#.exe 01;32 +#.com 01;32 +#.btm 01;32 +#.bat 01;32 +# Or if you want to colorize scripts even if they do not have the +# executable bit actually set. +#.sh 01;32 +#.csh 01;32 + # archives or compressed (bright red) +.tar 01;31 +.tgz 01;31 +.arc 01;31 +.arj 01;31 +.taz 01;31 +.lha 01;31 +.lz4 01;31 +.lzh 01;31 +.lzma 01;31 +.tlz 01;31 +.txz 01;31 +.tzo 01;31 +.t7z 01;31 +.zip 01;31 +.z 01;31 +.dz 01;31 +.gz 01;31 +.lrz 01;31 +.lz 01;31 +.lzo 01;31 +.xz 01;31 +.zst 01;31 +.tzst 01;31 +.bz2 01;31 +.bz 01;31 +.tbz 01;31 +.tbz2 01;31 +.tz 01;31 +.deb 01;31 +.rpm 01;31 +.jar 01;31 +.war 01;31 +.ear 01;31 +.sar 01;31 +.rar 01;31 +.alz 01;31 +.ace 01;31 +.zoo 01;31 +.cpio 01;31 +.7z 01;31 +.rz 01;31 +.cab 01;31 +.wim 01;31 +.swm 01;31 +.dwm 01;31 +.esd 01;31 +# image formats +.jpg 01;35 +.jpeg 01;35 +.mjpg 01;35 +.mjpeg 01;35 +.gif 01;35 +.bmp 01;35 +.pbm 01;35 +.pgm 01;35 +.ppm 01;35 +.tga 01;35 +.xbm 01;35 +.xpm 01;35 +.tif 01;35 +.tiff 01;35 +.png 01;35 +.svg 01;35 +.svgz 01;35 +.mng 01;35 +.pcx 01;35 +.mov 01;35 +.mpg 01;35 +.mpeg 01;35 +.m2v 01;35 +.mkv 01;35 +.webm 01;35 +.webp 01;35 +.ogm 01;35 +.mp4 01;35 +.m4v 01;35 +.mp4v 01;35 +.vob 01;35 +.qt 01;35 +.nuv 01;35 +.wmv 01;35 +.asf 01;35 +.rm 01;35 +.rmvb 01;35 +.flc 01;35 +.avi 01;35 +.fli 01;35 +.flv 01;35 +.gl 01;35 +.dl 01;35 +.xcf 01;35 +.xwd 01;35 +.yuv 01;35 +.cgm 01;35 +.emf 01;35 +# https://wiki.xiph.org/MIME_Types_and_File_Extensions +.ogv 01;35 +.ogx 01;35 +# audio formats +.aac 00;36 +.au 00;36 +.flac 00;36 +.m4a 00;36 +.mid 00;36 +.midi 00;36 +.mka 00;36 +.mp3 00;36 +.mpc 00;36 +.ogg 00;36 +.ra 00;36 +.wav 00;36 +# https://wiki.xiph.org/MIME_Types_and_File_Extensions +.oga 00;36 +.opus 00;36 +.spx 00;36 +.xspf 00;36 diff --git a/home/dot_config/dunst/base b/home/dot_config/dunst/base new file mode 100644 index 0000000..75ae5eb --- /dev/null +++ b/home/dot_config/dunst/base @@ -0,0 +1,48 @@ +[global] +monitor = 0 +follow = none +height = (0, 100) +width = 300 +origin = top-right +offset = 22x42 +indicate_hidden = yes +shrink = no +transparency = 0 +separator_height = 2 +padding = 12 +horizontal_padding = 12 +frame_width = 2 +separator_color = frame +sort = yes +idle_threshold = 10 +font = Inter 9 +line_height = 0 +markup = full +format = "<b>%s</b>\n%b" +alignment = left +vertical_alignment = top +show_age_threshold = 60 +word_wrap = yes +ellipsize = middle +ignore_newline = no +stack_duplicates = true +hide_duplicate_count = false +show_indicators = yes +icon_position = left +min_icon_size = 0 +max_icon_size = 48 +icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/ +sticky_history = yes +history_length = 20 +browser = /usr/bin/firefox -new-tab +always_run_script = true +title = dunst +class = dunst +corner_radius = 10 +ignore_dbusclose = false +force_xinerama = false +mouse_left_click = do_action +mouse_middle_click = close_all +mouse_right_click = close_current + +# vim: ft=cfg diff --git a/home/dot_config/fcitx5/conf/classicui.conf b/home/dot_config/fcitx5/conf/classicui.conf new file mode 100644 index 0000000..9b98e74 --- /dev/null +++ b/home/dot_config/fcitx5/conf/classicui.conf @@ -0,0 +1,35 @@ +# 候補ウィンドウを縦にする +Vertical Candidate List=True +# マウスホイールを使用して前または次のページに移動する +WheelForPaging=True +# フォント +Font="Sans 10" +# メニューフォント +MenuFont="Sans 10" +# トレイフォント +TrayFont="JetBrainsMono Nerd Font Mono Bold 10" +# トレイラベルのアウトライン色 +TrayOutlineColor=#00000000 +# トレイラベルのテキスト色 +TrayTextColor=#ffffff00 +# テキストアイコンを優先する +PreferTextIcon=True +# アイコンにレイアウト名を表示する +ShowLayoutNameInIcon=False +# 入力メソッドの言語を使用してテキストを表示する +UseInputMethodLanguageToDisplayText=False +# テーマ +Theme=mode +# ダークテーマ +DarkTheme=mode +# システムのライト/ダーク配色に従う +UseDarkTheme=False +# テーマとデスクトップでサポートされている場合は、システムのアクセントカラーに従う +UseAccentColor=True +# X11 で Per Screen DPI を使用する +PerScreenDPI=False +# フォント DPI を Wayland で強制する +ForceWaylandDPI=0 +# Wayland で分数スケールを有効にする +EnableFractionalScale=True + diff --git a/home/dot_config/fcitx5/conf/clipboard.conf b/home/dot_config/fcitx5/conf/clipboard.conf new file mode 100644 index 0000000..6a38473 --- /dev/null +++ b/home/dot_config/fcitx5/conf/clipboard.conf @@ -0,0 +1,8 @@ +# Paste Primary +PastePrimaryKey= +# Number of entries +Number of entries=30 + +[TriggerKey] +0=Control+semicolon + diff --git a/home/dot_config/fcitx5/conf/imselector.conf b/home/dot_config/fcitx5/conf/imselector.conf new file mode 100644 index 0000000..de02872 --- /dev/null +++ b/home/dot_config/fcitx5/conf/imselector.conf @@ -0,0 +1,13 @@ +# 現在の入力コンテキストのみのトリガーキー +TriggerKeyLocal= +# 現在の入力コンテキストのみをN番目の入力メソッドに切り替えるホットキー +SwitchKeyLocal= + +[TriggerKey] +0=Super+Z + +[SwitchKey] +0=Launch5 +1=Launch6 +2=Launch7 + diff --git a/home/dot_config/fcitx5/conf/mozc.conf b/home/dot_config/fcitx5/conf/mozc.conf new file mode 100644 index 0000000..09f0670 --- /dev/null +++ b/home/dot_config/fcitx5/conf/mozc.conf @@ -0,0 +1,13 @@ +# 初期モード +InitialMode=Hiragana +# 入力状態の共有 +InputState="Follow Global Configuration" +# 候補を縦に並べる +Vertical=False +# 用例の表示 (候補が縦並びのとき) +ExpandMode="On Focus" +# プリエディットカーソルをプリエディットの先頭に固定する +PreeditCursorPositionAtBeginning=False +# 用例を表示するホットキー +ExpandKey= + diff --git a/home/dot_config/fcitx5/conf/private_notifications.conf b/home/dot_config/fcitx5/conf/private_notifications.conf new file mode 100644 index 0000000..32460db --- /dev/null +++ b/home/dot_config/fcitx5/conf/private_notifications.conf @@ -0,0 +1,3 @@ +# 隠す通知 +HiddenNotifications= + diff --git a/home/dot_config/fcitx5/conf/quickphrase.conf b/home/dot_config/fcitx5/conf/quickphrase.conf new file mode 100644 index 0000000..9e49067 --- /dev/null +++ b/home/dot_config/fcitx5/conf/quickphrase.conf @@ -0,0 +1,10 @@ +# キーモディファイアーを選択 +Choose Modifier=None +# スペルチェックを有効にする +Spell=True +# フォールバック時のスペルチェック言語 +FallbackSpellLanguage=en + +[TriggerKey] +0=Super+semicolon + diff --git a/home/dot_config/fcitx5/conf/xcb.conf b/home/dot_config/fcitx5/conf/xcb.conf new file mode 100644 index 0000000..642bc03 --- /dev/null +++ b/home/dot_config/fcitx5/conf/xcb.conf @@ -0,0 +1,5 @@ +# Allow Overriding System XKB Settings +Allow Overriding System XKB Settings=True +# Always set layout to be only group layout +AlwaysSetToGroupLayout=True + diff --git a/home/dot_config/fcitx5/conf/xim.conf b/home/dot_config/fcitx5/conf/xim.conf new file mode 100644 index 0000000..57abf4b --- /dev/null +++ b/home/dot_config/fcitx5/conf/xim.conf @@ -0,0 +1,3 @@ +# XIM で On The Spot スタイルを使う(再起動が必要) +UseOnTheSpot=True + diff --git a/home/dot_config/fcitx5/config b/home/dot_config/fcitx5/config new file mode 100644 index 0000000..12e7a48 --- /dev/null +++ b/home/dot_config/fcitx5/config @@ -0,0 +1,75 @@ +[Hotkey] +# 入力メソッドの切り替え +TriggerKeys= +# トリガーキーを押すたびに切り替える +EnumerateWithTriggerKeys=True +# 一時的に第1入力メソッドに切り替える +AltTriggerKeys= +# 次の入力メソッドに切り替える +EnumerateForwardKeys= +# 前の入力メソッドに切り替える +EnumerateBackwardKeys= +# 切り替え時は第1入力メソッドをスキップする +EnumerateSkipFirst=False +# 次の入力メソッドグループに切り替える +EnumerateGroupForwardKeys= +# 前の入力メソッドグループに切り替える +EnumerateGroupBackwardKeys= +# 入力メソッドを有効にする +ActivateKeys= +# 入力メソッドをオフにする +DeactivateKeys= +# デフォルトの前ページ +PrevPage= +# デフォルトの次ページ +NextPage= +# 埋め込みプリエディットの切り替え +TogglePreedit= +# 修飾キーのショートカットをトリガーするための時間制限(ミリ秒) +ModifierOnlyKeyTimeout=250 + +[Hotkey/PrevCandidate] +0=Shift+Tab + +[Hotkey/NextCandidate] +0=Tab + +[Behavior] +# デフォルトで有効にする +ActiveByDefault=False +# フォーカス時に状態をリセット +resetStateWhenFocusIn=No +# 入力状態を共有する +ShareInputState=All +# アプリケーションにプリエディットを表示する +PreeditEnabledByDefault=True +# 入力メソッドを切り替える際に入力メソッドの情報を表示する +ShowInputMethodInformation=False +# フォーカスを変更する際に入力メソッドの情報を表示する +showInputMethodInformationWhenFocusIn=False +# 入力メソッドの情報をコンパクトに表示する +CompactInputMethodInformation=True +# 第1入力メソッドの情報を表示する +ShowFirstInputMethodInformation=False +# デフォルトのページサイズ +DefaultPageSize=5 +# XKB オプションより優先する +OverrideXkbOption=False +# カスタム XKB オプション +CustomXkbOption= +# Force Enabled Addons +EnabledAddons= +# Preload input method to be used by default +PreloadInputMethod=True +# パスワード欄に入力メソッドを許可する +AllowInputMethodForPassword=False +# パスワード入力時にプリエディットテキストを表示する +ShowPreeditForPassword=False +# ユーザーデータを保存する間隔(分) +AutoSavePeriod=30 + +[Behavior/DisabledAddons] +0=kimpanel +1=wayland +2=waylandim + diff --git a/home/dot_config/fcitx5/private_profile b/home/dot_config/fcitx5/private_profile new file mode 100644 index 0000000..a3e35fe --- /dev/null +++ b/home/dot_config/fcitx5/private_profile @@ -0,0 +1,29 @@ +[Groups/0] +# Group Name +Name=Default +# Layout +Default Layout=us +# Default Input Method +DefaultIM=mozc + +[Groups/0/Items/0] +# Name +Name=keyboard-us +# Layout +Layout= + +[Groups/0/Items/1] +# Name +Name=keyboard-us-intl +# Layout +Layout= + +[Groups/0/Items/2] +# Name +Name=mozc +# Layout +Layout= + +[GroupOrder] +0=Default + diff --git a/home/dot_config/firefox/chrome/userChrome.css b/home/dot_config/firefox/chrome/userChrome.css new file mode 100644 index 0000000..330b18e --- /dev/null +++ b/home/dot_config/firefox/chrome/userChrome.css @@ -0,0 +1,39 @@ +/* hide shit */ +#alltabs-button, +#appMenu-fxa-status2, +#appMenu-fxa-separator, +#fullscreen-warning, +.findbar-highlight, +#urlbar-searchmode-switcher, +#translations-button, +#reader-mode-button +{ display: none !important; } + +/* undo shit */ +#urlbar, +#searchbar +{ font-size: unset !important; } + +/* make shit compact */ +body { font-size: 10pt; } +.tab-background { margin-block: 0 !important; } +#TabsToolbar { --toolbarbutton-inner-padding: 8px; } +:root { --tab-min-height: 24px !important; } +.tab-label-container { + height: unset !important; + margin-right: var(--toolbarbutton-inner-padding); +} + +.tabbrowser-tab +{ padding: 0 !important; } + +.tab-background, +#TabsToolbar .toolbarbutton-1 > .toolbarbutton-icon +{ border-radius: 0 !important; } + +#nav-bar, +#navigator-toolbox +{ border: none !important; } + +#urlbar-input +{ padding: 0px 8px !important; } diff --git a/home/dot_config/firefox/user.js b/home/dot_config/firefox/user.js new file mode 100644 index 0000000..a18c1e9 --- /dev/null +++ b/home/dot_config/firefox/user.js @@ -0,0 +1,60 @@ +// opinion +user_pref("browser.toolbars.bookmarks.visibility", "never"); +user_pref("browser.quitShortcut.disabled", true); +user_pref("media.videocontrols.picture-in-picture.video-toggle.enabled", false); +user_pref("layout.spellcheckDefault", 0); +user_pref("findbar.highlightAll", true); + +// i know what i'm doing +user_pref("browser.safebrowsing.downloads.enabled", false); +user_pref("browser.safebrowsing.malware.enabled", false); +user_pref("browser.safebrowsing.phishing.enabled", false); + +// i18n +user_pref("intl.regional_prefs.use_os_locales", true); +user_pref("layout.spellcheckDefault", 0); +user_pref("browser.translations.automaticallyPopup", false); + +// privacy +user_pref("signon.rememberSignons", false); +user_pref("datareporting.healthreport.uploadEnabled", false); +user_pref("app.shield.optoutstudies.enabled", false); +user_pref("dom.security.https_only_mode", true); +user_pref("dom.security.https_only_mode_ever_enabled", true); + +// smooth scrolling +user_pref("general.smoothScroll", true); +user_pref("general.smoothScroll.msdPhysics.enabled", true); +user_pref("general.smoothScroll.msdPhysics.continuousMotionMaxDeltaMS", 12); +user_pref("general.smoothScroll.msdPhysics.slowdownMinDeltaMS", 25); +user_pref("general.smoothScroll.msdPhysics.motionBeginSpringConstant", 1800); +user_pref("general.smoothScroll.msdPhysics.slowdownMinDeltaRatio", "2"); +user_pref("general.smoothScroll.msdPhysics.slowdownSpringConstant", 60); +user_pref("general.smoothScroll.currentVelocityWeighting", "1"); +user_pref("general.smoothScroll.stopDecelerationWeighting", "1"); + +// enable chrome/userChrome.css +user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true); + +// enable userChrome debugging +user_pref("devtools.chrome.enabled", true); +user_pref("devtools.debugger.remote-enabled", true); + +// no first time ux +user_pref("trailhead.firstrun.didSeeAboutWelcome", true); +user_pref("app.normandy.first_run", false); +user_pref("browser.aboutConfig.showWarning", false); +user_pref("browser.aboutwelcome.didSeeFinalScreen", true); +user_pref("browser.bookmarks.addedImportButton", true); +user_pref("browser.bookmarks.restore_default_bookmarks", false); + +// no new tab page +user_pref("browser.newtabpage.enabled", false); +user_pref("browser.startup.homepage", "chrome://browser/content/blanktab.html"); + +// fonts +user_pref("font.default.x-western", "sans-serif"); +user_pref("font.name.monospace.x-western", "monospace"); +user_pref("font.name.sans-serif.x-western", "sans-serif"); +user_pref("font.name.serif.x-western", "serif"); + diff --git a/home/dot_config/flashfocus/flashfocus.yml b/home/dot_config/flashfocus/flashfocus.yml new file mode 100644 index 0000000..3f6f0e0 --- /dev/null +++ b/home/dot_config/flashfocus/flashfocus.yml @@ -0,0 +1,9 @@ +flash-opacity: 0.95 +default-opacity: 1 +time: 150 +simple: false +ntimepoints: 20 +flash-on-focus: true +flash-fullscreen: true +flash-lone-windows: 'on_switch' + diff --git a/home/dot_config/fontconfig/conf.d/10-inter-features.conf b/home/dot_config/fontconfig/conf.d/10-inter-features.conf new file mode 100644 index 0000000..5a641d6 --- /dev/null +++ b/home/dot_config/fontconfig/conf.d/10-inter-features.conf @@ -0,0 +1,14 @@ +<?xml version="1.0"?> +<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> +<fontconfig> + <description>Enable font features for Inter</description> + <match target="font"> + <test name="family" compare="eq" ignore-blanks="true"> + <string>Inter</string> + </test> + <edit name="fontfeatures" mode="append"> + <string>ss07 on</string> <!-- Square punctuation --> + <string>ss08 on</string> <!-- Square quotes --> + </edit> + </match> +</fontconfig> diff --git a/home/dot_config/fontconfig/conf.d/10-sub-pixel-rgb.conf b/home/dot_config/fontconfig/conf.d/10-sub-pixel-rgb.conf new file mode 100644 index 0000000..fcd51f3 --- /dev/null +++ b/home/dot_config/fontconfig/conf.d/10-sub-pixel-rgb.conf @@ -0,0 +1,8 @@ +<?xml version="1.0"?> +<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> +<fontconfig> + <description>Enable sub-pixel font rendering</description> + <match target="pattern"> + <edit name="rgba" mode="append"><const>rgb</const></edit> + </match> +</fontconfig> diff --git a/home/dot_config/fontconfig/fonts.conf b/home/dot_config/fontconfig/fonts.conf new file mode 100644 index 0000000..955c797 --- /dev/null +++ b/home/dot_config/fontconfig/fonts.conf @@ -0,0 +1,30 @@ +<?xml version="1.0"?> +<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> +<fontconfig> + <description>System default fonts with Japanese fallback fonts</description> + <alias binding="strong"> + <family>sans-serif</family> + <prefer><family>Inter</family></prefer> + </alias> + <alias binding="strong"> + <family>serif</family> + <prefer><family>TeX Gyre Schola</family></prefer> + </alias> + <alias binding="strong"> + <family>monospace</family> + <prefer><family>JetBrains Mono</family></prefer> + </alias> + <alias binding="strong"> + <family>system-ui</family> + <prefer><family>Inter</family></prefer> + </alias> + + <match target="pattern"> + <test name="family"><string>sans-serif</string></test> + <edit name="family" mode="append" binding="strong"><string>Hiragino Kaku Gothic ProN</string></edit> + </match> + <match target="pattern"> + <test name="family"><string>serif</string></test> + <edit name="family" mode="append" binding="strong"><string>Hiragino Mincho ProN</string></edit> + </match> +</fontconfig> diff --git a/home/dot_config/foot/foot.ini.tmpl b/home/dot_config/foot/foot.ini.tmpl new file mode 100644 index 0000000..0b7451d --- /dev/null +++ b/home/dot_config/foot/foot.ini.tmpl @@ -0,0 +1,6 @@ +[main] +line-height = 15px +pad = 10x10 +font = monospace:size=7.5:antialias=true:autohint=true + +include={{ env "XDG_CONFIG_HOME" }}/foot/colors.ini diff --git a/home/dot_config/fzmp/symlink_conf b/home/dot_config/fzmp/symlink_conf new file mode 100644 index 0000000..7d048e5 --- /dev/null +++ b/home/dot_config/fzmp/symlink_conf @@ -0,0 +1 @@ +../mpcplus/fzmp.conf diff --git a/home/dot_config/gdb/gdbearlyinit b/home/dot_config/gdb/gdbearlyinit new file mode 100644 index 0000000..b73aa96 --- /dev/null +++ b/home/dot_config/gdb/gdbearlyinit @@ -0,0 +1 @@ +set startup-quietly on diff --git a/home/dot_config/gdb/gdbinit b/home/dot_config/gdb/gdbinit new file mode 100644 index 0000000..a2d1f36 --- /dev/null +++ b/home/dot_config/gdb/gdbinit @@ -0,0 +1,31 @@ +# load ./gdbinit.py +python +import sys, os +sys.path.append(os.path.join(os.environ["XDG_CONFIG_HOME"], "gdb")) +import gdbinit +end + +# preferences +try set disassembly-flavor intel +set debuginfod enabled off +set confirm off +set extended-prompt \P +set history save on +set history size 10000000 +set history remove-duplicates 100 +set style emoji off +set pagination off +set output-radix 16 + +# aliases +alias reset = monitor reset +alias erase = monitor flash erase + +alias -a -- v8m = arm-v8m +alias -a -- v8m tz = arm-v8m trustzone +alias -a -- jlink sv = jlink server +alias -a -- jlink sv wd = jlink server watchdog + +# commands +alias mk = !mk +alias ls = !ls diff --git a/home/dot_config/gdb/gdbinit.py b/home/dot_config/gdb/gdbinit.py new file mode 100644 index 0000000..7888a37 --- /dev/null +++ b/home/dot_config/gdb/gdbinit.py @@ -0,0 +1,52 @@ +import gdb +import gdb.prompt + +from subprocess import check_output +from os import environ + +class TryCommand(gdb.Command): + """ + Try evaluating the argument(s) as a regular GDB command, but do not fail if the command fails. + """ + + def __init__(self): + super().__init__("try", gdb.COMMAND_USER) + + def invoke(self, argument, from_tty): + try: + gdb.execute(argument) + except gdb.error: + pass + +TryCommand() + +def custom_prompt() -> str: + try: + env = environ + env["eo"] = "\\[" + env["ec"] = "\\]" + prompt = check_output(["prompt", "gdb"], text=True, env=env) + return prompt + except Exception: + return "(gdb) " + +# add custom prompt ("\P") escape code to extended-prompt +substitute_prompt = gdb.prompt.substitute_prompt +def new_substitute_prompt(prompt: str): + out = "" + escape = False + for char in prompt: + out += char + if not escape: + if char == "\\": + escape = True + continue + escape = False + + if char == "P": + out = out[:-2] + custom_prompt() + + out = substitute_prompt(out) + return out + +gdb.prompt.substitute_prompt = new_substitute_prompt diff --git a/home/dot_config/git/config.tmpl b/home/dot_config/git/config.tmpl new file mode 100644 index 0000000..9202c61 --- /dev/null +++ b/home/dot_config/git/config.tmpl @@ -0,0 +1,53 @@ +[init] + defaultBranch = master +[core] + quotepath = off +[user] + email = loek@pipeframe.xyz + name = Loek Le Blansch + signingkey = {{ env "GPG_ID_GIT" }} +[commit] + gpgsign = true +[gpg] + program = {{ env "XDG_DATA_HOME" }}/bin/gpg-git +[credential] + helper = cache --timeout 7200 + helper = store +[color] + ui = true +[filter "lfs"] + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + process = git-lfs filter-process + required = true +[pull] + rebase = false +[alias] + adda = add -A + a = add -A + c = commit + s = status + ps = push + psa = !git remote | xargs -L1 -P0 -- git push + pl = pull + l = log + d = diff + cloc = !git ls-files -z | xargs -0 cloc + conflict = !git diff --name-only --diff-filter=U --relative + ec = !git conflict -z | xargs -0 -- $EDITOR + ours = !git conflict -z | xargs -0 -- git checkout --ours + theirs = !git conflict -z | xargs -0 -- git checkout --theirs + nuke = !git reset --hard && git clean -fxd +[pager] + log = delta + show = delta + diff = delta + blame = delta +[delta] + tabs = 2 + side-by-side = false + syntax-theme = base16 +[safe] + directory = * +[diff "mozc_config"] + textconv = mozc-config-filter diff --git a/home/dot_config/gtk-3.0/settings.ini b/home/dot_config/gtk-3.0/settings.ini new file mode 100644 index 0000000..5c6573f --- /dev/null +++ b/home/dot_config/gtk-3.0/settings.ini @@ -0,0 +1,16 @@ +[Settings] +gtk-application-prefer-light-theme=1 +gtk-icon-theme-name=Adwaita +gtk-font-name=Inter 9 +gtk-cursor-theme-size=0 +gtk-toolbar-style=GTK_TOOLBAR_BOTH +gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR +gtk-button-images=1 +gtk-menu-images=1 +gtk-enable-event-sounds=1 +gtk-enable-input-feedback-sounds=1 +gtk-xft-antialias=1 +gtk-xft-hinting=1 +gtk-xft-hintstyle=hintfull +gtk-cursor-theme-name=OpenZone_Black_Slim +gtk-theme-name=adw-gtk3-light diff --git a/home/dot_config/gtk-4.0/env b/home/dot_config/gtk-4.0/env new file mode 100644 index 0000000..2eac735 --- /dev/null +++ b/home/dot_config/gtk-4.0/env @@ -0,0 +1,6 @@ +#!/bin/sh +export GTK_THEME="adw-gtk3" +mode_state="$XDG_CACHE_HOME/mode/state/theme" +[ -e "$mode_state" ] && . "$mode_state" +[ "$mode" = "dark" ] && GTK_THEME="$GTK_THEME:dark" +export GTK_THEME diff --git a/home/dot_config/i3/config.tmpl b/home/dot_config/i3/config.tmpl new file mode 100644 index 0000000..e0cf678 --- /dev/null +++ b/home/dot_config/i3/config.tmpl @@ -0,0 +1,90 @@ +# variables +set $mod Mod4 +set $inner_gaps 8 +set $outer_gaps 0 + +# set gaps +gaps inner $inner_gaps +gaps outer $outer_gaps + +include color.conf + +# Replace window decorations with a border +for_window [class=".*"] border pixel 0 + +# font +font pango:Inter 9 + +floating_modifier $mod + +# Gaps +bindsym $mod+i gaps inner current plus 5 +bindsym $mod+Shift+i gaps inner current minus 5 +bindsym $mod+o gaps outer current plus 5 +bindsym $mod+Shift+o gaps outer current minus 5 +bindsym $mod+n gaps inner current set -1; gaps outer current set 0 +bindsym $mod+d gaps inner current set $inner_gaps; gaps outer current set $outer_gaps; + +# Autostart +exec --no-startup-id "{{ env "XDG_CONFIG_HOME" }}/i3/autostart" + +# split in horizontal orientation +bindsym $mod+bar split h +bindsym $mod+minus split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym $mod+Alt+space focus mode_toggle + +# focus the parent container +bindsym $mod+Shift+a focus parent + +# workspaces +set $ws1 "1" +set $ws2 "2" +set $ws3 "3" +set $ws4 "4" +set $ws5 "5" +set $ws6 "6" +set $ws7 "7" +set $ws8 "8" + +# switch to workspace +bindsym $mod+1 workspace number $ws1 +bindsym $mod+2 workspace number $ws2 +bindsym $mod+3 workspace number $ws3 +bindsym $mod+4 workspace number $ws4 +bindsym $mod+5 workspace number $ws5 +bindsym $mod+6 workspace number $ws6 +bindsym $mod+7 workspace number $ws7 +bindsym $mod+8 workspace number $ws8 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace number $ws1 +bindsym $mod+Shift+2 move container to workspace number $ws2 +bindsym $mod+Shift+3 move container to workspace number $ws3 +bindsym $mod+Shift+4 move container to workspace number $ws4 +bindsym $mod+Shift+5 move container to workspace number $ws5 +bindsym $mod+Shift+6 move container to workspace number $ws6 +bindsym $mod+Shift+7 move container to workspace number $ws7 +bindsym $mod+Shift+8 move container to workspace number $ws8 + +# always floating windows +for_window [class="steam"] floating enable +for_window [class="RAIL"] floating enable +for_window [class="Conky"] floating enable +for_window [title="Farge"] floating enable +for_window [title="^\[floating\].*" tiling_from=auto] floating enable +for_window [window_type=notification] floating enable +for_window [title="JidePopup"] floating enable + +for_window [class="Unturned.x86_64"] floating disable +for_window [class="Unturned.x86_64"] fullscreen disable + +for_window [class="Microsoft Windows"] floating enable + diff --git a/home/dot_config/i3/executable_autostart b/home/dot_config/i3/executable_autostart new file mode 100644 index 0000000..70b7616 --- /dev/null +++ b/home/dot_config/i3/executable_autostart @@ -0,0 +1,33 @@ +#!/bin/sh +. "$HOME/.profile" +xrdb -override < "$XDG_CONFIG_HOME/X11/base" +mode --no-reload --no-cfggen restore + +/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & +polybar & +picom & +xbanish & +dunst & +autocutsel -selection CLIPBOARD & +fcitx5 & +xbindkeys --nodaemon & +xdimmer -t 45 -p 3 & +redshift -l 52:6 & +nicotine --hidden & +desktop2mqtt --config "$XDG_CONFIG_HOME/desktop2mqtt/config.yml" & +light-locker --late-locking --lock-after-screensaver=0 --no-lock-on-suspend --no-lock-on-lid & +systembus-notify & +nmpassd & + +# auto start lazy script after everything else +[ -x "$HOME/do.sh" ] && "$HOME/do.sh" & + +exit_trap() { + trap - TERM + kill -- -$$ +} +trap exit_trap INT TERM EXIT + +# I want to keep this script running so I can easily kill all daemons when i3 +# exits +wait $(jobs -p) diff --git a/home/dot_config/imapnotify/pipeframe.conf b/home/dot_config/imapnotify/pipeframe.conf new file mode 100644 index 0000000..774236c --- /dev/null +++ b/home/dot_config/imapnotify/pipeframe.conf @@ -0,0 +1,11 @@ +{ + "username": "loek", + "host": "mail.pipeframe.xyz", + "port": 993, + "tls": true, + "tlsOptions": { "rejectUnauthorized": true }, + "passwordCmd": "pass srv/wipper/passwd/loek", + "onNewMail": "systemctl --user start mbsync", + "onNewMailPost": "notify-send '新着メール'", + "boxes": [ "Inbox" ] +} diff --git a/home/dot_config/inputrc b/home/dot_config/inputrc new file mode 100644 index 0000000..aa55cba --- /dev/null +++ b/home/dot_config/inputrc @@ -0,0 +1,8 @@ +set show-all-if-ambiguous on +set completion-ignore-case on +set colored-completion-prefix on +set colored-stats on +set menu-complete-display-prefix on + +TAB: menu-complete +"\e[Z": menu-complete-backward diff --git a/home/dot_config/jellyfin-mpv-shim/mpv.conf.tmpl b/home/dot_config/jellyfin-mpv-shim/mpv.conf.tmpl new file mode 100644 index 0000000..30a9ccf --- /dev/null +++ b/home/dot_config/jellyfin-mpv-shim/mpv.conf.tmpl @@ -0,0 +1,3 @@ +{{ include "dot_config/mpv/mpv.conf" }} +# better japanese font for watching with japanese subtitles +sub-font='Hiragino Kaku Gothic ProN' diff --git a/home/dot_config/jellyfin-mpv-shim/scripts/set-lights.lua b/home/dot_config/jellyfin-mpv-shim/scripts/set-lights.lua new file mode 100644 index 0000000..3a392dc --- /dev/null +++ b/home/dot_config/jellyfin-mpv-shim/scripts/set-lights.lua @@ -0,0 +1,6 @@ +function on_start_file() + os.execute("curl -X POST \"$HASS_SERVER/api/webhook/movie\""); +end + +mp.register_event("start-file", on_start_file) + diff --git a/home/dot_config/jellyfin-mpv-shim/scripts/symlink_copy-subs.lua b/home/dot_config/jellyfin-mpv-shim/scripts/symlink_copy-subs.lua new file mode 100644 index 0000000..3609faf --- /dev/null +++ b/home/dot_config/jellyfin-mpv-shim/scripts/symlink_copy-subs.lua @@ -0,0 +1 @@ +../../mpv/scripts/copy-subs.lua diff --git a/home/dot_config/jellyfin-mpv-shim/symlink_input.conf b/home/dot_config/jellyfin-mpv-shim/symlink_input.conf new file mode 100644 index 0000000..61f879a --- /dev/null +++ b/home/dot_config/jellyfin-mpv-shim/symlink_input.conf @@ -0,0 +1 @@ +../mpv/input.conf diff --git a/home/dot_config/khal/base b/home/dot_config/khal/base new file mode 100644 index 0000000..2a8238d --- /dev/null +++ b/home/dot_config/khal/base @@ -0,0 +1,14 @@ +# vim:ft=dosini + +[locale] +timeformat = %H:%M +dateformat = %m月%d日 (%a) +longdateformat = %A %Y年%m月%d日 +datetimeformat = %c +longdatetimeformat = %c + +[view] +agenda_day_format = "{bold}{date-long}{reset}" +agenda_event_format = " {cancelled}{repeat-symbol}{alarm-symbol}{start-end-time-style} -- {calendar-color}{title}{reset}" +blank_line_before_day = True + diff --git a/home/dot_config/khal/executable_config_gen b/home/dot_config/khal/executable_config_gen new file mode 100644 index 0000000..3f982c5 --- /dev/null +++ b/home/dot_config/khal/executable_config_gen @@ -0,0 +1,105 @@ +#!/bin/sh +EXPORT_LIB=y . "$XDG_CONFIG_HOME/vdirsyncer/config_gen" + +cat << EOF +[calendars] + +EOF + +_sync() { + yes | vdirsyncer discover 1> /dev/null 2> /dev/null + vdirsyncer sync 1> /dev/null 2> /dev/null + vdirsyncer metasync 1> /dev/null 2> /dev/null +} + +color_fmt() { pastel format hsl | tr -d 'hsl(,%)' | sed 's/\.[^ ]\+//g' ; } +TERMINAL_COLORS="$(for n in $(seq 0 15) ; do xrdb -get "color$n" ; done | color_fmt)" +_color_quantize() { + INPUT="$(echo $1 | grep -o '#[0-9a-fA-F]\{6\}' | color_fmt)" + COLOR="$(printf '%s\n%s' "$INPUT" "$TERMINAL_COLORS" | awk --non-decimal-data ' + # abs() is not built-in??? + function abs(v) { return v < 0 ? -v : v } + BEGIN { + closest = 0; # closest ANSI color index + # offset line number once for input color, and another time to make color + # numbers start from 0 (line numbers start from 1 by default) + NR -= 2; + # keep track of the first color + first = 1; + } + { + # first line of input contains input colors + if (NR == -1) { + input_r = $1; + input_g = $2; + input_b = $3; + next; + } + if (NR == 0) next; # do not pick background color + # sloppy check to nearest RGB color + diff = abs(input_r - $1) + abs(input_g - $2) + abs(input_b - $3); + if (diff < max_diff || first) { + first = 0; + max_diff = diff; + closest = NR; + } + } + END { print closest; } + ')" + case "$COLOR" in + 0) echo "black" ; break ;; + 1) echo "dark red" ; break ;; + 2) echo "dark green" ; break ;; + 3) echo "brown" ; break ;; + 4) echo "dark blue" ; break ;; + 5) echo "dark magenta" ; break ;; + 6) echo "dark cyan" ; break ;; + 7) echo "dark gray" ; break ;; + 8) echo "light gray" ; break ;; + 9) echo "light red" ; break ;; + 10) echo "light green" ; break ;; + 11) echo "yellow" ; break ;; + 12) echo "light blue" ; break ;; + 13) echo "light magenta" ; break ;; + 14) echo "light cyan" ; break ;; + 15) echo "white" ; break ;; + esac +} + +_cfg_dav() { + [ "$DAV_TYPE" != "caldav" ] && return + jq --raw-output '.collections[][0]' "$VDIRSYNCER_STATUS_PATH/$ID.collections" | while read -r collection ; do + collection_path="$XDG_DATA_HOME/vdirsyncer/$ID/$collection" + color_path="$collection_path/color" + displayname_path="$collection_path/displayname" + [ ! -d "$collection_path" ] && _sync + [ ! -f "$color_path" ] && _sync + [ ! -f "$displayname_path" ] && _sync + COLOR="$(cat "$color_path")" + NAME="$(cat "$displayname_path")" + [ -n "$COLOR" ] && [ -n "$QUANTIZE_COLOR" ] && COLOR="$(_color_quantize "$COLOR")" + cat << EOF +[[$NAME]] +path = "$collection_path" +EOF + [ -n "$COLOR" ] && echo "color = \"$COLOR\"" + echo + done +} + +_cfg_ical() { + collection_path="$XDG_DATA_HOME/vdirsyncer/$ID" + [ ! -d "$collection_path" ] && _sync + cat << EOF +[[$NAME]] +path = "$collection_path" +readonly = True +EOF + [ -n "$COLOR" ] && echo "color = \"$COLOR\"" + + echo +} + +. "$CONFIG_FILE" + +printf '# %s:%s=%s\n' vim ft dosini diff --git a/home/dot_config/khal/symlink_config.sh b/home/dot_config/khal/symlink_config.sh new file mode 100644 index 0000000..c47897b --- /dev/null +++ b/home/dot_config/khal/symlink_config.sh @@ -0,0 +1 @@ +../vdirsyncer/config.sh diff --git a/home/dot_config/khard/base b/home/dot_config/khard/base new file mode 100644 index 0000000..258af81 --- /dev/null +++ b/home/dot_config/khard/base @@ -0,0 +1,23 @@ +[general] +debug = no +default_action = list + +[contact table] +display = formatted_name +group_by_addressbook = no +reverse = no +show_nicknames = no +show_uids = no +show_kinds = no +sort = last_name +localize_dates = no + +preferred_phone_number_type = voice, cell, home +preferred_email_address_type = internet, home, work + +[vcard] +preferred_version = 3.0 +search_in_source_files = no +skip_unparsable = no + +# vim:ft=dosini diff --git a/home/dot_config/khard/executable_config_gen b/home/dot_config/khard/executable_config_gen new file mode 100644 index 0000000..75f59b1 --- /dev/null +++ b/home/dot_config/khard/executable_config_gen @@ -0,0 +1,25 @@ +#!/bin/sh +EXPORT_LIB=y . "$XDG_CONFIG_HOME/vdirsyncer/config_gen" + +cat << EOF +[addressbooks] + +EOF + +_cfg_dav() { + [ "$DAV_TYPE" != "carddav" ] && return + jq --raw-output '.collections[][0]' "$VDIRSYNCER_STATUS_PATH/$ID.collections" | while read -r collection ; do + collection_path="$XDG_DATA_HOME/vdirsyncer/$ID/$collection" + displayname_path="$collection_path/displayname" + NAME="$(cat "$displayname_path")" + cat << EOF +[[$NAME]] +path = "$collection_path" +EOF + echo + done +} + +. "$CONFIG_FILE" + +printf '# %s:%s=%s\n' vim ft dosini diff --git a/home/dot_config/khard/symlink_config.sh b/home/dot_config/khard/symlink_config.sh new file mode 100644 index 0000000..c47897b --- /dev/null +++ b/home/dot_config/khard/symlink_config.sh @@ -0,0 +1 @@ +../vdirsyncer/config.sh diff --git a/home/dot_config/kicad/kicad_common b/home/dot_config/kicad/kicad_common new file mode 100644 index 0000000..4eabfb7 --- /dev/null +++ b/home/dot_config/kicad/kicad_common @@ -0,0 +1,22 @@ +UseIconsInMenus=1 +IconScale=-1 +MousewheelPAN=0 +ZoomNoCenter=0 +AutoPAN=1 +OpenGLAntialiasingMode=2 +CairoAntialiasingMode=3 +WorkingDir=/home/loek +ShowEnvVarWarningDialog=1 +Editor=nvim +AutoSaveInterval=600 +FileHistorySize=9 +CanvasScale=0 +PdfBrowserName= +UseSystemBrowser=1 +[EnvironmentVariables] +KICAD_SYMBOL_DIR=/usr/share/kicad/library +KICAD_TEMPLATE_DIR=/usr/share/kicad/template +KICAD_USER_TEMPLATE_DIR=/home/loek/kicad/template +KIGITHUB=https://github.com/KiCad +KISYS3DMOD=/usr/share/kicad/modules/packages3d/ +KISYSMOD=/usr/share/kicad/modules diff --git a/home/dot_config/kwalletrc b/home/dot_config/kwalletrc new file mode 100644 index 0000000..6f0a8f5 --- /dev/null +++ b/home/dot_config/kwalletrc @@ -0,0 +1,4 @@ +[Wallet] +Default Wallet=Default keyring +Enabled=false +First Use=false diff --git a/home/dot_config/latexmk/latexmkrc b/home/dot_config/latexmk/latexmkrc new file mode 100644 index 0000000..6d6ec09 --- /dev/null +++ b/home/dot_config/latexmk/latexmkrc @@ -0,0 +1 @@ +$pdf_previewer = "fork xdg-open %O %S"; diff --git a/home/dot_config/lf/lfrc b/home/dot_config/lf/lfrc new file mode 100644 index 0000000..d01b837 --- /dev/null +++ b/home/dot_config/lf/lfrc @@ -0,0 +1,30 @@ +set shell sh +set shellopts '-eu' +set ifs "\n" +set filesep "\n" +set scrolloff 10 +set info size +set dircounts +set mouse true + +set cleaner clean +set previewer preview +cmd open $open $fx + +set cursorpreviewfmt "" +set errorfmt "\033[31m" +set promptfmt "\033[34;1m%d\033[0m\033[1m%f\033[0m" +set statfmt "\033[36m%p| -> %l" +set rulerfmt " %a| %p| \033[7;31m mv %m \033[0m| \033[7;33m cp %c \033[0m| \033[7;35m sel %s \033[0m| \033[7;34m %f \033[0m" + +map v :toggle ; down +map V invert +map <backspace> set hidden! # <C-h> +map u +map uv unselect +map uc clear + +cmd bulkrename $renamer -n $fx + +# vim:ft=cfg + diff --git a/home/dot_config/mailcap b/home/dot_config/mailcap new file mode 100644 index 0000000..ff69b62 --- /dev/null +++ b/home/dot_config/mailcap @@ -0,0 +1,7 @@ +# open html files in default browser using xdg-open (appends .html to %s) +text/html; xdg-open %s; nametemplate=%s.html; copiousoutput; + +# wrap plain text before paging inside mutt (prevents line breaks to be +# prefixed with '+', makes copying URLs easier) +text/plain; fold -w $COLUMNS %s; copiousoutput; + diff --git a/home/dot_config/mbsyncrc b/home/dot_config/mbsyncrc new file mode 100644 index 0000000..bc3bedf --- /dev/null +++ b/home/dot_config/mbsyncrc @@ -0,0 +1,23 @@ +IMAPAccount pipeframe +Host mail.pipeframe.xyz +Port 993 +User loek@mail.pipeframe.xyz +PassCmd "pass srv/wipper/passwd/loek" +TLSType IMAPS +CertificateFile /etc/ssl/certs/ca-certificates.crt + +IMAPStore pipeframe-remote +Account pipeframe + +MaildirStore pipeframe-local +SubFolders Verbatim +Path ~/docs/mail/pipeframe/ +Inbox ~/docs/mail/pipeframe/Inbox + +Channel pipeframe +Far :pipeframe-remote: +Near :pipeframe-local: +Patterns * +Create Both +SyncState * + diff --git a/home/dot_config/mozc/config1.db b/home/dot_config/mozc/config1.db Binary files differnew file mode 100644 index 0000000..65f9cde --- /dev/null +++ b/home/dot_config/mozc/config1.db diff --git a/home/dot_config/mozc/dot_gitattributes b/home/dot_config/mozc/dot_gitattributes new file mode 100644 index 0000000..078cff9 --- /dev/null +++ b/home/dot_config/mozc/dot_gitattributes @@ -0,0 +1 @@ +config1.db binary diff=mozc_config diff --git a/home/dot_config/mozc/keymap.tsv b/home/dot_config/mozc/keymap.tsv new file mode 100644 index 0000000..d2674ab --- /dev/null +++ b/home/dot_config/mozc/keymap.tsv @@ -0,0 +1,56 @@ +# This is a copy of keymap table for debugging. +# Nothing happens when you edit this file manually. +status key command +Composition Backspace Backspace +Composition Ctrl Enter Commit +Composition Ctrl Left MoveCursorToBeginning +Composition Ctrl Right MoveCursorToEnd +Composition Ctrl h MoveCursorLeft +Composition Ctrl l MoveCursorRight +Composition ESC Cancel +Composition End MoveCursorToEnd +Composition Enter Commit +Composition Home MoveCursorToBeginning +Composition Left MoveCursorLeft +Composition Right MoveCursorRight +Composition Space Convert +Composition Tab PredictAndConvert +Conversion Backspace Cancel +Conversion Ctrl Enter Commit +Conversion Ctrl h SegmentWidthShrink +Conversion Ctrl j ConvertNext +Conversion Ctrl k ConvertPrev +Conversion Ctrl l SegmentWidthExpand +Conversion Down ConvertNext +Conversion ESC Cancel +Conversion End SegmentFocusLast +Conversion Enter CommitOnlyFirstSegment +Conversion Home SegmentFocusFirst +Conversion Left SegmentFocusLeft +Conversion Right SegmentFocusRight +Conversion Shift Left SegmentWidthShrink +Conversion Shift Right SegmentWidthExpand +Conversion Shift Space ConvertPrev +Conversion Shift Tab ConvertPrev +Conversion Shift Up ConvertPrevPage +Conversion Space ConvertNext +Conversion Tab ConvertNext +Conversion Up ConvertPrev +Precomposition Backspace Revert +Precomposition Shift Backspace Reconvert +Precomposition Space InsertSpace +Composition ASCII InsertCharacter +Composition Kanji IMEOff +Composition OFF IMEOff +Composition ON IMEOn +Conversion F1 ReportBug +Conversion F3 ReportBug +Conversion Kanji IMEOff +Conversion OFF IMEOff +Conversion ON IMEOn +DirectInput Kanji IMEOn +DirectInput ON IMEOn +Precomposition ASCII InsertCharacter +Precomposition Kanji IMEOff +Precomposition OFF IMEOff +Precomposition ON IMEOn diff --git a/home/dot_config/mozc/user_dictionary.db b/home/dot_config/mozc/user_dictionary.db Binary files differnew file mode 100644 index 0000000..9147808 --- /dev/null +++ b/home/dot_config/mozc/user_dictionary.db diff --git a/home/dot_config/mpcplus/fzmp.conf b/home/dot_config/mpcplus/fzmp.conf new file mode 100644 index 0000000..22439c3 --- /dev/null +++ b/home/dot_config/mpcplus/fzmp.conf @@ -0,0 +1,3 @@ +default_view songs +full_song_format [[[%artist% - %album% / ][%title%]]|%file%] +fzf_options --ignore-case diff --git a/home/dot_config/mpd/mpd.conf.tmpl b/home/dot_config/mpd/mpd.conf.tmpl new file mode 100644 index 0000000..affaec1 --- /dev/null +++ b/home/dot_config/mpd/mpd.conf.tmpl @@ -0,0 +1,45 @@ +{{- $host := dig "mpd" "host" false . -}} +{{- $base_dir := dig "mpd" "base_dir" "/mnt/mpd" . -}} + +{{- $music_directory := "https://media.pipeframe.xyz/music" -}} +{{- if $host -}} +{{- $music_directory = printf "%s/music" $base_dir -}} +{{- end -}} + +music_directory "{{ $music_directory }}" +playlist_directory "{{ $base_dir }}/playlists" + +pid_file "{{ $base_dir }}/mpd.pid" +state_file "{{ $base_dir }}/mpdstate" +{{- if $host }} +db_file "{{ $base_dir }}/mpd.db" +{{- end }} + +bind_to_address "{{ ternary "*" "0.0.0.0" $host }}" +port "6600" +restore_paused "yes" +{{- if $host }} +auto_update "yes" +user "{{ .chezmoi.username }}" +group "{{ .chezmoi.group }}" +default_permissions "read,add,control,admin" +{{- end }} + +replaygain "track" +replaygain_preamp "6" +{{- if not $host }} + +database { + plugin "proxy" + host "pipeframe.xyz" +} +{{- end }} + +audio_output { + type "pulse" + name "desktop output" +} + +input_cache { + size "512 MB" +} diff --git a/home/dot_config/mpv/input.conf b/home/dot_config/mpv/input.conf new file mode 100644 index 0000000..711242e --- /dev/null +++ b/home/dot_config/mpv/input.conf @@ -0,0 +1,4 @@ +ALT+c script-message-to copy_subs copy +ALT+SHIFT+c script-message-to copy_subs auto +CTRL+z set sub-delay 0 + diff --git a/home/dot_config/mpv/mpv.conf b/home/dot_config/mpv/mpv.conf new file mode 100644 index 0000000..cc3c44f --- /dev/null +++ b/home/dot_config/mpv/mpv.conf @@ -0,0 +1,15 @@ +# Start in fullscreen mode by default. +fs=yes + +# Display English subtitles if available. +slang=en + +# Override ASS subtitles with same format as SRT +sub-ass-override=force +sub-scale=0.5 + +# LOUD +volume-max=200 + +# enable hardware-accelerated decoding +hwdec=auto diff --git a/home/dot_config/mpv/scripts/copy-subs.lua b/home/dot_config/mpv/scripts/copy-subs.lua new file mode 100644 index 0000000..973e1f2 --- /dev/null +++ b/home/dot_config/mpv/scripts/copy-subs.lua @@ -0,0 +1,32 @@ +_G.auto = false + +function copy() + local sub = mp.get_property("sub-text") + if sub then + -- remove some specific unicode characters + sub = sub:gsub('\u{27a1}', '') + sub = sub:gsub('\u{fffd}', '') + sub = sub:gsub('\u{3013}', '') + sub = sub:gsub('\u{2015}', '') + + sub = sub:gsub('\n', ' ') -- replace newlines with space + sub = sub:gsub('\'', '\'\\\'\'') -- escape single quotes + os.execute("echo '" .. sub .. "' | xclip -selection clipboard -i") + end +end + +function autocopy() + if _G.auto == false then return end + copy() +end + +function toggle_autocopy() + _G.auto = not _G.auto + mp.osd_message("autocopy " .. (_G.auto and "on" or "off")) +end + +mp.add_key_binding(nil, "copy", copy) + +mp.observe_property("sub-text", "string", autocopy) +mp.add_key_binding(nil, "auto", toggle_autocopy) + diff --git a/home/dot_config/ncmpcpp/bindings b/home/dot_config/ncmpcpp/bindings new file mode 100644 index 0000000..3e748fc --- /dev/null +++ b/home/dot_config/ncmpcpp/bindings @@ -0,0 +1,52 @@ +def_key "/" + find_item_forward +def_key "n" + next_found_item +def_key "N" + previous_found_item + +def_key "-" + volume_down +def_key "=" + volume_up + +def_key "j" + scroll_down +def_key "k" + scroll_up +def_key "ctrl-u" + page_up +def_key "ctrl-d" + page_down +def_key "g" + move_home +def_key "G" + move_end + +def_key "b" + jump_to_browser +def_key "." + show_lyrics + +def_key "h" + previous_column +def_key "l" + next_column + +def_key "m" + move_selected_items_up +def_key "M" + move_selected_items_down + +def_key "v" + select_item + scroll_down +def_key "V" + reverse_selection +def_key "ctrl-v" + remove_selection + +def_key "f" + seek_forward +def_key "F" + seek_backward diff --git a/home/dot_config/ncmpcpp/config.tmpl b/home/dot_config/ncmpcpp/config.tmpl new file mode 100644 index 0000000..e3e7844 --- /dev/null +++ b/home/dot_config/ncmpcpp/config.tmpl @@ -0,0 +1,37 @@ +mpd_host = "0.0.0.0" +mpd_port = "6600" +#mpd_host = "/mnt/e/mpd/socket" +mpd_music_dir = "/mnt/e/mpd/music" +mpd_connection_timeout = 1 +mpd_crossfade_time = 1 + +external_editor = "{{ env "EDITOR" }}" +ncmpcpp_directory = "{{ env "XDG_CONFIG_HOME" }}/ncmpcpp" +lyrics_directory = "{{ env "XDG_CACHE_HOME" }}/lyrics" + +progressbar_look = "───" +progressbar_color = black +progressbar_elapsed_color = default +visualizer_color = default +playlist_display_mode = classic +autocenter_mode = yes +centered_cursor = yes +user_interface = classic +connected_message_on_startup = no + +header_visibility = no +statusbar_visibility = no +titles_visibility = no + +state_flags_color = black:b +main_window_color = white +current_item_prefix = "$r" +song_columns_list_format = "(20)[]{a} (6f)[blue]{NE} (50)[default]{t|f:Title} (20)[blue]{} (7f)[magenta]{l}" +song_list_format = " {{ "{{" }}%a - %t}|{%f}}$R{ %l} " +window_border_color = default + +alternative_header_first_line_format = "{{ "{{" }}%a $8-$0 %t}|{%f}}" +alternative_header_second_line_format = "$8{{ "{{" }}%b}|{%D}}" + +now_playing_prefix = "$b$0" +now_playing_suffix = "$/b" diff --git a/home/dot_config/neomutt/neomuttrc b/home/dot_config/neomutt/neomuttrc new file mode 100644 index 0000000..af63b3f --- /dev/null +++ b/home/dot_config/neomutt/neomuttrc @@ -0,0 +1,82 @@ +# name +set real_name = "Loek Le Blansch" +set from = "loek@pipeframe.xyz" + +# e-mail server +set folder = "~/docs/mail/pipeframe/" +set spool_file = "+Inbox" +set record = "+Sent" +set trash = "+Trash" +set postponed = "+Drafts" + +# credentials +set imap_user = "loek" +set imap_pass = "$(pass srv/wipper/passwd/loek)" +set smtp_pass = "$imap_pass" +set smtp_url = "smtp://$imap_user@mail.pipeframe.xyz:587" +set smtp_authenticators = 'login' +set ssl_starttls = yes +set ssl_force_tls = yes + +# automatically refresh incoming mail +set mail_check = 60 +set wait_key = no +push "<shell-escape> systemctl --user start mbsync & <enter>" + +# mailboxes +mailboxes +Inbox +Drafts +Junk +Sent +Trash +Archive + +# open files +set mailcap_path = "$XDG_CONFIG_HOME/mailcap" + +# keybinds (more vim-like than default) +macro index,pager a "<save-message>+Archive<enter>" "Archive Message" # archive +bind index,pager n search-next # next search match +bind index,pager N search-opposite # previous search match +bind generic,index g noop # clear immediate action of `g` (required for `gg`) +bind generic,index gg first-entry # goto top of index +bind generic,index G last-entry # goto bottom of index +bind index \Cu previous-page # page up +bind index \Cd next-page # page down +bind attach <return> view-mailcap # always use mailcap to view attachments + +# miscellaneous options +set fast_reply = yes +set confirm_append = no +set delete = yes +set include = yes +set sort = threads +set header_cache = "$XDG_CACHE_HOME/neomutt/hcache" +set edit_headers +set auto_edit = yes +set mime_type_query_command = "xdg-mime query filetype" +unset prompt_after + +# format strings +set status_format = "%D %> %P " +set folder_format = "%i" +set index_format = " %Z %[%m月%d日] %-15.15L %s " +set browser_abbreviate_mailboxes = yes + +# external programs +set editor = "$EDITOR" +# set pager = "less" +set sendmail = "/usr/bin/msmtp" + +# colors +color indicator reverse default default # selection +color index none white default # all other mail +color index bold default default "~N|~O" # new/unopened mail +uncolor status +uncolor tree +uncolor search +color hdrdefault blue default +color quoted blue black +color signature blue black +color attachment brightblack default +color prompt brightmagenta black +color message brightred default +color error brightred black +color markers red black +color tilde brightmagenta black + diff --git a/home/dot_config/neovide/config.toml b/home/dot_config/neovide/config.toml new file mode 100644 index 0000000..369f982 --- /dev/null +++ b/home/dot_config/neovide/config.toml @@ -0,0 +1 @@ +multigrid = true diff --git a/home/dot_config/nvim/coc-settings.json b/home/dot_config/nvim/coc-settings.json new file mode 100644 index 0000000..fc11396 --- /dev/null +++ b/home/dot_config/nvim/coc-settings.json @@ -0,0 +1,44 @@ +{ + "suggest.noselect": true, + "python.jediEnabled": false, + "inlayHint.enable": false, + "languageserver": { + "clangd": { + "command": "clangd", + "rootPatterns": ["compile_flags.txt", "compile_commands.json"], + "filetypes": ["c", "cc", "cpp", "c++", "objc", "objcpp"] + }, + "dart": { + "command": "dart", + "args": [ + "/opt/dart-sdk/bin/snapshots/analysis_server.dart.snapshot", + "--lsp", + "--client-id", + "vim", + "--client-version", + "coc.nvim" + ], + "filetypes": ["dart"], + "trace.server": "verbose" + }, + "arduino":{ + "command":"/usr/bin/arduino-language-server", + "rootPatterns":["*.ino"], + "filetypes":["arduino"], + "args":["-cli", "/bin/arduino-cli", "-clangd", "/bin/clangd", "-cli-config", "/home/loek/.arduino15/arduino-cli.yaml"] + }, + "sql": { + "command": "sqls", + "filetypes": ["sql", "mysql"] + }, + "vhdl": { + "command": "vhdl_ls", + "filetypes": ["vhdl"] + }, + "glsl": { + "command": "glsl_analyzer", + "filetypes": ["glsl", "vert", "tesc", "tese", "frag", "geom", "comp"] + } + }, + "java.import.gradle.java.home": "/usr/lib/jvm/java-17-openjdk" +} diff --git a/home/dot_config/nvim/color-tweaks.vim b/home/dot_config/nvim/color-tweaks.vim new file mode 100644 index 0000000..2fd2227 --- /dev/null +++ b/home/dot_config/nvim/color-tweaks.vim @@ -0,0 +1,41 @@ +" change default vim-sneak colors to be more readable +hi! SneakLabel gui=reverse +hi! SneakLabelMask gui=reverse + +" consistent cursor colors +hi! Cursor gui=NONE guifg=bg guibg=fg +hi! link iCursor Cursor + +" fix terminal color +hi! link TermCursor Cursor +hi! link TermCursorNC Cursor + +" fix which key color +hi! link WhichKeyFloating NormalFloat + +" line numbers / gutter colors +hi! SignColumn guibg=NONE ctermbg=NONE +hi GitGutterAdd guibg=NONE +hi GitGutterChange guibg=NONE +hi GitGutterDelete guibg=NONE +hi GitGutterAddIntraLine guibg=NONE +hi GitGutterAddInvisible guibg=NONE +hi GitGutterChangeDelete guibg=NONE +hi GitGutterChangeInvisible guibg=NONE +hi GitGutterDeleteIntraLine guibg=NONE +hi GitGutterDeleteInvisible guibg=NONE +hi CocErrorSign guibg=NONE +hi CocGitAddedSign guibg=NONE +hi CocGitChangeRemovedSign guibg=NONE +hi CocGitChangedSign guibg=NONE +hi CocGitRemovedSign guibg=NONE +hi CocGitTopRemovedSign guibg=NONE +hi CocHintSign guibg=NONE +hi CocInfoSign guibg=NONE +hi CocWarningSign guibg=NONE + +" fix disappearing CocFadeOut +hi! link Conceal Comment + +hi! link WinSeparator LineNr +hi! link NonText EndOfBuffer diff --git a/home/dot_config/nvim/ftplugin/tex.vim b/home/dot_config/nvim/ftplugin/tex.vim new file mode 100644 index 0000000..4e643f1 --- /dev/null +++ b/home/dot_config/nvim/ftplugin/tex.vim @@ -0,0 +1,5 @@ +setlocal cc=86 +setlocal textwidth=85 +noremap \b c\begin{<C-R>"}<CR>\end{<C-R>"} +let g:Tex_SmartKeyQuote=0 + diff --git a/home/dot_config/nvim/init.vim b/home/dot_config/nvim/init.vim new file mode 100644 index 0000000..6d3768c --- /dev/null +++ b/home/dot_config/nvim/init.vim @@ -0,0 +1,409 @@ +let mapleader = " " +set modeline +set wrap +set autoindent +set noexpandtab +set tabstop=2 +set shiftwidth=2 +set termguicolors +set shortmess+=It +set splitbelow splitright +set noshowmode +set ignorecase +set smartcase +set timeoutlen=500 +set updatetime=100 +set smoothscroll +set mouse=a +set cino=N-s,E-s,l1,g-1,j1 +set linebreak " set wrap but don't wrap inside words +set viminfo+='1000,n~/.local/nvim/viminfo +set guifont=monospace:h7.5:#e-subpixelantialias +set linespace=3 +set tabpagemax=999 +set breakindent +set breakindentopt+=list:-1,shift:-2 +set showbreak=:\ +set formatoptions+=mM +set tags^=build/tags +set ssop-=options +set guicursor=n-v-c-sm:block,i-ci-ve:ver20,r-cr-o:hor05,t:block-TermCursor +let g:sneak#label = 1 +let g:which_key_map = {} +let g:airline_powerline_fonts = 1 +let g:minimap_highlight='Visual' +let g:python3_host_prog='/usr/bin/python3' +let g:DiffColors = 0 +let g:AutoPairsMultilineClose = 0 +filetype plugin on + +if exists("g:neovide") + nmap <silent> <C-=> :lua vim.g.neovide_scale_factor = vim.g.neovide_scale_factor + 0.1<CR> + nmap <silent> <C-ScrollWheelUp> :lua vim.g.neovide_scale_factor = vim.g.neovide_scale_factor + 0.1<CR> + nmap <silent> <C--> :lua vim.g.neovide_scale_factor = vim.g.neovide_scale_factor - 0.1<CR> + nmap <silent> <C-ScrollWheelDown> :lua vim.g.neovide_scale_factor = vim.g.neovide_scale_factor - 0.1<CR> + nmap <silent> <C-0> :lua vim.g.neovide_scale_factor = 1<CR> + let g:smoothie_enabled = v:false + let g:neovide_scroll_animation_length = 0.16 + let g:neovide_floating_shadow = v:false + let g:neovide_cursor_animation_length = 0.04 + let g:neovide_cursor_trail_size = 0.0 + let g:neovide_padding_top=10 + let g:neovide_padding_left=10 + let g:neovide_padding_right=10 + let g:neovide_padding_bottom=10 +endif + +" plugged +call plug#begin('~/.config/nvim/plugged') +" tim <3 +Plug 'tpope/vim-surround' +Plug 'tpope/vim-speeddating' +Plug 'tpope/vim-eunuch' +Plug 'tpope/vim-commentary' + +" quality of life +Plug 'jiangmiao/auto-pairs' +Plug 'itchyny/lightline.vim' +Plug 'terryma/vim-multiple-cursors' +Plug 'liuchengxu/vim-which-key' +Plug 'justinmk/vim-sneak' +Plug 'mbbill/undotree' +Plug 'neoclide/coc.nvim', {'branch': 'release'} +Plug 'puremourning/vimspector' +Plug 'junegunn/goyo.vim' +Plug 'psliwka/vim-smoothie' +Plug 'airblade/vim-gitgutter' +Plug 'wellle/targets.vim' +Plug 'dkarter/bullets.vim' +Plug 'editorconfig/editorconfig-vim' +Plug 'rickhowe/diffunitsyntax' +Plug 'lervag/file-line' +Plug 'vim-scripts/AnsiEsc.vim' +Plug 'vim-scripts/taglist.vim' + +" language plugins +Plug 'lervag/vimtex' +Plug 'hail2u/vim-css3-syntax' +Plug 'octol/vim-cpp-enhanced-highlight' +Plug 'vim-python/python-syntax' +Plug 'dart-lang/dart-vim-plugin' +Plug 'bartlomiejdanek/vim-dart' +Plug 'HerringtonDarkholme/yats.vim' +Plug 'cespare/vim-toml' +Plug 'tikhomirov/vim-glsl' +Plug 'vim-scripts/syntaxm4.vim' +Plug 'elkowar/yuck.vim' +Plug 'eraserhd/parinfer-rust', {'do': 'cargo build --release'} +Plug 'kaarmu/typst.vim' +Plug 'aklt/plantuml-syntax' +Plug 'fymyte/rasi.vim' +Plug 'habamax/vim-asciidoctor' +Plug 'lonkaars/coc-khard' +Plug 'sile-typesetter/vim-sile' +Plug 'ahf/cocci-syntax' +Plug 's3rvac/vim-syntax-jira' + +" themes +Plug 'arzg/vim-colors-xcode' +Plug 'romgrk/github-light.vim' +Plug 'vv9k/vim-github-dark' +Plug 'rose-pine/neovim', {'as': 'rose-pine'} + +Plug '~/.config/nvim/local/coc-markdown-links' +call plug#end() + +" keybinds +tnoremap <Esc> <C-\><C-n> +nnoremap tt :tabnew<CR> +nnoremap <CR> o<Esc> +nnoremap <leader>qf <Plug>(coc-fix-current) +nnoremap <silent> * yiw:let @/='\<<C-R>=expand("<cword>")<CR>\>'<CR>:set hls<CR> +nnoremap <silent> <A-j> :m +1<CR> +nnoremap <silent> <A-k> :m -2<CR> + +nnoremap <silent> gd :call CocAction('jumpDefinition')<cr> +nnoremap <silent> <leader>d :call CocAction('jumpDefinition', 'vsplit')<cr> + +imap <C-h> <Left> +imap <C-j> <Down> +imap <C-k> <Up> +imap <C-l> <Right> + +command UTF2Latex + \ :%s/‘/`/ge | + \ :%s/’/'/ge | + \ :%s/“/``/ge | + \ :%s/”/''/ge | + \ :%s/–/--/ge | + \ :%s/—/---/ge +command UTF2Ascii + \ :%s/‘/'/ge | + \ :%s/’/'/ge | + \ :%s/“/"/ge | + \ :%s/”/"/ge | + \ :%s/–/--/ge | + \ :%s/—/---/ge + +" leader keybindings +nnoremap <silent> <leader> :WhichKey '<space>'<CR> + +map <leader>vo <Plug>VimspectorContinue +map <leader>vq <Plug>VimspectorStop +map <leader>vr <Plug>VimspectorRestart +map <leader>vp <Plug>VimspectorPause +map <leader>vb <Plug>VimspectorToggleBreakpoint +map <leader>vc <Plug>VimspectorToggleConditionalBreakpoint +map <leader>vf <Plug>VimspectorAddFunctionBreakpoint +map <leader>vn <Plug>VimspectorStepOver +map <leader>vi <Plug>VimspectorStepInto +map <leader>vu <Plug>VimspectorStepOut +let g:which_key_map.v = { + \ 'name': '+vimspector', + \ 'o': 'continue', + \ 'q': 'stop', + \ 'r': 'restart', + \ 'p': 'pause', + \ 'b': 'toggle breakpoint', + \ 'c': 'toggle conditional breakpoint', + \ 'f': 'add function breakpoint', + \ 'n': 'step over', + \ 'i': 'step into', + \ 'u': 'step out' + \ } + +map <leader>p "+p +map <leader>y "+y +let g:which_key_map.p = 'x11 paste' +let g:which_key_map.y = 'x11 yank' + +map <silent> <leader>w :w<cr> +let g:which_key_map.w = 'write' + +map <silent> <leader>dv :VimtexView<cr> +map <silent> <leader>dc :VimtexCompile<cr> +map <silent> <leader>de :VimtexErrors<cr> +map <silent> <leader>dt :VimtexTocToggle<cr> +let g:which_key_map.d = { + \ 'name': '+document', + \ 'v': 'view', + \ 'c': 'compile', + \ 'e': 'errors', + \ 't': 'table of contents' + \ } + +map <silent> <leader>ts :sp term://zsh<cr>i +map <silent> <leader>tv :vsp term://zsh<cr>i +map <silent> <leader>tt :tabnew term://zsh<cr>i +let g:which_key_map.t = { + \ 'name': '+term', + \ 's': 'split', + \ 'v': 'vsplit', + \ 't': 'tab' + \ } + +map <silent> <leader>.v :tabnew ~/.config/nvim/init.vim<cr> +let g:which_key_map['.'] = { + \ 'name': '+config', + \ 'v': 'vim', + \ } + +map <silent> <leader>u :UndotreeToggle<cr> +let g:which_key_map.u = 'toggle undo tree' + +nnoremap <silent> <leader>e 0f!xC<c-r>=system(@-)<cr><esc>ddk$ +let g:which_key_map.e = 'read and execute after !' + +nnoremap <leader>] <c-w>v<c-]>zt +let g:which_key_map[']'] = 'open tag in split' + +nnoremap <silent> <leader>[ :call jobstart(['sdk10-dox-open', expand("<cword>")], {'detach': v:true})<enter> + +" cmd maps +cnoreabbrev W w +cnoreabbrev sudow w !sudo tee % + +" emacs bindings in vim command-line +cnoremap <A-b> <S-Left> +cnoremap <A-f> <S-Right> +cnoremap <C-a> <Home> +cnoremap <C-e> <End> +cnoremap <A-backspace> <C-w> + +" hexokinase +let g:Hexokinase_termDisabled = 1 +let g:Hexokinase_optOutPatterns = [ 'colour_names' ] + +" lightline +let g:lightline = { + \ 'colorscheme': 'auto', + \ 'mode_map': { + \ 'n' : 'norm', + \ 'i' : 'ins', + \ 'R' : 'rep', + \ 'v' : 'vis', + \ 'V' : 'v-l', + \ "\<C-v>": 'v-b', + \ 'c' : 'cmd', + \ 's' : 'sel', + \ 'S' : 's-l', + \ "\<C-s>": 's-b', + \ 't': 'term', + \ }, + \ 'active': { + \ 'left': [ + \ [ 'mode', 'paste' ], + \ [ 'readonly', 'filename', 'modified'], + \ ], + \ 'right': [ [ 'lineinfo' ] ], + \ }, + \ 'inactive': { + \ 'left': [ + \ [ 'readonly', 'filename', 'modified'], + \ ], + \ 'right': [ [ 'lineinfo' ] ], + \ }, + \ 'tabline': { + \ 'left': [ [ 'tabs' ] ], + \ 'right': [ ], + \ }, + \ 'subseparator': { + \ 'left': '', + \ 'right': '', + \ }, + \ } +call lightline#init() + +" vimtex config +let g:tex_flavor = 'latex' +let g:vimtex_quickfix_open_on_warning = 0 +let g:vimtex_imaps_enabled = 0 +let g:vimtex_compiler_method = 'latexmk' +let g:vimtex_compiler_latexmk_engines = { '_': '' } + +" TeX quotes +autocmd FileType tex let b:surround_{char2nr("q")} = "`\r'" +autocmd FileType tex let b:surround_{char2nr('Q')} = "``\r''" +autocmd FileType tex let b:AutoPairs = {'(':')', '[':']', '{':'}', "``":"''", "`":"'", '$':'$', '"':'"'} + +" AutoPairs for plantuml +autocmd FileType plantuml let b:AutoPairs = {'(':')', '[':']', '{':'}', '`':'`'} + +" coc.vim <tab> completion and <cr> stuff +function! CheckBackspace() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction +inoremap <silent><expr> <TAB> + \ coc#pum#visible() ? coc#pum#next(1) : + \ CheckBackspace() ? "\<Tab>" : + \ coc#refresh() +inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>" + +function! s:check_back_space() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction + +if has("patch-8.1.1564") + set signcolumn=number +else + set signcolumn=yes +endif + +inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>" + +" coc code navigation +map <silent> <leader>cd <Plug>(coc-definition) +map <silent> <leader>cy <Plug>(coc-type-definition) +map <silent> <leader>ci <Plug>(coc-implementation) +map <silent> <leader>cr <Plug>(coc-references) +map <leader>cn <Plug>(coc-rename) +let g:which_key_map.c = { + \ 'name': '+coc', + \ 'd': 'definition', + \ 'y': 'type definition', + \ 'i': 'implementation', + \ 'r': 'references', + \ 'n': 'rename' + \ } + +" use <c-space>for trigger completion +inoremap <silent><expr> <c-space> coc#refresh() + +" auto-comment uit +" autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o + +" which key register dict +call which_key#register('<Space>', "g:which_key_map") + +" no line numbers in terminal +augroup TerminalStuff + " Clear old autocommands + au! + autocmd TermOpen * setlocal nonumber norelativenumber + autocmd TermOpen * set signcolumn=no +augroup END + +" python-syntax +" let g:python_highlight_all = 1 +let g:python_recommended_style = 0 +" autocmd FileType python setlocal noexpandtab +au BufRead,BufNewFile *.py set expandtab + +function! SynStack() + if !exists("*synstack") + return + endif + echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")') +endfunc + +" markdown +let g:markdown_enable_spell_checking = 0 +au FileType markdown set expandtab + +" asciidoc +au FileType asciidoctor set expandtab + +" binary files +augroup Binary + au! + au BufReadPre *.bin let &bin=1 + au BufReadPost *.bin if &bin | %!xxd + au BufReadPost *.bin set ft=xxd | endif + au BufWritePre *.bin if &bin | %!xxd -r + au BufWritePre *.bin endif + au BufWritePost *.bin if &bin | %!xxd + au BufWritePost *.bin set nomod | endif + au BufWritePost *.bin set noeol +augroup END + +" highlight Zephyr .overlay files as devicetree source (dts) +augroup devicetree_ft + au! + au BufRead,BufNewFile *.overlay set syntax=dts + au BufRead,BufNewFile *.dtsi set syntax=dts +augroup END + +augroup BibLaTeX + " add allowed characters in biblatex labels to word delimiters + autocmd! + autocmd FileType bib setlocal iskeyword+=:,- +augroup END + +" sneak +let g:sneak#use_ic_scs = 0 + +" fcitx5 +autocmd InsertEnter * call system("fcitx5-temp-restore &") +autocmd InsertLeave * call system("fcitx5-temp-off &") + +" colorscheme +source $XDG_CONFIG_HOME/nvim/mode.vim + +" use .exrc files +set exrc +set secure + +" file-line +let g:file_line_crosshairs = v:false diff --git a/home/dot_config/nvim/mode.vim b/home/dot_config/nvim/mode.vim new file mode 100644 index 0000000..e1deaca --- /dev/null +++ b/home/dot_config/nvim/mode.vim @@ -0,0 +1,9 @@ +" this file should only contain colorscheme information, and sourcing it +" should cause colors set by `mode` to update in an existing neovim session +source $XDG_CONFIG_HOME/nvim/mode/colorscheme.vim +source $XDG_CONFIG_HOME/nvim/mode/termcolors.vim +source $XDG_CONFIG_HOME/nvim/mode/lightline.vim +call lightline#colorscheme() + +source $XDG_CONFIG_HOME/nvim/color-tweaks.vim + diff --git a/home/dot_config/pam-gnupg.tmpl b/home/dot_config/pam-gnupg.tmpl new file mode 100644 index 0000000..710dc91 --- /dev/null +++ b/home/dot_config/pam-gnupg.tmpl @@ -0,0 +1,2 @@ +{{ env "GNUPGHOME" }} +D8D22B94C13557BF2B5A0DCF4AF5A972E2FAF84F diff --git a/home/dot_config/picom.conf b/home/dot_config/picom.conf new file mode 100644 index 0000000..372806a --- /dev/null +++ b/home/dot_config/picom.conf @@ -0,0 +1,132 @@ +# do not touch, shit finally works w/ gpu +# backend = "xrender"; +backend = "glx"; +vsync = true; + +corner-radius = 10; + +shadow = true; +shadow-radius = 48; +shadow-opacity = 0.2; +shadow-offset-y = -36; +shadow-offset-x = -48; + +fade = false; +fade-in-step = 0.3; +fade-out-step = 0.18; +fade-delta = 16; + +rules = ( + { + match = "class_i *= 'scrcpy'"; + corner-radius = 32; + }, + { + match = "!I3_FLOATING_WINDOW@ = 1"; + shadow = false; + corner-radius = 0; + }, + { + match = "window_type *= 'desktop'"; + shadow = false; + }, + { + match = "window_type *= 'splash'"; + shadow = false; + }, + { + match = "window_type *= 'notification'"; + fade = true; + corner-radius = 12; + shadow = true; + }, + { + match = "_NET_WM_STATE@[*] = '_NET_WM_STATE_ABOVE'"; + shadow = true; + corner-radius = 10; + }, + { + match = "window_type *= 'menu' && override_redirect"; + corner-radius = 0; + full-shadow = true; + shadow = true; + }, + { + match = "window_type *= 'tooltip'"; + fade = true; + shadow = false; + corner-radius = 0; + }, + { + match = "window_type *= 'dock'"; + shadow = false; + corner-radius = 0; + animations = ( + { + triggers = [ "open" ]; + preset = "slide-in"; + direction = "up"; + duration = 0.200; + }, + { + triggers = [ "close" ]; + preset = "slide-out"; + direction = "up"; + duration = 0.175; + }, + ); + }, + { + match = "window_type *= 'combo'"; + shadow = true; + corner-radius = 10; + }, + { + match = "window_type *= 'popup'"; + shadow = true; + corner-radius = 10; + }, + { + match = "class_i *= 'RAIL'"; + corner-radius = 0; + }, + { + match = "_NET_WM_STATE@[*] = '_NET_WM_STATE_FULLSCREEN'"; + shadow = false; + }, +) + +animations = ( + { + triggers = [ "geometry" ]; + offset-x = { + curve = "cubic-bezier(0.05, 0, 0, 1)"; + duration = 0.250; + start = "window-x-before - window-x"; + end = 0; + }; + offset-y = { + curve = "cubic-bezier(0.05, 0, 0, 1)"; + duration = 0.250; + start = "window-y-before - window-y"; + end = 0; + }; + shadow-offset-x = "offset-x"; + shadow-offset-y = "offset-y"; + saved-image-blend = 0; + }, + { + triggers = [ "open" ]; + preset = "appear"; + scale = 0.95; + duration = 0.075; + }, + { + triggers = [ "close" ]; + preset = "disappear"; + scale = 0.95; + duration = 0.075; + }, +); + +# vim: ft=conf diff --git a/home/dot_config/pipewire/pipewire.conf.d/50-bitrate.conf b/home/dot_config/pipewire/pipewire.conf.d/50-bitrate.conf new file mode 100644 index 0000000..bbf2c92 --- /dev/null +++ b/home/dot_config/pipewire/pipewire.conf.d/50-bitrate.conf @@ -0,0 +1,5 @@ +context.properties = { + default.clock.rate = 96000 + default.clock.allowed-rates = [ 96000 ] +} + diff --git a/home/dot_config/poke/pokerc.conf b/home/dot_config/poke/pokerc.conf new file mode 100644 index 0000000..90a320f --- /dev/null +++ b/home/dot_config/poke/pokerc.conf @@ -0,0 +1,7 @@ +.set obase 16 +.set omode tree +.set pretty-print yes +.set oacutoff 32 + +pk_dump_cluster_by = 4 + diff --git a/home/dot_config/polybar/config.ini.tmpl b/home/dot_config/polybar/config.ini.tmpl new file mode 100644 index 0000000..4af32e6 --- /dev/null +++ b/home/dot_config/polybar/config.ini.tmpl @@ -0,0 +1,169 @@ +[barsettings] +padding = 1.9 +include-file = ./colors.ini + +[global/wm] +margin-bottom = 50 +margin-top = 0 + +[bar/main] +tray-position = right +tray-padding = ${barsettings.padding} +tray-background = ${color.bg} +tray-margin = 8 + +monitor = +monitor-fallback = +monitor-strict = false + +override-redirect = false + +bottom = false +fixed-center = true + +width = 100% +height = 20 +offset-x = 0 +offset-y = 0 + +background = ${color.bg} +foreground = ${color.fg} + +radius-top = 0.0 +radius-bottom = 0.0 + +padding = 5 +module-margin-left = 1 +module-margin-right = 1 + +font-0 = "sans-serif:pixelsize=8:weight=regular:size=0;2" +font-1 = "sans-serif:pixelsize=8:weight=bold:size=0;2" + +font-2 = "Hiragino Kaku Gothic ProN W3:pixelsize=8:weight=medium:size=0;1" +font-3 = "Hiragino Kaku Gothic ProN W6:pixelsize=8:weight=medium:size=0;1" +font-4 = "Noto Sans KR:pixelsize=8:weight=medium:size=0;2" +font-5 = "Noto Sans CJK SC:pixelsize=8:weight=medium:size=0;2" + +modules-left = time date +modules-center = mpd +modules-right = wacomtouch keyboard volume + +separator = + +spacing = 0 + +dim-value = 1.0 + +wm-name = + +locale = {{ env "LANG" }} + +wm-restack = i3 + +enable-ipc = true + +click-left = +click-middle = +click-right = +scroll-up = +scroll-down = +double-click-left = +double-click-middle = +double-click-right = + +cursor-click = +cursor-scroll = + +[settings] +screenchange-reload = false + +compositing-background = source +compositing-foreground = over +compositing-overline = over +compositing-underline = over +compositing-border = over + +format-foreground = ${color.fg} +format-background = ${color.bg} +format-padding = ${barsettings.padding} + +pseudo-transparency = false + +[module/volume] +type = internal/pulseaudio +format-volume = <label-volume> +label-volume = %percentage%% +label-muted = "muted" + +[module/date] +type = internal/date +interval = 1.0 +time = %m月%d日 (%a) +format = <label> +label = %time% + +[module/time] +type = internal/date +interval = 1.0 +time = %H:%M +format = <label> +label = %time% +label-font = 2 + +[module/keyboard] +type = custom/script +exec = kbindicator +tail = true + +[module/mpd] +type = internal/mpd +format-online = <label-song> +format-offline = +format-stopped = +label-song = %artist% - %title% +label-song-maxlen = 50 +label-song-ellipsis = true + +[module/wacomtouch] +type = custom/script +exec = wacomtouch +interval = 1 + +[module/battery1] +type = internal/battery +battery = BAT0 +adapter = AC +poll-interval = 5 +format-charging = <label-charging> +format-charging-foreground = ${color.fg-half} +format-full = 100% +format-discharging = <label-discharging> +label-charging = %percentage%% +label-discharging = %percentage%% + +[module/battery2] +type = internal/battery +battery = BAT1 +adapter = AC +poll-interval = 5 +format-charging = <label-charging> +format-charging-foreground = ${color.fg-half} +format-full = 100% +format-discharging = <label-discharging> +label-charging = %percentage%% +label-discharging = %percentage%% + +[module/brightness] +type = internal/backlight +card = intel_backlight +format = <label> + +[module/wireless] +type = internal/network +interface = wlan0 +format-connected = <label-connected> +format-disconnected = <label-disconnected> +label-connected = %essid% +label-disconnected = no network + +; vim:ft=dosini diff --git a/home/dot_config/ranger/rc.conf b/home/dot_config/ranger/rc.conf new file mode 100644 index 0000000..c38471a --- /dev/null +++ b/home/dot_config/ranger/rc.conf @@ -0,0 +1,8 @@ +set preview_images true +set preview_images_method ueberzug + +else = xdg-open "$1" +label editor = "$EDITOR" -- "$@" + +map <space> shell dragon-drag-and-drop -a -x %p +map <C-h> set show_hidden true diff --git a/home/dot_config/rofi-pass/config b/home/dot_config/rofi-pass/config new file mode 100644 index 0000000..3c8ff00 --- /dev/null +++ b/home/dot_config/rofi-pass/config @@ -0,0 +1,25 @@ +#!/bin/sh +# make sure the filename is used as the account name +default_user=':filename' +type_delay=0 + +# pass custom rofi flags +_rofi() { + rofi \ + -i \ + -no-auto-select \ + -config "$XDG_CONFIG_HOME/rofi-pass/rofi.rasi" \ + "$@" +} + +_do_type_xdotool() { + fcitx5-temp-off # see ~/.local/share/bin + + # tr -d required because the "path" variable ends in a newline character + tr -d '\n' |\ + xdotool type --delay ${type_delay} --clearmodifiers --file - + # xdotool command is otherwise not modified + + fcitx5-temp-restore +} + diff --git a/home/dot_config/rofi-pass/rofi.rasi b/home/dot_config/rofi-pass/rofi.rasi new file mode 100644 index 0000000..829bcb0 --- /dev/null +++ b/home/dot_config/rofi-pass/rofi.rasi @@ -0,0 +1,16 @@ +// this import automatically resolves to ${XDG_CONFIG_HOME}/rofi/config.rasi +// (see section on 'Multiple file handling' in man rofi-theme(5)) +@import "config.rasi" + +configuration { + matching: "prefix"; +} + +listview { + lines: 12; +} + +prompt { + enabled: false; +} + diff --git a/home/dot_config/rofi/config.rasi.tmpl b/home/dot_config/rofi/config.rasi.tmpl new file mode 100644 index 0000000..23bbf45 --- /dev/null +++ b/home/dot_config/rofi/config.rasi.tmpl @@ -0,0 +1,69 @@ +configuration { + modi: "drun,run"; + font: "sans-serif 8"; + matching: "fuzzy"; + separator-style: "none"; + hide-scrollbar: true; + + drun-match-fields: "name,generic,categories,keywords"; + drun-display-format: "{name}"; + + filebrowser { + directory: "{{ env "HOME" }}/docs"; + } + + kb-remove-to-eol: "Control+Shift+e"; + kb-accept-entry: "Control+m,Return,KP_Enter"; + kb-row-up: "Up,Control+k,Shift+Tab,Shift+ISO_Left_Tab"; + kb-row-down: "Down,Control+j"; +} + +window { + padding: 2px; + background-color: ${bg}; + text-color: ${fg}; + width: 350px; + border-radius: 10px; +} + +* { + spacing: 0; + line-padding: 0; + line-margin: 0; + background-color: inherit; + text-color: inherit; +} + +message { + margin: 8px; +} + +inputbar { + children: [entry]; +} + +entry { + padding: 10px 10px 8px 10px; + cursor-width: 1px; +} + +listview { + cycle: false; + scrollbar: false; + lines: 6; + fixed-height: false; + padding: 2px 0px; +} + +element { + margin: -2px 0px; + padding: 6px 10px 2px 10px; + background-color: transparent; + text-color: ${fg}; +} + +element selected { + border-radius: 8px; + background-color: ${accent}; + text-color: ${accent_text}; +} diff --git a/home/dot_config/sxiv/exec/executable_image-info b/home/dot_config/sxiv/exec/executable_image-info new file mode 100644 index 0000000..7683c3a --- /dev/null +++ b/home/dot_config/sxiv/exec/executable_image-info @@ -0,0 +1,6 @@ +#!/bin/sh +printf '%s %s %s' \ + "$(basename "$1")" \ + "$(date -r "$1")" \ + "$2x$3 ($(du -Hh "$1" | cut -f 1))" + diff --git a/home/dot_config/systemd/user/default.target.wants/symlink_goimapnotify@pipeframe.service b/home/dot_config/systemd/user/default.target.wants/symlink_goimapnotify@pipeframe.service new file mode 100644 index 0000000..8797972 --- /dev/null +++ b/home/dot_config/systemd/user/default.target.wants/symlink_goimapnotify@pipeframe.service @@ -0,0 +1 @@ +/usr/lib/systemd/user/goimapnotify@.service diff --git a/home/dot_config/systemd/user/default.target.wants/symlink_mpd.service b/home/dot_config/systemd/user/default.target.wants/symlink_mpd.service new file mode 100644 index 0000000..f94f6ef --- /dev/null +++ b/home/dot_config/systemd/user/default.target.wants/symlink_mpd.service @@ -0,0 +1 @@ +/usr/lib/systemd/user/mpd.service diff --git a/home/dot_config/systemd/user/default.target.wants/symlink_pipewire-pulse.service b/home/dot_config/systemd/user/default.target.wants/symlink_pipewire-pulse.service new file mode 100644 index 0000000..a72afa4 --- /dev/null +++ b/home/dot_config/systemd/user/default.target.wants/symlink_pipewire-pulse.service @@ -0,0 +1 @@ +/usr/lib/systemd/user/pipewire-pulse.service diff --git a/home/dot_config/systemd/user/default.target.wants/symlink_pipewire.service b/home/dot_config/systemd/user/default.target.wants/symlink_pipewire.service new file mode 100644 index 0000000..06933ea --- /dev/null +++ b/home/dot_config/systemd/user/default.target.wants/symlink_pipewire.service @@ -0,0 +1 @@ +/usr/lib/systemd/user/pipewire.service diff --git a/home/dot_config/systemd/user/mbsync.service b/home/dot_config/systemd/user/mbsync.service new file mode 100644 index 0000000..892b701 --- /dev/null +++ b/home/dot_config/systemd/user/mbsync.service @@ -0,0 +1,7 @@ +[Unit] +Description=Mailbox synchronization service + +[Service] +Type=oneshot +ExecStart=/usr/bin/mbsync --verbose --all --config "${XDG_CONFIG_HOME}/mbsyncrc" + diff --git a/home/dot_config/systemd/user/mbsync.timer b/home/dot_config/systemd/user/mbsync.timer new file mode 100644 index 0000000..980eb22 --- /dev/null +++ b/home/dot_config/systemd/user/mbsync.timer @@ -0,0 +1,11 @@ +[Unit] +Description=Mailbox synchronization timer + +[Timer] +OnBootSec=2m +OnUnitActiveSec=5m +Unit=mbsync.service + +[Install] +WantedBy=timers.target + diff --git a/home/dot_config/systemd/user/pipewire.service.wants/symlink_wireplumber.service b/home/dot_config/systemd/user/pipewire.service.wants/symlink_wireplumber.service new file mode 100644 index 0000000..3111543 --- /dev/null +++ b/home/dot_config/systemd/user/pipewire.service.wants/symlink_wireplumber.service @@ -0,0 +1 @@ +/usr/lib/systemd/user/wireplumber.service diff --git a/home/dot_config/systemd/user/pipewire.service.wants/symlink_wireplumber@loek.service b/home/dot_config/systemd/user/pipewire.service.wants/symlink_wireplumber@loek.service new file mode 100644 index 0000000..3beaddd --- /dev/null +++ b/home/dot_config/systemd/user/pipewire.service.wants/symlink_wireplumber@loek.service @@ -0,0 +1 @@ +/usr/lib/systemd/user/wireplumber@.service diff --git a/home/dot_config/systemd/user/sockets.target.wants/symlink_pipewire-pulse.socket b/home/dot_config/systemd/user/sockets.target.wants/symlink_pipewire-pulse.socket new file mode 100644 index 0000000..9930a8d --- /dev/null +++ b/home/dot_config/systemd/user/sockets.target.wants/symlink_pipewire-pulse.socket @@ -0,0 +1 @@ +/usr/lib/systemd/user/pipewire-pulse.socket diff --git a/home/dot_config/systemd/user/sockets.target.wants/symlink_pipewire.socket b/home/dot_config/systemd/user/sockets.target.wants/symlink_pipewire.socket new file mode 100644 index 0000000..9a8dfc8 --- /dev/null +++ b/home/dot_config/systemd/user/sockets.target.wants/symlink_pipewire.socket @@ -0,0 +1 @@ +/usr/lib/systemd/user/pipewire.socket diff --git a/home/dot_config/systemd/user/timers.target.wants/symlink_mbsync.timer b/home/dot_config/systemd/user/timers.target.wants/symlink_mbsync.timer new file mode 100644 index 0000000..2b02041 --- /dev/null +++ b/home/dot_config/systemd/user/timers.target.wants/symlink_mbsync.timer @@ -0,0 +1 @@ +/home/loek/.config/systemd/user/mbsync.timer diff --git a/home/dot_config/todoman/config.py b/home/dot_config/todoman/config.py new file mode 100644 index 0000000..b50af25 --- /dev/null +++ b/home/dot_config/todoman/config.py @@ -0,0 +1,5 @@ +#!/bin/python3 +path = "$XDG_DATA_HOME/vdirsyncer/*/*" +default_list = "タスク" +default_priority = 9 +default_due = 0 diff --git a/home/dot_config/user-dirs.dirs b/home/dot_config/user-dirs.dirs new file mode 100644 index 0000000..df754e6 --- /dev/null +++ b/home/dot_config/user-dirs.dirs @@ -0,0 +1,15 @@ +# This file is written by xdg-user-dirs-update +# If you want to change or add directories, just edit the line you're +# interested in. All local changes will be retained on the next run. +# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped +# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an +# absolute path. No other format is supported. +# +XDG_DOWNLOAD_DIR="$HOME/dl" +XDG_DOCUMENTS_DIR="$HOME/docs" +XDG_MUSIC_DIR="$HOME/" +XDG_DESKTOP_DIR="$HOME/" +XDG_TEMPLATES_DIR="$HOME/" +XDG_PUBLICSHARE_DIR="$HOME/" +XDG_PICTURES_DIR="$HOME/" +XDG_VIDEOS_DIR="$HOME/" diff --git a/home/dot_config/vdirsyncer/config.sh.example b/home/dot_config/vdirsyncer/config.sh.example new file mode 100644 index 0000000..0c7d81a --- /dev/null +++ b/home/dot_config/vdirsyncer/config.sh.example @@ -0,0 +1,31 @@ +#!/bin/sh +# this file is included from .config/vdirsyncer/config_gen and +# .config/khal/config_gen. The shims for `khal` and `vdirsyncer` automatically +# run these scripts to update the configuration files. Note that you do still +# need to set up a synchronization mechanism (e.g. systemd timer for running +# `vdirsyncer sync`) + +# uncomment to convert true color calendar color (#RRGGBB) into 16-color (ANSI) +# codes +# export QUANTIZE_COLOR=y + +### CalDAV example +# NOTE: color and display name are automatically downloaded from the server, +# and can not be set manually +caldav 'https://dav.example.com' 'username' "$(pass www/dav.example.com/username)" +# `caldav` only syncs calendar items. you can replace `caldav` with `carddav` +# to only sync address books, or replace it with `dav` to sync both + +### Web calendar example +# NOTE: url should start with http(s)://, not webcal:// +ical 'https://example.com/calendar-1.ics' +# COLOR and NAME can be overridden for ical URLs: +COLOR='light magenta' NAME='Calendar 2' ical 'https://example.com/calendar-2.ics' +# Comment a line to disable the calendar (temporarily) +#ical 'https://example.com/calendar-3.ics' +# iCal URL that requires HTTP authentication: +ical 'https://example.com/calendar-1.ics' 'username' 'password' + +# Keep in mind that this file is just a POSIX sh script, and you can use +# environment variables, control flow, etc. + diff --git a/home/dot_config/vdirsyncer/executable_config_gen b/home/dot_config/vdirsyncer/executable_config_gen new file mode 100644 index 0000000..bf5d570 --- /dev/null +++ b/home/dot_config/vdirsyncer/executable_config_gen @@ -0,0 +1,111 @@ +#!/bin/sh +CONFIG_FILE="$(dirname "$0")/config.sh" +[ ! -e "$CONFIG_FILE" ] && { + echo "please create $CONFIG_FILE" + exit 1 +} + +VDIRSYNCER_PREFIX="$XDG_DATA_HOME/vdirsyncer" +VDIRSYNCER_STATUS_PATH="$VDIRSYNCER_PREFIX/status" + +# generate a valid storage/pair name from an invalid one +safeify() { echo "$1" | sha1sum | cut -c1-40 ; } +# safeify() { echo "$1" | tr -c '0-9A-Za-z' '_' | sed 's/_\+/_/g' ; } + +[ -z "$EXPORT_LIB" ] && cat << EOF +# THIS FILE IS AUTO-GENERATED AND SHOULD NOT BE SAVED TO DISK!!! Use with +# vdirsyncer by piping the output of this script to a named pipe. + +[general] +status_path = "$VDIRSYNCER_STATUS_PATH" + +EOF + +[ -n "$EXPORT_LIB" ] && _cfg_dav() { true ; } +[ -z "$EXPORT_LIB" ] && _cfg_dav() { + cat << EOF +[pair $ID] +a = "${ID}_local" +b = "${ID}_remote" +collections = ["from a", "from b"] +metadata = ["displayname", "color"] + +[storage ${ID}_local] +type = "filesystem" +path = "$VDIRSYNCER_PREFIX/$ID/" +fileext = "$FILEEXT" + +[storage ${ID}_remote] +type = "$DAV_TYPE" +url = "$BASE_URL" +EOF + [ -n "$USERNAME" ] && echo "username = \"$USERNAME\"" + [ -n "$PASSWORD" ] && echo "password = \"$PASSWORD\"" + + echo # trailing blank line +} + +[ -n "$EXPORT_LIB" ] && _cfg_ical() { true ; } +[ -z "$EXPORT_LIB" ] && _cfg_ical() { + cat << EOF +[pair $ID] +a = "${ID}_remote" +b = "${ID}_local" +collections = null + +[storage ${ID}_local] +type = "filesystem" +path = "$VDIRSYNCER_PREFIX/$ID/" +fileext = ".ics" + +[storage ${ID}_remote] +type = "http" +url = "${URL}" +EOF + + [ -n "$USERNAME" ] && echo "username = \"$USERNAME\"" + [ -n "$PASSWORD" ] && echo "password = \"$PASSWORD\"" + + echo # trailing blank line +} + +ical() { + URL="$1" + USERNAME="$2" # optional + PASSWORD="$3" # optional + + NAME="${NAME-"$(basename "$URL")"}" + ID="$(safeify "$NAME")" + + _cfg_ical +} + +caldav() { DAV_TYPE="caldav" dav "$@" ; } +carddav() { DAV_TYPE="carddav" dav "$@" ; } +dav() { + BASE_URL="$1" + USERNAME="$2" # optional + PASSWORD="$3" # optional + + ID="$(safeify "$(echo "$BASE_URL$DAV_TYPE" | sed -e 's#^https\?://##' -e 's#/.*##')")" + + [ "$DAV_TYPE" = "caldav" ] && FILEEXT=".ics" + [ "$DAV_TYPE" = "carddav" ] && FILEEXT=".vcf" + + # only generate specific DAV config if explicitly defined + if [ -n "$DAV_TYPE" ] ; then + _cfg_dav + return + fi + + # else generate both + caldav "$@" + carddav "$@" +} + +# load "actual" config file +[ -z "$EXPORT_LIB" ] && . "$CONFIG_FILE" + +# make inspecting output easier +[ -z "$EXPORT_LIB" ] && printf '# %s:%s=%s\n' vim ft dosini + diff --git a/home/dot_config/wgetrc.tmpl b/home/dot_config/wgetrc.tmpl new file mode 100644 index 0000000..3d9d4fe --- /dev/null +++ b/home/dot_config/wgetrc.tmpl @@ -0,0 +1 @@ +hsts-file = {{ env "XDG_CACHE_HOME" }}/wget-hsts diff --git a/home/dot_config/winapps/winapps.conf b/home/dot_config/winapps/winapps.conf new file mode 100644 index 0000000..5977f06 --- /dev/null +++ b/home/dot_config/winapps/winapps.conf @@ -0,0 +1,15 @@ +RDP_USER="$(id -un)" +RDP_PASS="$(pass etc/rdpwin)" +VM_NAME="rdpwin" +WAFLAVOR="libvirt" +RDP_SCALE="100" +REMOVABLE_MEDIA="/mnt" +RDP_FLAGS="/cert:ignore /sound /microphone +home-drive -decorations +span /kbd:remap:0x3a=0x1d" +DEBUG="true" +AUTOPAUSE="off" +AUTOPAUSE_TIME="300" +PORT_TIMEOUT="5" +RDP_TIMEOUT="30" +APP_SCAN_TIMEOUT="30" +BOOT_TIMEOUT="0" +HIDEF="off" diff --git a/home/dot_config/wireplumber/wireplumber.conf.d/50-bluez.conf b/home/dot_config/wireplumber/wireplumber.conf.d/50-bluez.conf new file mode 100644 index 0000000..c957f73 --- /dev/null +++ b/home/dot_config/wireplumber/wireplumber.conf.d/50-bluez.conf @@ -0,0 +1,5 @@ +monitor.bluez.properties = { + bluez5.enable-msbc = false + bluez5.enable-cvsd = false + bluez5.default.rate = 96000 +} diff --git a/home/dot_config/wireplumber/wireplumber.conf.d/50-disable-suspend.conf b/home/dot_config/wireplumber/wireplumber.conf.d/50-disable-suspend.conf new file mode 100644 index 0000000..212afe6 --- /dev/null +++ b/home/dot_config/wireplumber/wireplumber.conf.d/50-disable-suspend.conf @@ -0,0 +1,30 @@ +monitor.alsa.rules = [ + { + matches = [ + { node.name = "~alsa_input.*" } + { node.name = "~alsa_output.*" } + ] + actions = { + update-props = { + session.suspend-timeout-seconds = 0 + } + } + } +] + +monitor.bluez.rules = [ + { + matches = [ + { node.name = "~bluez_input.*" } + { node.name = "~bluez_output.*" } + ] + actions = { + update-props = { + audio.format = "S24_3LE" + audio.rate = 96000 + session.suspend-timeout-seconds = 0 + } + } + } +] + diff --git a/home/dot_config/wireplumber/wireplumber.conf.d/50-mpv-fix.conf b/home/dot_config/wireplumber/wireplumber.conf.d/50-mpv-fix.conf new file mode 100644 index 0000000..fa83de5 --- /dev/null +++ b/home/dot_config/wireplumber/wireplumber.conf.d/50-mpv-fix.conf @@ -0,0 +1,14 @@ +# <https://howthefu.cc/posts/04/index.html> +stream.rules = [ + { + matches = [ + { application.name = "mpv" } + ] + actions = { + update-props = { + state.restore-props = false + } + } + } +] + diff --git a/home/dot_config/xbindkeys/main b/home/dot_config/xbindkeys/main new file mode 100644 index 0000000..47a89f6 --- /dev/null +++ b/home/dot_config/xbindkeys/main @@ -0,0 +1,128 @@ +"lock" + Mod4 + Escape +"polybar-msg cmd toggle" + Mod4 + b +"rofi -show drun" + Mod4 + space +"rofi -modes window -show window -kb-accept-entry '!Alt-Tab' -kb-row-down 'Alt+Tab' -kb-row-up 'Alt+ISO_Left_Tab'" + Alt + Tab +"st" + Mod4 + Return +"st -T '[floating]'" + Mod4 + Mod1 + Return +"panic" + Mod4 + Mod1 + p +"rofi-pass" + Mod4 + p +"maim -usb 4 -c 0,0,0 | xclip -selection clipboard -t image/png" + Print +"addtoqueue" + Mod4 + a +"dunstctl close-all" + Mod4 + c + + + +"pactl set-sink-volume @DEFAULT_SINK@ -1%" + Mod1+Mod4+minus +"pactl set-sink-volume @DEFAULT_SINK@ -1%" + XF86AudioLowerVolume +"pactl set-sink-volume @DEFAULT_SINK@ +1%" + Mod1+Mod4+equal +"pactl set-sink-volume @DEFAULT_SINK@ +1%" + XF86AudioRaiseVolume + +"pactl set-sink-mute @DEFAULT_SINK@ toggle" + XF86AudioMute +"pactl set-source-mute @DEFAULT_SOURCE@ toggle" + XF86AudioMicMute + +"brightness -10" + Shift+Mod4 + minus +"brightness -10" + XF86MonBrightnessDown +"brightness +10" + Shift+Mod4 + equal +"brightness +10" + XF86MonBrightnessUp + +"playerctl play-pause" + XF86AudioPlay +"playerctl next" + XF86AudioNext +"playerctl previous" + XF86AudioPrev + +"mpc toggle" + Mod1+Mod4+k +"mpc next" + Mod1+Mod4+l +"mpc prev" + Mod1+Mod4+j + + + +"wacommode topleft" + Mod1 + Control + Mod4 + 1 +"wacommode bottomleft" + Mod1 + Control + Mod4 + 2 +"wacommode topright" + Mod1 + Control + Mod4 + 3 +"wacommode bottomright" + Mod1 + Control + Mod4 + 4 + + + +"i3-msg focus left" + Mod4 + h +"i3-msg focus down" + Mod4 + j +"i3-msg focus up" + Mod4 + k +"i3-msg focus right" + Mod4 + l + +"i3-msg move left" + Mod4 + Shift + h +"i3-msg move down" + Mod4 + Shift + j +"i3-msg move up" + Mod4 + Shift + k +"i3-msg move right" + Mod4 + Shift + l + +"i3-msg move workspace to output left" + Mod1 + Mod4 + Shift + h +"i3-msg move workspace to output down" + Mod1 + Mod4 + Shift + j +"i3-msg move workspace to output up" + Mod1 + Mod4 + Shift + k +"i3-msg move workspace to output right" + Mod1 + Mod4 + Shift + l + +"i3-msg resize grow width 10 px" + Mod4 + period +"i3-msg resize shrink width 10 px" + Mod4 + comma +"i3-msg resize grow height 10 px" + Mod4 + bracketright +"i3-msg resize shrink height 10 px" + Mod4 + bracketleft + +"i3-msg kill" + Mod4 + q + +"i3-msg reload" + Mod4 + Shift + c +"i3-msg restart" + Mod4 + Shift + r + +"fcitx5-remote -s keyboard-us" + XF86Launch5 + Release +"fcitx5-remote -s keyboard-us-intl" + XF86Launch6 + Release +"fcitx5-remote -s mozc" + XF86Launch7 + Release + +"autorandr --change" + XF86Display diff --git a/home/dot_config/xsettingsd/xsettingsd.conf b/home/dot_config/xsettingsd/xsettingsd.conf new file mode 100644 index 0000000..46d4730 --- /dev/null +++ b/home/dot_config/xsettingsd/xsettingsd.conf @@ -0,0 +1,4 @@ +Xft/Hinting 1 +Xft/HintStyle "hintslight" +Xft/Antialias 1 +Xft/RGBA "rgb" diff --git a/home/dot_config/yadm/config b/home/dot_config/yadm/config new file mode 100644 index 0000000..b2f0cbb --- /dev/null +++ b/home/dot_config/yadm/config @@ -0,0 +1,3 @@ +[yadm] + auto-private-dirs = false + auto-alt = false diff --git a/home/dot_config/yadm/executable_bootstrap b/home/dot_config/yadm/executable_bootstrap new file mode 100644 index 0000000..372735d --- /dev/null +++ b/home/dot_config/yadm/executable_bootstrap @@ -0,0 +1,84 @@ +#!/bin/sh + +cd "$(dirname "$0")" +. "$HOME/.profile" +. ./lib/bootstrap + +# never use custom locale in TTY/logs +export LANG=C + +alias s=silent + +# ensure required packages are installed +begintask "installing packages" +"$XDG_CONFIG_HOME/yadm/install-arch" > pkgs.log 2>&1 +endtask +[ $? -eq 0 ] && rm -f pkgs.log || echo " (saved output to pkgs.log)" + +begintask "render templated files" +s yadm alt +endtask + +begintask "ensure dynamic theme files" +s ~/.local/share/bin/mode dark +endtask + +begintask "tidy up repository files" +s yadm reflog expire --expire-unreachable=now --all &&\ +s yadm gc --prune=now +endtask + +# note: vim-plug is already installed system-wide (see ./packages-arch) +begintask "installing vim plugins" +COC_PLUGINS="$(jq --raw-output '.dependencies | keys | join(" ")' \ + "$XDG_CONFIG_HOME/coc/extensions/package.json")" +s nvim --headless +"PlugInstall --sync" +qa &&\ +s nvim --headless +"CocInstall -sync $COC_PLUGINS" +qa +endtask + +[ -e "$HOME/readme.md" ] ||\ +[ $(yadm status -s "$HOME/readme.md" | wc -l) -gt 0 ] && ( + begintask "removing readme.md from home" + cd + rm -f readme.md &&\ + yadm update-index --skip-worktree readme.md + endtask +) + +! command -v st > /dev/null && [ ! -e ~/.local/st ] && ( + begintask "building st (terminal) from source" + mkdir -p ~/.local + cd ~/.local + s git clone --depth 1 https://git.pipeframe.xyz/fork/st + cd st + s make -j + endtask +) + +[ "$(find ~/.ssh -name 'id*' 2>/dev/null | wc -l)" -eq 0 ] && ( + begintask "generating ssh keys" + s ssh-keygen -q -N "" < /dev/zero + endtask +) + +begintask "create XDG user directories" +s xdg-user-dirs-update +endtask + +# TODO: GTK themes +# TODO: OpenZone_Black cursor theme +# TODO: install from scratch and see what's missing + +cat << EOF + +bootstrap finished in $(finishtime)! + +follow-up steps to finish setup: + - install GPG keys + - install nonfree fonts + - clone the pass repository in ~/.local/share/pass + - run the system bootstrap script in ~/.config/yadm/root/bootstrap + - make the switch to microsoft edge + +EOF + diff --git a/home/dot_config/yadm/executable_install-arch b/home/dot_config/yadm/executable_install-arch new file mode 100644 index 0000000..a2ed199 --- /dev/null +++ b/home/dot_config/yadm/executable_install-arch @@ -0,0 +1,12 @@ +#!/bin/sh +# ensure we are running on arch linux +[ ! -e /etc/os-release ] && exit 0 +. /etc/os-release +[ "$ID" != 'arch' ] && exit 0 + +# resolve files in this script relative to this script's location +cd "$(dirname "$0")" + +# filter comments and pipe package name list to yay +sed -e 's/#.*//g' -e 's/ //g' -e '/^$/d' packages-arch | yay --needed -Sy - + diff --git a/home/dot_config/yadm/hooks/executable_post_pull b/home/dot_config/yadm/hooks/executable_post_pull new file mode 100644 index 0000000..c40a06b --- /dev/null +++ b/home/dot_config/yadm/hooks/executable_post_pull @@ -0,0 +1,2 @@ +#!/bin/sh +[ -n "$GPG_ID_PASSWORD_STORE" ] && pass git pull diff --git a/home/dot_config/yadm/lib/bootstrap b/home/dot_config/yadm/lib/bootstrap new file mode 100644 index 0000000..5dafb62 --- /dev/null +++ b/home/dot_config/yadm/lib/bootstrap @@ -0,0 +1,22 @@ +#!/bin/sh +TIMESTART="$(date +%s)" + +begintask() { + printf '%s ...' "$1" +} + +endtask() { + EXIT_CODE=$? + [ $EXIT_CODE -eq 0 ] && echo ' OK' || echo ' ERROR' + return $EXIT_CODE +} + +silent() { + "$@" 1> /dev/null 2> /dev/null +} + +finishtime() { + TIMESTOP="$(date +%s)" + echo "$(( $TIMESTOP - $TIMESTART ))s" +} + diff --git a/home/dot_config/yadm/packages-arch b/home/dot_config/yadm/packages-arch new file mode 100644 index 0000000..b9b9781 --- /dev/null +++ b/home/dot_config/yadm/packages-arch @@ -0,0 +1,125 @@ +# X11 core + window manager +i3-wm +xdg-user-dirs +xf86-input-wacom +xinit-xsession +xorg-server +xorg-xclipboard +xorg-xev +xorg-xhost +xorg-xinit +xorg-xprop +xorg-xrandr +xorg-xrdb +xorg-xset + +# directly used in scripts / startup +augeas +autocutsel +bat +dbus +dunst +fcitx5 +flashfocus +imagemagick +jq +libpulse # for pactl +maim +moreutils +mpd +neovim-remote +nicotine+ +nodejs +pastel +picom +pipewire +playerctl +polkit-gnome +polybar +python +python-pip +python-pipx +redshift +rofi +xbanish +xbindkeys +xclip +xorg-xrdb +xsettingsd + +# system stuff +cups +lightdm +lightdm-gtk-greeter +ntfs-3g +ntp +openssh +openssl +sshfs +usb_modeswitch # required for android usb tethering +networkmanager + +# applications +anki-bin +brave-bin +curl +feh +fzf +gnupg +helvum +htop +khal +mpc +mpv +ncmpcpp +neovim +nmap +pam-gnupg +pandoc +pass +pass-otp +pavucontrol +pinentry +qt5-tools +ranger +restic +rofi-pass-git +scrcpy +scrot +slock +sudo +sxiv +unarchiver +unzip +vdirsyncer +vim-plug +wget +which +zathura +zathura-pdf-mupdf +zip +zsh + +# audio +alsa-lib +alsa-plugins +alsa-utils +libpipewire +libpulse +pipewire +pipewire-alsa +pipewire-audio +pipewire-jack +pipewire-pulse + +# bluetooth +bluez +bluez-utils + +# fonts +inter-font # Inter (default sans serif) +texlive-fontsrecommended # TeX Gyre Schola + Math (default serif) +ttf-jetbrains-mono # JetBrains Mono (monospace in documents) +ttf-jetbrains-mono-nerd # JetBrains Mono Nerd Font (default monospace) +ttf-times-new-roman # Times New Roman (instead of ugly liberation serif) + diff --git a/home/dot_config/yadm/root/etc/NetworkManager/dispatcher.d/executable_70-auto-wifi.sh b/home/dot_config/yadm/root/etc/NetworkManager/dispatcher.d/executable_70-auto-wifi.sh new file mode 100644 index 0000000..4680626 --- /dev/null +++ b/home/dot_config/yadm/root/etc/NetworkManager/dispatcher.d/executable_70-auto-wifi.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +export LANG=C + +interface="$1" +action="$2" + +connectivity="$(nmcli networking connectivity)" +interface_type="$(nmcli -g GENERAL.TYPE device show "$interface")" +interface_state="$(nmcli -g GENERAL.STATE device show "$interface" | grep -o '^[0-9]\+')" + +if [ "$action" = "down" ] && [ "$connectivity" = "none" ]; then + nmcli radio wifi on + exit +fi + +if [ "$action" = "up" ] && [ "$interface_type" == "ethernet" ] && [ "$interface_state" = "100" ]; then + nmcli radio wifi off + exit +fi + diff --git a/home/dot_config/yadm/root/etc/X11/xorg.conf.d/00-keyboard.conf b/home/dot_config/yadm/root/etc/X11/xorg.conf.d/00-keyboard.conf new file mode 100644 index 0000000..d4f95ff --- /dev/null +++ b/home/dot_config/yadm/root/etc/X11/xorg.conf.d/00-keyboard.conf @@ -0,0 +1,9 @@ +Section "InputClass" + Identifier "system-keyboard" + MatchIsKeyboard "on" + Option "XkbLayout" "us" + Option "XkbModel" "pc105" + Option "XkbOptions" "ctrl:nocaps" + Option "AutoRepeat" "250 40" +EndSection + diff --git a/home/dot_config/yadm/root/etc/X11/xorg.conf.d/40-trackpad.conf b/home/dot_config/yadm/root/etc/X11/xorg.conf.d/40-trackpad.conf new file mode 100644 index 0000000..f390b93 --- /dev/null +++ b/home/dot_config/yadm/root/etc/X11/xorg.conf.d/40-trackpad.conf @@ -0,0 +1,9 @@ +Section "InputClass" + Identifier "Trackpad preferences" + MatchIsTouchpad "on" + Driver "libinput" + Option "NaturalScrolling" "1" + Option "Tapping" "1" + Option "ScrollPixelDistance" "40" +EndSection + diff --git a/home/dot_config/yadm/root/etc/X11/xorg.conf.d/50-mouse-acceleration.conf b/home/dot_config/yadm/root/etc/X11/xorg.conf.d/50-mouse-acceleration.conf new file mode 100644 index 0000000..199635d --- /dev/null +++ b/home/dot_config/yadm/root/etc/X11/xorg.conf.d/50-mouse-acceleration.conf @@ -0,0 +1,8 @@ +Section "InputClass" + Identifier "default mouse acceleration" + Driver "libinput" + MatchIsPointer "yes" + Option "AccelProfile" "flat" + Option "AccelSpeed" "0" +EndSection + diff --git a/home/dot_config/yadm/root/etc/X11/xorg.conf.d/72-wacom-options.conf b/home/dot_config/yadm/root/etc/X11/xorg.conf.d/72-wacom-options.conf new file mode 100644 index 0000000..81aaf60 --- /dev/null +++ b/home/dot_config/yadm/root/etc/X11/xorg.conf.d/72-wacom-options.conf @@ -0,0 +1,11 @@ +Section "InputClass" + Identifier "default wacom pen area + double click interval" + MatchDriver "wacom" + MatchProduct "Pen" + NoMatchProduct "eraser" + NoMatchProduct "cursor" + Option "Area" "0 0 15200 4275" + Option "MapToOutput" "1920x1080+0+0" + Option "TapTime" "100" +EndSection + diff --git a/home/dot_config/yadm/root/etc/X11/xorg.conf.d/90-libinput-logitech.conf b/home/dot_config/yadm/root/etc/X11/xorg.conf.d/90-libinput-logitech.conf new file mode 100644 index 0000000..a1071b0 --- /dev/null +++ b/home/dot_config/yadm/root/etc/X11/xorg.conf.d/90-libinput-logitech.conf @@ -0,0 +1,8 @@ +Section "InputClass" + Identifier "Logitech MX Master 3S High res scrolling" + MatchUSBID "046d:c548" + MatchDevicePath "/dev/input/event*" + Driver "libinput" + Option "HighResolutionWheelScrolling" "false" +EndSection + diff --git a/home/dot_config/yadm/root/etc/X11/xorg.conf.d/90-libinput-wacom.conf b/home/dot_config/yadm/root/etc/X11/xorg.conf.d/90-libinput-wacom.conf new file mode 100644 index 0000000..26643b8 --- /dev/null +++ b/home/dot_config/yadm/root/etc/X11/xorg.conf.d/90-libinput-wacom.conf @@ -0,0 +1,9 @@ +Section "InputClass" + Identifier "force libinput as driver for wacom tablet touchpad" + MatchUSBID "056a:*" + MatchDevicePath "/dev/input/event*" + MatchIsTouchpad "true" + Driver "libinput" + Option "NaturalScrolling" "true" +EndSection + diff --git a/home/dot_config/yadm/root/etc/X11/xorg.conf.d/90-wacom-overrides.conf b/home/dot_config/yadm/root/etc/X11/xorg.conf.d/90-wacom-overrides.conf new file mode 100644 index 0000000..f2e2bbf --- /dev/null +++ b/home/dot_config/yadm/root/etc/X11/xorg.conf.d/90-wacom-overrides.conf @@ -0,0 +1,7 @@ +Section "InputClass" + Identifier "Wacom Tablet Overrides" + MatchDriver "wacom" + Option "AccelerationProfile" "5" + Option "ConstantDeceleration" "2" + Option "AdaptiveDeceleration" "3" +EndSection diff --git a/home/dot_config/yadm/root/etc/containers/empty_nodocker b/home/dot_config/yadm/root/etc/containers/empty_nodocker new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/home/dot_config/yadm/root/etc/containers/empty_nodocker diff --git a/home/dot_config/yadm/root/etc/default/earlyoom b/home/dot_config/yadm/root/etc/default/earlyoom new file mode 100644 index 0000000..53ddf8b --- /dev/null +++ b/home/dot_config/yadm/root/etc/default/earlyoom @@ -0,0 +1 @@ +EARLYOOM_ARGS="-M 102400 -r 3600 -n --avoid '(^|/)(init|systemd|Xorg|sshd)$'" diff --git a/home/dot_config/yadm/root/etc/kernel/cmdline b/home/dot_config/yadm/root/etc/kernel/cmdline new file mode 100644 index 0000000..2448b2c --- /dev/null +++ b/home/dot_config/yadm/root/etc/kernel/cmdline @@ -0,0 +1 @@ +quiet diff --git a/home/dot_config/yadm/root/etc/libinput/local-overrides.quirks b/home/dot_config/yadm/root/etc/libinput/local-overrides.quirks new file mode 100644 index 0000000..9a897c2 --- /dev/null +++ b/home/dot_config/yadm/root/etc/libinput/local-overrides.quirks @@ -0,0 +1,4 @@ +[Logitech MX Master 3S] +MatchVendor=0x046D +MatchProduct=0xC548 +AttrEventCode=-REL_WHEEL_HI_RES;-REL_HWHEEL_HI_RES; diff --git a/home/dot_config/yadm/root/etc/lightdm/executable_autorandr-change b/home/dot_config/yadm/root/etc/lightdm/executable_autorandr-change new file mode 100644 index 0000000..f181fe8 --- /dev/null +++ b/home/dot_config/yadm/root/etc/lightdm/executable_autorandr-change @@ -0,0 +1,5 @@ +#!/bin/sh +autorandr --change + +# make sure this script exits happily +exit 0 diff --git a/home/dot_config/yadm/root/etc/lightdm/lightdm-gtk-greeter.conf b/home/dot_config/yadm/root/etc/lightdm/lightdm-gtk-greeter.conf new file mode 100644 index 0000000..7ba729d --- /dev/null +++ b/home/dot_config/yadm/root/etc/lightdm/lightdm-gtk-greeter.conf @@ -0,0 +1,8 @@ +[greeter] +font-name = Inter 9 +theme-name = adw-gtk3-dark +indicators = ~clock;~spacer;~power +hide-user-image = true +screensaver-timeout = 15 +default-session = xinitrc +clock-format = %t%H:%M diff --git a/home/dot_config/yadm/root/etc/locale.conf b/home/dot_config/yadm/root/etc/locale.conf new file mode 100644 index 0000000..abfaa52 --- /dev/null +++ b/home/dot_config/yadm/root/etc/locale.conf @@ -0,0 +1,2 @@ +LANG=en_US.UTF-8 +LC_COLLATE=C diff --git a/home/dot_config/yadm/root/etc/locale.gen b/home/dot_config/yadm/root/etc/locale.gen new file mode 100644 index 0000000..6ab95e3 --- /dev/null +++ b/home/dot_config/yadm/root/etc/locale.gen @@ -0,0 +1,3 @@ +en_US.UTF-8 UTF-8 +ja_JP.UTF-8 UTF-8 +nl_NL.UTF-8 UTF-8 diff --git a/home/dot_config/yadm/root/etc/logid.cfg b/home/dot_config/yadm/root/etc/logid.cfg new file mode 100644 index 0000000..e98e048 --- /dev/null +++ b/home/dot_config/yadm/root/etc/logid.cfg @@ -0,0 +1,13 @@ +devices: ({ + name: "MX Master 3S"; + smartshift: { + on: true; + threshold: 255; + torque: 255; + }; + hiresscroll: { + hires: false; + invert: false; + target: false; + }; +}); diff --git a/home/dot_config/yadm/root/etc/sudoers.d/10-wheel-nopasswd b/home/dot_config/yadm/root/etc/sudoers.d/10-wheel-nopasswd new file mode 100644 index 0000000..46208d6 --- /dev/null +++ b/home/dot_config/yadm/root/etc/sudoers.d/10-wheel-nopasswd @@ -0,0 +1,4 @@ +# allow all users in `wheel` group to use sudo for all commands without prompt +# for password +%wheel ALL=(ALL) NOPASSWD: ALL + diff --git a/home/dot_config/yadm/root/etc/systemd/logind.conf.d/10-laptop-lid.conf b/home/dot_config/yadm/root/etc/systemd/logind.conf.d/10-laptop-lid.conf new file mode 100644 index 0000000..c289779 --- /dev/null +++ b/home/dot_config/yadm/root/etc/systemd/logind.conf.d/10-laptop-lid.conf @@ -0,0 +1,4 @@ +[Login] +HandleLidSwitch=suspend +HandleLidSwitchExternalPower=ignore +HandleLidSwitchDocked=ignore diff --git a/home/dot_config/yadm/root/etc/udev/hwdb.d/71-logitech-mx3.hwdb b/home/dot_config/yadm/root/etc/udev/hwdb.d/71-logitech-mx3.hwdb new file mode 100644 index 0000000..3ccaa11 --- /dev/null +++ b/home/dot_config/yadm/root/etc/udev/hwdb.d/71-logitech-mx3.hwdb @@ -0,0 +1,3 @@ +mouse:usb:v046dpc548:name:Logitech USB Receiver Mouse:* + MOUSE_WHEEL_CLICK_ANGLE=1 + MOUSE_WHEEL_CLICK_COUNT=360 diff --git a/home/dot_config/yadm/root/etc/udev/rules.d/90-backlight.rules b/home/dot_config/yadm/root/etc/udev/rules.d/90-backlight.rules new file mode 100644 index 0000000..23eedf8 --- /dev/null +++ b/home/dot_config/yadm/root/etc/udev/rules.d/90-backlight.rules @@ -0,0 +1 @@ +SUBSYSTEM=="backlight", ACTION=="add", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness" diff --git a/home/dot_config/yadm/root/etc/udev/rules.d/99-capture-card.rules b/home/dot_config/yadm/root/etc/udev/rules.d/99-capture-card.rules new file mode 100644 index 0000000..b180639 --- /dev/null +++ b/home/dot_config/yadm/root/etc/udev/rules.d/99-capture-card.rules @@ -0,0 +1,3 @@ +# set video controls +SUBSYSTEM=="video4linux", KERNEL=="video[0-9]*", ATTR{index}=="0", ATTRS{idVendor}=="534d", ATTRS{idProduct}=="2109", RUN+="/usr/bin/v4l2-ctl -d $devnode --set-ctrl=brightness=0,contrast=127,saturation=127,hue=0" + diff --git a/home/dot_config/yadm/root/etc/xdg/nvim/init.vim b/home/dot_config/yadm/root/etc/xdg/nvim/init.vim new file mode 100644 index 0000000..f238fc6 --- /dev/null +++ b/home/dot_config/yadm/root/etc/xdg/nvim/init.vim @@ -0,0 +1,2 @@ +set notermguicolors +colorscheme vim diff --git a/home/dot_config/yadm/root/executable_bootstrap b/home/dot_config/yadm/root/executable_bootstrap new file mode 100644 index 0000000..f8b59fb --- /dev/null +++ b/home/dot_config/yadm/root/executable_bootstrap @@ -0,0 +1,95 @@ +#!/bin/sh +cd "$(dirname "$0")" +. ../lib/bootstrap + +# never use custom locale in TTY/logs +export LANG=C + +alias s=silent + + +wrong_call() { + cat << EOF +run this script as root and with the username of your user account + +examples: + $ sudo $0 loek + + $ sudo $0 "\$LOGNAME" + + # $0 gert +EOF + exit 1 +} + +# this script needs to run with root privileges +[ $(id -u) -ne 0 ] && wrong_call +# SETUP_USER must exist +SETUP_USER="$1" +s getent passwd "$SETUP_USER" || wrong_call +# SETUP_USER can not be root +[ $(id -u "$SETUP_USER") -eq 0 ] && wrong_call + +begintask "copy system config files" +s cp -r --preserve=mode,timestamps etc/. /etc +endtask + +PINENTRY="pinentry-gnome3" +[ "$(command -v pinentry | xargs realpath | xargs basename)" != "$PINENTRY" ] && ( + begintask "set pinentry program to $PINENTRY" + s ln -sf "$PINENTRY" "$(command -v pinentry)" + endtask +) + +begintask "enabling services" +s systemctl enable bluetooth ntpd cups +endtask + +GROUPS_OK=1 +CURRENT_GROUPS="$(id -Gn "$SETUP_USER")" +TARGET_GROUPS="users uucp optical lp audio wheel input" +for group in $TARGET_GROUPS ; do + if ! echo "$CURRENT_GROUPS" | s grep "$group" ; then + GROUPS_OK=0 + break + fi +done +[ "$GROUPS_OK" -ne 1 ] && ( + begintask "adding $SETUP_USER to groups" + s usermod -aG "$(echo "$TARGET_GROUPS" | tr ' ' ',')" "$SETUP_USER" + endtask +) + +PAM_GNUPG_FILE="/etc/pam.d/system-login" +! s grep 'pam_gnupg' "$PAM_GNUPG_FILE" && ( + begintask "adding pam-gnupg PAM module" + cat << EOF >> "$PAM_GNUPG_FILE" + +# https://github.com/cruegge/pam-gnupg +auth optional pam_gnupg.so store-only +session optional pam_gnupg.so +EOF + endtask +) + +s grep '^#\s*\<Color\>' /etc/pacman.conf && ( + begintask "enabling color in /etc/pacman.conf" + s sed 's/^#\s*\(\<Color\>\)/\1/g' -i /etc/pacman.conf + endtask +) + +begintask "set autorandr to run at lightdm display startup" +s augtool set '/files/etc/lightdm/lightdm.conf/Seat:*/display-setup-script' '/etc/lightdm/autorandr-change' +endtask + +[ "$(getent passwd "$SETUP_USER" | cut -d: -f7 | xargs basename)" != "zsh" ] && ( + begintask "set user shell to zsh" + s chsh -s "$(command -v zsh)" "$SETUP_USER" + endtask +) + +cat << EOF + +root bootstrap finished in $(finishtime)! + +EOF diff --git a/home/dot_config/zathura/zathurarc b/home/dot_config/zathura/zathurarc new file mode 100644 index 0000000..89ae535 --- /dev/null +++ b/home/dot_config/zathura/zathurarc @@ -0,0 +1,16 @@ +set scroll-page-aware true +set scroll-full-overlap 0.01 +set scroll-step 100 +set selection-clipboard clipboard + +# recolor (dark mode) +map <C-i> recolor +set recolor true + +set recolor-reverse-video true +set recolor-keephue true +set guioptions "" +set show-recent false + +include ./colors + diff --git a/home/dot_local/share/Anki2/addons21/308574457/user_files/BottomBar.css b/home/dot_local/share/Anki2/addons21/308574457/user_files/BottomBar.css new file mode 100644 index 0000000..5e3dc77 --- /dev/null +++ b/home/dot_local/share/Anki2/addons21/308574457/user_files/BottomBar.css @@ -0,0 +1,7 @@ +#outer { + padding-top: 2px; + border: none; +} + +center#outer ~ div { display: none; } + diff --git a/home/dot_local/share/Anki2/addons21/308574457/user_files/DeckBrowser.css b/home/dot_local/share/Anki2/addons21/308574457/user_files/DeckBrowser.css new file mode 100644 index 0000000..79b8e39 --- /dev/null +++ b/home/dot_local/share/Anki2/addons21/308574457/user_files/DeckBrowser.css @@ -0,0 +1,5 @@ +tr.deck td { + --border-subtle: var(--canvas-inset); + border-bottom: none; +} + diff --git a/home/dot_local/share/Anki2/addons21/308574457/user_files/Editor.css b/home/dot_local/share/Anki2/addons21/308574457/user_files/Editor.css new file mode 100644 index 0000000..c826858 --- /dev/null +++ b/home/dot_local/share/Anki2/addons21/308574457/user_files/Editor.css @@ -0,0 +1,20 @@ +body +{ background-color: var(--canvas); } + +.rich-text-input, +.tag-editor +{ padding: 0.5ex !important; } + +body +{ font-size: 10pt !important; } + +anki-editable { background-color: #ff00ff; } + +.editor-field +{ border-color: var(--canvas-inset) !important; } + +.tag-editor { + border: none !important; + margin: 0 !important; +} + diff --git a/home/dot_local/share/Anki2/addons21/308574457/user_files/TopToolbar.css b/home/dot_local/share/Anki2/addons21/308574457/user_files/TopToolbar.css new file mode 100644 index 0000000..7a3eeeb --- /dev/null +++ b/home/dot_local/share/Anki2/addons21/308574457/user_files/TopToolbar.css @@ -0,0 +1,2 @@ +body .header { border-bottom: none !important; } + diff --git a/home/dot_local/share/Anki2/addons21/308574457/user_files/empty_CardLayout.css b/home/dot_local/share/Anki2/addons21/308574457/user_files/empty_CardLayout.css new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/home/dot_local/share/Anki2/addons21/308574457/user_files/empty_CardLayout.css diff --git a/home/dot_local/share/Anki2/addons21/308574457/user_files/empty_Overview.css b/home/dot_local/share/Anki2/addons21/308574457/user_files/empty_Overview.css new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/home/dot_local/share/Anki2/addons21/308574457/user_files/empty_Overview.css diff --git a/home/dot_local/share/Anki2/addons21/308574457/user_files/empty_Reviewer.css b/home/dot_local/share/Anki2/addons21/308574457/user_files/empty_Reviewer.css new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/home/dot_local/share/Anki2/addons21/308574457/user_files/empty_Reviewer.css diff --git a/home/dot_local/share/Anki2/addons21/308574457/user_files/empty_ReviewerBottomBar.css b/home/dot_local/share/Anki2/addons21/308574457/user_files/empty_ReviewerBottomBar.css new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/home/dot_local/share/Anki2/addons21/308574457/user_files/empty_ReviewerBottomBar.css diff --git a/home/dot_local/share/Anki2/addons21/308574457/user_files/empty_legacy.css b/home/dot_local/share/Anki2/addons21/308574457/user_files/empty_legacy.css new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/home/dot_local/share/Anki2/addons21/308574457/user_files/empty_legacy.css diff --git a/home/dot_local/share/Anki2/addons21/308574457/user_files/global.css b/home/dot_local/share/Anki2/addons21/308574457/user_files/global.css new file mode 100644 index 0000000..a30eb51 --- /dev/null +++ b/home/dot_local/share/Anki2/addons21/308574457/user_files/global.css @@ -0,0 +1,2 @@ +button { border: none !important; } + diff --git a/home/dot_local/share/Anki2/addons21/mode/__init__.py b/home/dot_local/share/Anki2/addons21/mode/__init__.py new file mode 100644 index 0000000..78d0d58 --- /dev/null +++ b/home/dot_local/share/Anki2/addons21/mode/__init__.py @@ -0,0 +1,18 @@ +#!/bin/python3 +from aqt import mw +from aqt.utils import tr +from aqt.theme import Theme +from os import environ +from pathlib import Path + +THEME_DARK = 2 +THEME_LIGHT = 1 + +path = Path(environ['XDG_CACHE_HOME'], 'mode/state/mode') +with path.open() as file: + mode = file.read().strip() + if mode == "dark": + mw.set_theme(Theme(THEME_DARK)) + if mode == "light": + mw.set_theme(Theme(THEME_LIGHT)) + diff --git a/home/dot_local/share/Anki2/gldriver6 b/home/dot_local/share/Anki2/gldriver6 new file mode 100644 index 0000000..865faf1 --- /dev/null +++ b/home/dot_local/share/Anki2/gldriver6 @@ -0,0 +1 @@ +auto diff --git a/home/dot_local/share/applications/addtorrent.desktop b/home/dot_local/share/applications/addtorrent.desktop new file mode 100644 index 0000000..fe590d6 --- /dev/null +++ b/home/dot_local/share/applications/addtorrent.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=addtorrent +Name[ja]=トレントを追加 +Exec=addtorrent %U +Type=Application +Hidden=true +MimeType=application/x-bittorrent;x-scheme-handler/magnet; + diff --git a/home/dot_local/share/applications/discord.desktop b/home/dot_local/share/applications/discord.desktop new file mode 100644 index 0000000..403a457 --- /dev/null +++ b/home/dot_local/share/applications/discord.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Discord +StartupWMClass=discord +Comment=All-in-one voice and text chat for gamers that's free, secure, and works on both your desktop and phone. +GenericName=Internet Messenger +Exec=discord +Icon=discord +Type=Application +Categories=Network;InstantMessaging; +MimeType=x-scheme-handler/betterdiscord; diff --git a/home/dot_local/share/applications/mozc-dictionary.desktop b/home/dot_local/share/applications/mozc-dictionary.desktop new file mode 100644 index 0000000..c4f6193 --- /dev/null +++ b/home/dot_local/share/applications/mozc-dictionary.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Mozc dictionary tool +Name[ja]=Mozc 辞書ツール +Name[nl]=Mozc woordenboekhulpprogramma +GenericName[ja]=日本語入力の辞書ツール +GenericName[nl]=Hulpprogramma voor woordenboek van Japanse invoer +GenericName=Japanese input method dictionary tool +Exec=/usr/lib/mozc/mozc_tool --mode=dictionary_tool +Icon=mozc +Type=Application +Categories=Settings; diff --git a/home/dot_local/share/applications/mozc-settings.desktop b/home/dot_local/share/applications/mozc-settings.desktop new file mode 100644 index 0000000..bcfde2d --- /dev/null +++ b/home/dot_local/share/applications/mozc-settings.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Mozc settings +Name[ja]=Mozc プロパティ +Name[nl]=Mozc instellingen +GenericName[ja]=日本語入力の設定 +GenericName[nl]=Instellingen voor Japanse invoermethode +GenericName=Japanese IME configuration +Exec=/usr/lib/mozc/mozc_tool --mode=config_dialog +Icon=mozc +Type=Application +Categories=Settings; diff --git a/home/dot_local/share/bin/executable_16 b/home/dot_local/share/bin/executable_16 new file mode 100644 index 0000000..f8cc49f --- /dev/null +++ b/home/dot_local/share/bin/executable_16 @@ -0,0 +1,3 @@ +#!/bin/sh +python3 -c 'import sys ; print(f"{int(sys.stdin.read().strip()):x}")' + diff --git a/home/dot_local/share/bin/executable_= b/home/dot_local/share/bin/executable_= new file mode 100644 index 0000000..5e69f91 --- /dev/null +++ b/home/dot_local/share/bin/executable_= @@ -0,0 +1,45 @@ +#!/bin/python3 -- +from sys import argv as _argv +from os import environ as _environ, path as _path +from math import * + +_ans_path = _path.join(_environ["XDG_CACHE_HOME"], "calc_ans") +try: + _ans_file = open(_ans_path, "r+") +except: + _ans_file = open(_ans_path, "w+") +_exit_code = 0 + +ans = 0 +try: + _ans_str = _ans_file.read() + if "." in _ans_str: + ans = float(_ans_str) + else: + ans = int(_ans_str) +except: + pass + +deg = pi / 180 + +MIN = min +MAX = max +BIT = lambda n: 1 << n +GENMASK = lambda h, l: (BIT(MAX(h, l) + 1) - 1) ^ (BIT(MIN(h, l)) - 1) +KB = lambda x: x << 10 +MB = lambda x: x << 20 +GB = lambda x: x << 30 + +try: + ans = eval(" ".join(_argv[1:])) + print(ans) +except: + pass + +_ans_file.truncate(0) +_ans_file.seek(0) +_ans_file.write(str(ans)) +_ans_file.close() + +exit(_exit_code) + diff --git a/home/dot_local/share/bin/executable_addtoqueue b/home/dot_local/share/bin/executable_addtoqueue new file mode 100644 index 0000000..535e250 --- /dev/null +++ b/home/dot_local/share/bin/executable_addtoqueue @@ -0,0 +1,3 @@ +#!/bin/sh +exec st -T "[floating]" -g 120x20 -e fzmp + diff --git a/home/dot_local/share/bin/executable_addtorrent b/home/dot_local/share/bin/executable_addtorrent new file mode 100644 index 0000000..bf238d6 --- /dev/null +++ b/home/dot_local/share/bin/executable_addtorrent @@ -0,0 +1,41 @@ +#!/bin/sh +progname="$(basename "$0")" + +title="Torrent" +msg_ok="Torrent successfully added" +msg_err="Could not add torrent" +usage="usage: $progname URL" +err_no_seedbox="error: \$SEEDBOX_LOGIN is not set" + +case "$LANG" in + ja_JP*) + title="トレント" + msg_ok="一つのトレントを追加しました" + msg_err="トレントを追加できませんでした" + usage="用法: $progname URL" + err_no_seedbox="エラー: \$SEEDBOX_LOGINに値がありません" + ;; +esac + +die() { + echo "$1" + exit 1 +} + +[ $# -eq 0 ] && die "$usage" +[ -z "$SEEDBOX_LOGIN" ] && die "$err_no_seedbox" + +ssh "$SEEDBOX_LOGIN" transmission-remote -a "'$(echo "$1" | sed "s/'/'\\''/g")'" +if [ $? -eq 0 ]; then + msg="$msg_ok" + urgency="normal" +else + msg="$msg_err" + urgency="critical" +fi + +notify-send \ + --app-name "$title" \ + --urgency "$urgency" \ + "$title" "$msg" + diff --git a/home/dot_local/share/bin/executable_androidwifistore2pass b/home/dot_local/share/bin/executable_androidwifistore2pass new file mode 100644 index 0000000..b03eb9d --- /dev/null +++ b/home/dot_local/share/bin/executable_androidwifistore2pass @@ -0,0 +1,43 @@ +#!/bin/sh +# Use xmlstarlet and ADB to pull WifiConfigStore.xml from a (rooted) Android +# phone and import wifi network passwords into pass. Tested with a rooted pixel +# 4a (sunfish) running LineageOS 21 (Android 14) + +TAB="$(printf '\t')" + +get_wifi_cfg() { + adb shell cat /data/misc/apexdata/com.android.wifi/WifiConfigStore.xml + if [ $? -ne 0 ] ; then + echo "note: try running \`adb root\` first" + exit 1 + fi +} + +parse_filter() { + xmlstarlet select --template \ + --match '/WifiConfigStoreData/NetworkList/Network' \ + --if './WifiConfiguration/string[@name="PreSharedKey"]' \ + --value-of './WifiConfiguration/string[@name="SSID"]' \ + --output "$TAB" \ + --value-of './WifiConfiguration/string[@name="PreSharedKey"]' \ + --nl +} + +cut_quotes() { + cut -c2- | rev | cut -c2- | rev +} + +import_pass() { + while read line; do + SSID="$(echo "$line" | cut -d"$TAB" -f1 | cut_quotes)" + PASSWD="$(echo "$line" | cut -d"$TAB" -f2 | cut_quotes)" + PASS_NAME="net/$(echo "$SSID" | tr '/' '-')/passwd" + + printf 'insert SSID "%s" as %s ...' "$SSID" "$PASS_NAME" + echo "$PASSWD" | pass insert --multiline "$PASS_NAME" 1>/dev/null 2>/dev/null + printf ' %s\n' "$([ $? -eq 0 ] && echo "OK" || echo "ERROR")" + done +} + +get_wifi_cfg | parse_filter | import_pass + diff --git a/home/dot_local/share/bin/executable_ansi2polybar b/home/dot_local/share/bin/executable_ansi2polybar new file mode 100644 index 0000000..e543ce5 --- /dev/null +++ b/home/dot_local/share/bin/executable_ansi2polybar @@ -0,0 +1,67 @@ +#!/bin/sh +# convert ansi escape codes into polybar/lemonbar color tags. this script makes +# some very dumb assumptions about which escape codes will be in the input +# stream, and is by no means complete, just good enough + +. "$XDG_CACHE_HOME/mode/state/theme" +export bg fg $(seq 0 15 | sed 's/^/color/') + +exec gawk ' +function flush_buffer() { + switch (buf) { + case 0: printf "%{T-}%{F-}%{B-}%{u-}%{o-}" ; break + case 1: printf "%{T2}" ; break + case 30: printf "%{F" ENVIRON["color0"] "}" ; break + case 31: printf "%{F" ENVIRON["color1"] "}" ; break + case 32: printf "%{F" ENVIRON["color2"] "}" ; break + case 33: printf "%{F" ENVIRON["color3"] "}" ; break + case 34: printf "%{F" ENVIRON["color4"] "}" ; break + case 35: printf "%{F" ENVIRON["color5"] "}" ; break + case 36: printf "%{F" ENVIRON["color6"] "}" ; break + case 37: printf "%{F" ENVIRON["color7"] "}" ; break + case 90: printf "%{F" ENVIRON["color8"] "}" ; break + case 91: printf "%{F" ENVIRON["color9"] "}" ; break + case 92: printf "%{F" ENVIRON["color10"] "}" ; break + case 93: printf "%{F" ENVIRON["color11"] "}" ; break + case 94: printf "%{F" ENVIRON["color12"] "}" ; break + case 95: printf "%{F" ENVIRON["color13"] "}" ; break + case 96: printf "%{F" ENVIRON["color14"] "}" ; break + case 97: printf "%{F" ENVIRON["color15"] "}" ; break + default: break + } + buf = "" +} +function reset() { + bold = 0 + buf = "" + esc = 0 +} +BEGIN { + RS = "(.)" # make awk read character by character + reset() +} +# start of escape code +esc == 0 && RT == "\x1b" { esc += 1 } + +# ignore some characters for buffering +esc > 0 && RT == "\x1b" { next } +esc > 0 && RT == "[" { next } + +esc > 0 && RT == ";" { + flush_buffer() + next +} + +# end of escape code +esc > 0 && RT == "m" { + flush_buffer() + reset() + next +} + +esc > 0 { buf = buf RT } + +# print while not reading escape code +esc == 0 { printf RT } +' + diff --git a/home/dot_local/share/bin/executable_bgcol b/home/dot_local/share/bin/executable_bgcol new file mode 100644 index 0000000..276e479 --- /dev/null +++ b/home/dot_local/share/bin/executable_bgcol @@ -0,0 +1,9 @@ +#!/bin/sh +COLOR="$1" +if [ -z "$COLOR" ] ; then + . "$XDG_CACHE_HOME/mode/state/theme" + COLOR="$bg" +fi +magick -size 1x1 "xc:$COLOR" /tmp/bgcol.png +feh --no-fehbg --bg-tile /tmp/bgcol.png +rm /tmp/bgcol.png diff --git a/home/dot_local/share/bin/executable_bootloader b/home/dot_local/share/bin/executable_bootloader new file mode 100644 index 0000000..c310d4f --- /dev/null +++ b/home/dot_local/share/bin/executable_bootloader @@ -0,0 +1,13 @@ +#!/bin/sh + +bye () { + echo "run me as root!" + exit 1 +} + +[ $(id -g) -ne 0 ] && bye + +# mount /boot +# pacman --noconfirm -S linux +grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB # --removable +grub-mkconfig -o /boot/grub/grub.cfg diff --git a/home/dot_local/share/bin/executable_brightness b/home/dot_local/share/bin/executable_brightness new file mode 100644 index 0000000..c1c6139 --- /dev/null +++ b/home/dot_local/share/bin/executable_brightness @@ -0,0 +1,29 @@ +#!/bin/sh +case "$*" in + +*) action="+" ;; + -*) action="-" ;; + *) action="=" ;; +esac +value="$(echo "$*" | tr -dc '[[:digit:]]')" + +if [ -n "$(command -v xbacklight)" ] ; then + [ "$action" = "+" ] && action="-inc" + [ "$action" = "-" ] && action="-dec" + [ "$action" = "=" ] && action="-set" + + fork xbacklight -time 100 -fps 60 $action $value + + exit 0 + +elif [ -n "$(command -v ddcutil)" ] ; then + [ "$action" = "=" ] && action="" + + for bus in 2 3 ; do + fork ddcutil --bus="$bus" --skip-ddc-checks --noverify setvcp 10 $action $value + done + + exit 0 + +fi +exit 1 + diff --git a/home/dot_local/share/bin/executable_caffeine b/home/dot_local/share/bin/executable_caffeine new file mode 100644 index 0000000..9901426 --- /dev/null +++ b/home/dot_local/share/bin/executable_caffeine @@ -0,0 +1,8 @@ +#!/bin/sh +xset s off -dpms +reset() { + trap - EXIT + xset s default +} +trap reset INT +sleep infinity diff --git a/home/dot_local/share/bin/executable_cc1080p30 b/home/dot_local/share/bin/executable_cc1080p30 new file mode 100644 index 0000000..6619a17 --- /dev/null +++ b/home/dot_local/share/bin/executable_cc1080p30 @@ -0,0 +1,2 @@ +#!/bin/sh +ccpreview 1920 1080 30 diff --git a/home/dot_local/share/bin/executable_cc720p60 b/home/dot_local/share/bin/executable_cc720p60 new file mode 100644 index 0000000..c78fe6d --- /dev/null +++ b/home/dot_local/share/bin/executable_cc720p60 @@ -0,0 +1,2 @@ +#!/bin/sh +ccpreview 1280 720 60 diff --git a/home/dot_local/share/bin/executable_ccpreview b/home/dot_local/share/bin/executable_ccpreview new file mode 100644 index 0000000..9f13acc --- /dev/null +++ b/home/dot_local/share/bin/executable_ccpreview @@ -0,0 +1,74 @@ +#!/bin/sh + +# capture card sysfs device path +SYSFS_PATH="/devices/pci0000:00/0000:00:14.0/usb1/1-12" + +# script args +WIDTH="$1" +HEIGHT="$2" +FRAMERATE="$3" + +# find audio device (pulseaudio) +PULSE_DEVICE="$(pactl -f json list sources | jq \ + --arg sysfs_path "$SYSFS_PATH" --raw-output \ + '.[] | select(.properties["sysfs.path"] | . != null and startswith($sysfs_path)) | .name')" +AUDIO_URL="av://pulse:$PULSE_DEVICE" + +# find video device (video4linux) +V4L_PATH="$(find "/sys$SYSFS_PATH" -name 'video4linux' | head -n1)" +V4L_PATH="$(find "$V4L_PATH" -name 'index' | xargs grep -l '^0$')" +V4L_PATH="$(echo "$V4L_PATH" | sed 's#/index$#/uevent#')" +VIDEO_DEVICE="$(. "$V4L_PATH" ; echo "/dev/$DEVNAME")" +VIDEO_DEVICE="$(readlink -f "$VIDEO_DEVICE")" +VIDEO_URL="av://v4l2:$VIDEO_DEVICE" + +RESOLUTION="${WIDTH}x${HEIGHT}" + +fork() { + JOBS="$JOBS $( + "$@" > /dev/null 2> /dev/null & + echo $! + )" +} + +# set capture card v4l parameters +v4l2-ctl --silent --device "$VIDEO_DEVICE" \ + --set-parm "$FRAMERATE" \ + --set-fmt-video "width=$WIDTH,height=$HEIGHT,pixelformat=MJPG" \ + --set-ctrl "brightness=0,contrast=128,saturation=128,hue=0" + +_mpv() { + fork mpv \ + --quiet --msg-level=input=no \ + --no-config --input-conf=/dev/null \ + --no-osc --no-border \ + --no-input-default-bindings --pause=no --force-seekable=no \ + --cache=no \ + "$@" +} + +# audio preview +_mpv \ + --no-demuxer-thread \ + --audio-buffer=0 \ + --cache-pause=no \ + --interpolation=no \ + --stream-buffer-size=4k \ + --profile=low-latency \ + --speed=1.001 \ + "$AUDIO_URL" + +# video preview +_mpv \ + --untimed --no-correct-pts --no-demuxer-thread \ + --profile=low-latency \ + --demuxer-lavf-o-add=input_format=mjpeg \ + --demuxer-lavf-o-add=framerate="$FRAMERATE" \ + --demuxer-lavf-o-add=resolution="$RESOLUTION" \ + --demuxer-lavf-o-add=rw_timeout=30000000 \ + --speed=1.05 \ + "$VIDEO_URL" + +sleep infinity +kill -9 -- $JOBS + diff --git a/home/dot_local/share/bin/executable_clean b/home/dot_local/share/bin/executable_clean new file mode 100644 index 0000000..8c824f1 --- /dev/null +++ b/home/dot_local/share/bin/executable_clean @@ -0,0 +1,3 @@ +#!/bin/sh +[ -n "$UB_SOCKET" ] && ueberzugpp cmd --socket "$UB_SOCKET" --action remove --identifier PREVIEW + diff --git a/home/dot_local/share/bin/executable_darkroom b/home/dot_local/share/bin/executable_darkroom new file mode 100644 index 0000000..28e2589 --- /dev/null +++ b/home/dot_local/share/bin/executable_darkroom @@ -0,0 +1,20 @@ +#!/bin/sh + +SCREENS="`xrandr | grep ' connected ' | cut -f1 -d' '`" + +mxr() { + for screen in $SCREENS; do + xrandr --output "$screen" $@ + done +} + +if [ -e "$XDG_CACHE_HOME/darkroom" ]; then + rm -f "$XDG_CACHE_HOME/darkroom" + mxr --gamma '1:1:1' +else + mkdir -p "$XDG_CACHE_HOME" + touch "$XDG_CACHE_HOME/darkroom" + killall -q redshift # redshift hijacks gamma + mxr --gamma '1:0.0001:0.0001' + lights darkroom +fi diff --git a/home/dot_local/share/bin/executable_dbg b/home/dot_local/share/bin/executable_dbg new file mode 100644 index 0000000..d042ba5 --- /dev/null +++ b/home/dot_local/share/bin/executable_dbg @@ -0,0 +1,27 @@ +#!/bin/sh +GDB="arm-none-eabi-gdb" + +found_executable=false + +while ! $found_executable ; do + [ ! -e build/zephyr ] && break + [ ! -e build/zephyr/zephyr.elf ] && break + set -- --se="build/zephyr/zephyr.elf" "$@" + + [ -e build/tfm/bin/tfm_s.elf ] && set -- "$@" --eval-command="add-symbol-file build/tfm/bin/tfm_s.elf" + + found_executable=true +done + +while ! $found_executable ; do + exec="$(find . -maxdepth 3 -name '*.elf' | head -n1)" + [ -n "$exec" ] && set -- "$@" --se="$exec" + found_executable=true + break +done + +set -- "$@" --eval-command="set jlink autoconnect on" +set -- "$@" --eval-command="set jlink watchdog on" + +exec "$GDB" "$@" + diff --git a/home/dot_local/share/bin/executable_dbg_xprop b/home/dot_local/share/bin/executable_dbg_xprop new file mode 100644 index 0000000..1aa0b0c --- /dev/null +++ b/home/dot_local/share/bin/executable_dbg_xprop @@ -0,0 +1,10 @@ +#!/bin/sh +# debug xprop +# +# runs xprop for all newly created windows (when mouse capture is not +# available) + +xev -root -1 |\ + grep --line-buffered '^CreateNotify' |\ + awk --non-decimal-data -F', ' '{ system("sleep 0.1"); printf("%d\n", substr($6, 8)); fflush(stdout) }' |\ + xargs -I{} sh -c 'echo "------ window data for window {}"; xprop -id {}' diff --git a/home/dot_local/share/bin/executable_decsync2plain b/home/dot_local/share/bin/executable_decsync2plain new file mode 100644 index 0000000..745a1c2 --- /dev/null +++ b/home/dot_local/share/bin/executable_decsync2plain @@ -0,0 +1,60 @@ +#!/bin/sh + +EXEC_NAME="$(basename "$0")" +EXTENSION="$1" + +usage() { + cat << EOF +usage: $EXEC_NAME [EXT] + +examples: + cd Decsync/calendars/$(uuidgen)/v2/DeviceName-DecSyncCC-$RANDOM ; $EXEC_NAME ics + + cd Decsync/contacts/$(uuidgen)/v2/DeviceName-DecSyncCC-$RANDOM ; $EXEC_NAME vcf + +$EXEC_NAME will attempt to guess the appropriate file extension based on the parent folder names. the first parent folder that matches exactly one of the following determines the file extension: + calendars -> .ics + contacts -> .vcf + tasks -> .ics + +if no file extension is found and none is explicitly provided, $EXEC_NAME will exit. +EOF +} + +if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then + usage + exit 0 +fi + +if [ ! -e sequences ] ; then + echo "error: could not find decsync sequences file" + exit 1 +fi + +# auto detect extension if not explicitly provided +if [ -z "$EXTENSION" ] ; then + EXTENSION="$(realpath "$PWD" | tr '/' '\n' | tac | while read -r folder ; do + case "$folder" in + calendars|tasks) echo ics ; break ;; + contacts) echo vcf ; break ;; + esac + done)" +fi + +if [ -z "$EXTENSION" ] ; then + echo "error: could not detect EXT" + exit 1 +fi + +COLLECTION_PREFIX="$(jq --raw-output 'if .[2] == "name" then "\(.[3])/" else empty end' info)" +mkdir -p "$COLLECTION_PREFIX" + +jq --raw-output '. | keys | join("\n")' sequences |\ + sed '/^info$/d' |\ + tr '\n' '\0' |\ + xargs -0 -n1 cat |\ +while read -r line ; do + filename="$COLLECTION_PREFIX$(echo "$line" | jq --raw-output '.[0][1]').$EXTENSION" + echo "$filename" + echo "$line" | jq --raw-output '.[3]' > "$filename" +done diff --git a/home/dot_local/share/bin/executable_delta b/home/dot_local/share/bin/executable_delta new file mode 100644 index 0000000..83fb629 --- /dev/null +++ b/home/dot_local/share/bin/executable_delta @@ -0,0 +1,4 @@ +#!/bin/sh +[ -e "$XDG_CACHE_HOME/mode/state/vars" ] && . "$XDG_CACHE_HOME/mode/state/vars" +[ "$mode" = "light" ] && theme="--light" || theme="--dark" +exec /bin/delta "$theme" "$@" diff --git a/home/dot_local/share/bin/executable_discord b/home/dot_local/share/bin/executable_discord new file mode 100644 index 0000000..d2f894b --- /dev/null +++ b/home/dot_local/share/bin/executable_discord @@ -0,0 +1,3 @@ +#!/bin/sh +installbd +exec /usr/bin/discord "$@" diff --git a/home/dot_local/share/bin/executable_dox-open b/home/dot_local/share/bin/executable_dox-open new file mode 100644 index 0000000..493c435 --- /dev/null +++ b/home/dot_local/share/bin/executable_dox-open @@ -0,0 +1,31 @@ +#!/bin/node + +import { glob, readFile } from 'node:fs/promises'; +import { spawn } from 'node:child_process'; +import { argv, chdir, cwd } from 'node:process'; +import { join } from 'node:path'; + +argv.shift(); +argv.shift(); +chdir("search"); + +var symbols = {}; +for await (const chunk of glob('all_*.js')) { + const contents = await readFile(chunk); + const searchData = eval(`${contents}; searchData`); + const here = cwd(); + + for (const [ _id, [ symbol, ...entry ] ] of searchData) { + symbols[symbol] = entry.map(e => `file://${join(here, e[0])}`); + } +} + +for (const symbol of argv) { + if (!(symbol in symbols)) { + console.error(`No doxygen index for symbol \`${symbol}\``); + continue; + } + const urls = symbols[symbol]; + spawn('xdg-open', [ urls[0], ]); +} + diff --git a/home/dot_local/share/bin/executable_editor b/home/dot_local/share/bin/executable_editor new file mode 100644 index 0000000..d4bf664 --- /dev/null +++ b/home/dot_local/share/bin/executable_editor @@ -0,0 +1,2 @@ +#!/bin/sh +exec nvim -p "$@" diff --git a/home/dot_local/share/bin/executable_extmon b/home/dot_local/share/bin/executable_extmon new file mode 100644 index 0000000..dcaa0b3 --- /dev/null +++ b/home/dot_local/share/bin/executable_extmon @@ -0,0 +1,26 @@ +#!/bin/sh +out_int="eDP1" +out_ext="HDMI1" +res_int="1366x768" +res_ext="1920x1080" + +off() { + xrandr \ + --output "$out_ext" --off \ + --output "$out_int" --mode "$res_int" --panning "$res_int" --transform none --primary \ + --fb "$res_int" +} + +on() { + xrandr \ + --fb "$res_ext" \ + --output "$out_int" --mode "$res_int" --panning "$res_ext" --scale-from "$res_ext" \ + --output "$out_ext" --mode "$res_ext" --scale 1x1 --same-as "$out_int" --primary +} + +[ "$1" = "on" ] && on +[ "$1" = "off" ] && off + +# reload polybar (doesn't adjust to new resolution automatically) +fork polybar-msg cmd restart + diff --git a/home/dot_local/share/bin/executable_fcitx5-temp-off b/home/dot_local/share/bin/executable_fcitx5-temp-off new file mode 100644 index 0000000..b2f8ea9 --- /dev/null +++ b/home/dot_local/share/bin/executable_fcitx5-temp-off @@ -0,0 +1,8 @@ +#!/bin/sh +mkdir -p "$XDG_DATA_HOME/fcitx5" +fcitx5-remote > "$XDG_DATA_HOME/fcitx5/state" +fcitx5-remote -n > "$XDG_DATA_HOME/fcitx5/ime_name" + +fcitx5-remote -c +fcitx5-remote -s 'keyboard-us' + diff --git a/home/dot_local/share/bin/executable_fcitx5-temp-restore b/home/dot_local/share/bin/executable_fcitx5-temp-restore new file mode 100644 index 0000000..d00b11c --- /dev/null +++ b/home/dot_local/share/bin/executable_fcitx5-temp-restore @@ -0,0 +1,7 @@ +#!/bin/sh +[ ! -e "$XDG_DATA_HOME/fcitx5/state" ] && exit +[ ! -e "$XDG_DATA_HOME/fcitx5/ime_name" ] && exit + +[ `cat "$XDG_DATA_HOME/fcitx5/state"` = "1" ] && fcitx5-remote -c +[ `cat "$XDG_DATA_HOME/fcitx5/state"` = "2" ] && fcitx5-remote -o +cat "$XDG_DATA_HOME/fcitx5/ime_name" | xargs fcitx5-remote -s diff --git a/home/dot_local/share/bin/executable_ffmpeg-resize b/home/dot_local/share/bin/executable_ffmpeg-resize new file mode 100644 index 0000000..4270278 --- /dev/null +++ b/home/dot_local/share/bin/executable_ffmpeg-resize @@ -0,0 +1,82 @@ +#!/bin/bash +# +# Re-encode a video to a target size in MB. +# Example: +# ./this_script.sh video.mp4 15 + +T_SIZE="$2" # target size in MB +T_FILE="${1%.*}-$2MB.mp4" # filename out + +# Original duration in seconds +O_DUR=$(\ + ffprobe \ + -v error \ + -show_entries format=duration \ + -of csv=p=0 "$1") + +# Original audio rate +O_ARATE=$(\ + ffprobe \ + -v error \ + -select_streams a:0 \ + -show_entries stream=bit_rate \ + -of csv=p=0 "$1") + +# Original audio rate in KiB/s +O_ARATE=$(\ + awk \ + -v arate="$O_ARATE" \ + 'BEGIN { printf "%.0f", (arate / 1024) }') + +# Target size is required to be less than the size of the original audio stream +T_MINSIZE=$(\ + awk \ + -v arate="$O_ARATE" \ + -v duration="$O_DUR" \ + 'BEGIN { printf "%.2f", ( (arate * duration) / 8192 ) }') + +# Equals 1 if target size is ok, 0 otherwise +IS_MINSIZE=$(\ + awk \ + -v size="$T_SIZE" \ + -v minsize="$T_MINSIZE" \ + 'BEGIN { print (minsize < size) }') + +# Give useful information if size is too small +if [[ $IS_MINSIZE -eq 0 ]]; then + printf "%s\n" "Target size ${T_SIZE}MB is too small!" >&2 + printf "%s %s\n" "Try values larger than" "${T_MINSIZE}MB" >&2 + exit 1 +fi + +# Set target audio bitrate +T_ARATE=$O_ARATE + + +# Calculate target video rate - MB -> KiB/s +T_VRATE=$(\ + awk \ + -v size="$T_SIZE" \ + -v duration="$O_DUR" \ + -v audio_rate="$O_ARATE" \ + 'BEGIN { print ( ( size * 8192.0 ) / ( 1.048576 * duration ) - audio_rate) }') + +# Perform the conversion +ffmpeg \ + -y \ + -i "$1" \ + -c:v libx264 \ + -b:v "$T_VRATE"k \ + -pass 1 \ + -an \ + -f mp4 \ + /dev/null \ +&& \ +ffmpeg \ + -i "$1" \ + -c:v libx264 \ + -b:v "$T_VRATE"k \ + -pass 2 \ + -c:a aac \ + -b:a "$T_ARATE"k \ + "$T_FILE" diff --git a/home/dot_local/share/bin/executable_folder2cd b/home/dot_local/share/bin/executable_folder2cd new file mode 100644 index 0000000..558c6ab --- /dev/null +++ b/home/dot_local/share/bin/executable_folder2cd @@ -0,0 +1,23 @@ +#!/bin/sh + +FILEEXT="flac" +set -e + +convert() { + wav="${1%.flac}-cd.wav" + echo "ffmpeg -loglevel warning -y -i \"$1\" -sample_fmt s16 -ar 44100 \"$wav\"" + ffmpeg -loglevel warning -y -i "$1" -sample_fmt s16 -ar 44100 "$wav" +} + +export -f convert +parallel -j4 convert ::: *.$FILEEXT + +FILES=`find . -name '*-cd.wav' -printf '%f\n' | sort -n` +echo "$FILES" | xargs -d"\n" -t wodim -sao -audio -pad speed=20 + +echo "wodim -eject" +wodim -eject + +echo "rm -f *-cd.wav" +rm -f *-cd.wav + diff --git a/home/dot_local/share/bin/executable_fontfix b/home/dot_local/share/bin/executable_fontfix new file mode 100644 index 0000000..1c9beaf --- /dev/null +++ b/home/dot_local/share/bin/executable_fontfix @@ -0,0 +1,39 @@ +#!/bin/python3 + +import os +import sys +from pathlib import Path + +from fontTools import ttLib + +PROPID_FAMILY = 1 +PROPID_SUBFAMILY = 2 +PROPID_FULLNAME = 4 +PROPID_PSNAME = 6 + +PLATFORM_MS = 1 +PLATFORM_MAC = 3 + +# see +# https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6name.html +# for magic numbers + +for folder in Path(".").iterdir(): + print(f"{folder}/") + family_name = str(folder.stem) + for file in folder.glob("*.ttf"): + subfamily_name = file.stem.removeprefix(family_name).strip() + with ttLib.TTFont(file) as ttf: + nametable = ttf["name"] + full_name = f"{family_name} {subfamily_name}" + postscript_name = f"{family_name}-{subfamily_name}".replace(" ", "") + nametable.setName(family_name, PROPID_FAMILY, PLATFORM_MS, 0, 0) + nametable.setName(family_name, PROPID_FAMILY, PLATFORM_MAC, 1, 1033) + nametable.setName(subfamily_name, PROPID_SUBFAMILY, PLATFORM_MS, 0, 0) + nametable.setName(subfamily_name, PROPID_SUBFAMILY, PLATFORM_MAC, 1, 1033) + nametable.setName(full_name, PROPID_FULLNAME, PLATFORM_MS, 0, 0) + nametable.setName(full_name, PROPID_FULLNAME, PLATFORM_MAC, 1, 1033) + nametable.setName(postscript_name, PROPID_PSNAME, PLATFORM_MS, 0, 0) + nametable.setName(postscript_name, PROPID_PSNAME, PLATFORM_MAC, 1, 1033) + ttf.save(file) + print(f" {file.name}: [{family_name} :: {subfamily_name}]") diff --git a/home/dot_local/share/bin/executable_fork b/home/dot_local/share/bin/executable_fork new file mode 100644 index 0000000..63e7541 --- /dev/null +++ b/home/dot_local/share/bin/executable_fork @@ -0,0 +1,2 @@ +#!/bin/sh +(setsid "$@" > /dev/null 2> /dev/null &) diff --git a/home/dot_local/share/bin/executable_fv b/home/dot_local/share/bin/executable_fv new file mode 100644 index 0000000..5ce4f2e --- /dev/null +++ b/home/dot_local/share/bin/executable_fv @@ -0,0 +1,2 @@ +#!/bin/sh +fzf --multi --print0 | exec xargs -r0 $EDITOR diff --git a/home/dot_local/share/bin/executable_gpg-git b/home/dot_local/share/bin/executable_gpg-git new file mode 100644 index 0000000..df0feca --- /dev/null +++ b/home/dot_local/share/bin/executable_gpg-git @@ -0,0 +1,4 @@ +#!/bin/sh +GPG_KEY_ID="$GPG_ID_GIT" # see ~/.profile +GPG_KEY_PASSPHRASE="$(pass "gpg/$GPG_KEY_ID.asc" | head -n1)" +gpg --batch --no-tty --pinentry-mode loopback --passphrase "$GPG_KEY_PASSPHRASE" "$@" diff --git a/home/dot_local/share/bin/executable_helium-browser b/home/dot_local/share/bin/executable_helium-browser new file mode 100644 index 0000000..96e1864 --- /dev/null +++ b/home/dot_local/share/bin/executable_helium-browser @@ -0,0 +1,5 @@ +#!/bin/sh +/usr/bin/helium-browser \ + --load-extension="$XDG_CACHE_HOME/mode/chromium" \ + --password-store=basic \ + "$@" diff --git a/home/dot_local/share/bin/executable_hide b/home/dot_local/share/bin/executable_hide new file mode 100644 index 0000000..cb49be0 --- /dev/null +++ b/home/dot_local/share/bin/executable_hide @@ -0,0 +1,4 @@ +#!/bin/sh +for file in "$@" ; do + mv "$file" ".$file" +done diff --git a/home/dot_local/share/bin/executable_icalcat b/home/dot_local/share/bin/executable_icalcat new file mode 100644 index 0000000..2e89afd --- /dev/null +++ b/home/dot_local/share/bin/executable_icalcat @@ -0,0 +1,12 @@ +#!/bin/sh +cat << "EOF" +BEGIN:VCALENDAR +VERSION:2.0 +EOF + +cat "$@" | sed -n -e '/^BEGIN:VEVENT$/,/^END:VEVENT$/p' + +cat << "EOF" +END:VCALENDAR +EOF + diff --git a/home/dot_local/share/bin/executable_installbd b/home/dot_local/share/bin/executable_installbd new file mode 100644 index 0000000..ae17002 --- /dev/null +++ b/home/dot_local/share/bin/executable_installbd @@ -0,0 +1,20 @@ +#!/bin/sh +discord_path="$(dirname "$(find "$XDG_CONFIG_HOME/discord" -name core.asar)")" +discord_version="$(echo "$discord_path" | tr '/' '\n' | tac | sed -n '/^[0-9.]\+$/p' | head -n1)" +betterdiscord_path="$XDG_CONFIG_HOME/BetterDiscord/data/betterdiscord.asar" +cache_file="$XDG_CACHE_HOME/bdversion" + +if [ "$discord_path" -nt "$betterdiscord_path" ] ; then + echo "download betterdiscord.asar" + curl -sLo - 'https://betterdiscord.app/Download/betterdiscord.asar' > "$betterdiscord_path" +fi +if ! grep "$(basename "$betterdiscord_path")" "$discord_path/index.js" > /dev/null ; then + echo "patch discord desktop core index.js" + printf 'require("%s");\n%s' "$betterdiscord_path" "$(cat "$discord_path/index.js")" > "$discord_path/index.js" +fi + +# store discord version used for this install +mkdir -p "$(dirname "$cache_file")" +echo "$discord_version" > "$cache_file" + +echo "done!" diff --git a/home/dot_local/share/bin/executable_java b/home/dot_local/share/bin/executable_java new file mode 100644 index 0000000..06fdb61 --- /dev/null +++ b/home/dot_local/share/bin/executable_java @@ -0,0 +1,7 @@ +#!/bin/sh +export _JAVA_AWT_WM_NONREPARENTING=1 +exec /usr/bin/java \ + -Djava.util.prefs.userRoot="$XDG_CONFIG_HOME/java" \ + -Dawt.useSystemAAFontSettings=on \ + -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel \ + "$@" diff --git a/home/dot_local/share/bin/executable_kbindicator b/home/dot_local/share/bin/executable_kbindicator new file mode 100644 index 0000000..6ffcd53 --- /dev/null +++ b/home/dot_local/share/bin/executable_kbindicator @@ -0,0 +1,19 @@ +#!/bin/sh +query_kb_layout() { + CONTROLLER="$(qdbus 'org.fcitx.Fcitx5' '/controller' 'org.fcitx.Fcitx.Controller1.CurrentInputMethod')" + case $CONTROLLER in + "keyboard-us") echo "英数" ;; + "keyboard-us-intl") echo "英数(国際)" ;; + "mozc") echo "日本語" ;; + *) ;; + esac +} + +query_kb_layout + +dbus-monitor --address "$(fcitx5-remote -a)" "member='SetCurrentIM',destination='org.fcitx.Fcitx5'" |\ + grep --line-buffered 'SetCurrentIM' |\ + while read -r line ; do + query_kb_layout + done + diff --git a/home/dot_local/share/bin/executable_khal b/home/dot_local/share/bin/executable_khal new file mode 100644 index 0000000..71e5392 --- /dev/null +++ b/home/dot_local/share/bin/executable_khal @@ -0,0 +1,16 @@ +#!/bin/sh +CFG="$XDG_CONFIG_HOME/khal/config" +if [ "$CFG" -ot "$XDG_CONFIG_HOME/khal/config.sh" ] ; then + cat - "$XDG_CONFIG_HOME/khal/base" << "EOF" > "$CFG" +# THIS FILE IS AUTO-GENERATED, EDIT config_gen OR base INSTEAD!!! + +EOF + "$XDG_CONFIG_HOME/khal/config_gen" >> "$CFG" +fi + +# aliases +[ "$1" = "i" ] && { shift ; set -- interactive "$@" ; } +[ "$1" = "l" ] && { shift ; set -- list "$@" ; } + +exec /usr/bin/khal "$@" + diff --git a/home/dot_local/share/bin/executable_khard b/home/dot_local/share/bin/executable_khard new file mode 100644 index 0000000..cb02889 --- /dev/null +++ b/home/dot_local/share/bin/executable_khard @@ -0,0 +1,12 @@ +#!/bin/sh +CFG="$XDG_CONFIG_HOME/khard/khard.conf" +if [ "$CFG" -ot "$XDG_CONFIG_HOME/khard/config.sh" ] ; then + cat - "$XDG_CONFIG_HOME/khard/base" << "EOF" > "$CFG" +# THIS FILE IS AUTO-GENERATED, EDIT config_gen OR base INSTEAD!!! + +EOF + "$XDG_CONFIG_HOME/khard/config_gen" >> "$CFG" +fi + +exec /usr/bin/khard "$@" + diff --git a/home/dot_local/share/bin/executable_labels2lrc b/home/dot_local/share/bin/executable_labels2lrc new file mode 100644 index 0000000..c8abc1c --- /dev/null +++ b/home/dot_local/share/bin/executable_labels2lrc @@ -0,0 +1,30 @@ +#!/bin/python3 + +import re +import sys + +for line in sys.stdin: + line = line.rstrip("\n") + fields = line.split("\t") + + if len(fields) < 3: + continue + + time = fields[0] + + # Equivalent of: + # gensub(/([0-9]+)\.([0-9]{,2})([0-9]*)/, "\\1\\2.\\3", "g", time) + time = re.sub(r'(\d+)\.(\d{0,2})(\d*)', r'\1\2.\3', time) + + # AWK rounds by adding 0.5 then truncating. + time = int(float(time) + 0.5) + + millis = time % 100 + time //= 100 + + seconds = time % 60 + time //= 60 + + minutes = time % 100 + + print(f"[{minutes:02d}:{seconds:02d}.{millis:02d}]{fields[2]}") diff --git a/home/dot_local/share/bin/executable_latex-doc b/home/dot_local/share/bin/executable_latex-doc new file mode 100644 index 0000000..6d785f1 --- /dev/null +++ b/home/dot_local/share/bin/executable_latex-doc @@ -0,0 +1,4 @@ +#!/bin/sh +set -e +cd /usr/share/doc/texlive/latex +fork xdg-open "$(find . -name '*.pdf' | fzf)" diff --git a/home/dot_local/share/bin/executable_lf b/home/dot_local/share/bin/executable_lf new file mode 100644 index 0000000..430ae0b --- /dev/null +++ b/home/dot_local/share/bin/executable_lf @@ -0,0 +1,23 @@ +#!/bin/sh +lf=/usr/bin/lf + +UB_PID=0 +UB_SOCKET="" +UB_PID_FILE="$(mktemp)" + +cleanup() { + exec 3>&- + ueberzugpp cmd -s "$UB_SOCKET" -a exit +} + +# don't try to use ueberzug over ssh +[ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] && exec $lf "$@" + +ueberzugpp layer --silent --no-stdin --use-escape-codes --pid-file "$UB_PID_FILE" >/dev/null +UB_PID="$(cat "$UB_PID_FILE")" +rm -f "$UB_PID_FILE" +UB_SOCKET="/tmp/ueberzugpp-$UB_PID.socket" +export UB_PID UB_SOCKET +trap cleanup HUP INT QUIT TERM EXIT +$lf "$@" 3>&- + diff --git a/home/dot_local/share/bin/executable_lights b/home/dot_local/share/bin/executable_lights new file mode 100644 index 0000000..69ea06c --- /dev/null +++ b/home/dot_local/share/bin/executable_lights @@ -0,0 +1,5 @@ +#!/bin/sh +cmd="$1" +[ -z "$cmd" ] && cmd="toggle" +curl -X POST "$HASS_SERVER/api/webhook/$cmd" + diff --git a/home/dot_local/share/bin/executable_lock b/home/dot_local/share/bin/executable_lock new file mode 100644 index 0000000..988c0ec --- /dev/null +++ b/home/dot_local/share/bin/executable_lock @@ -0,0 +1,4 @@ +#!/bin/sh +xset s 15 15 +slock +xset s default diff --git a/home/dot_local/share/bin/executable_lorem b/home/dot_local/share/bin/executable_lorem new file mode 100644 index 0000000..5ef3171 --- /dev/null +++ b/home/dot_local/share/bin/executable_lorem @@ -0,0 +1,12 @@ +#!/bin/sh + +lorem_text="$(cat << EOF +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Gravida dictum fusce ut placerat orci nulla pellentesque. Laoreet id donec ultrices tincidunt arcu. Tortor aliquam nulla facilisi cras fermentum odio eu feugiat. A scelerisque purus semper eget duis at tellus. A iaculis at erat pellentesque adipiscing commodo elit at imperdiet. Arcu bibendum at varius vel pharetra vel turpis nunc eget. Euismod in pellentesque massa placerat duis. Lorem ipsum dolor sit amet consectetur adipiscing elit. Ultrices in iaculis nunc sed augue lacus. Vestibulum mattis ullamcorper velit sed. Adipiscing diam donec adipiscing tristique risus nec feugiat in fermentum. Elit pellentesque habitant morbi tristique senectus et. Ullamcorper sit amet risus nullam eget felis eget nunc lobortis. Vestibulum sed arcu non odio. Vestibulum sed arcu non odio euismod lacinia. Maecenas pharetra convallis posuere morbi leo urna molestie at. Sit amet consectetur adipiscing elit duis tristique sollicitudin. Curabitur gravida arcu ac tortor dignissim convallis aenean et. Nunc sed blandit libero volutpat sed cras ornare arcu. Eu nisl nunc mi ipsum faucibus vitae aliquet nec. Vehicula ipsum a arcu cursus. Arcu felis bibendum ut tristique et. Lobortis scelerisque fermentum dui faucibus in ornare. In arcu cursus euismod quis viverra nibh cras pulvinar. Integer malesuada nunc vel risus. Elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus. Viverra nam libero justo laoreet. Felis bibendum ut tristique et. Neque volutpat ac tincidunt vitae semper quis. Semper feugiat nibh sed pulvinar proin gravida hendrerit. Arcu bibendum at varius vel pharetra vel turpis. Tincidunt arcu non sodales neque. Id aliquet risus feugiat in ante metus. Eget magna fermentum iaculis eu non diam. Tempor id eu nisl nunc mi ipsum. Bibendum enim facilisis gravida neque convallis a cras semper. Parturient montes nascetur ridiculus mus. Tortor pretium viverra suspendisse potenti nullam ac. Mauris vitae ultricies leo integer malesuada nunc. Integer eget aliquet nibh praesent. Lorem ipsum dolor sit amet consectetur. Sit amet consectetur adipiscing elit pellentesque habitant. Habitant morbi tristique senectus et netus et malesuada. Cursus metus aliquam eleifend mi in nulla posuere sollicitudin. Tincidunt dui ut ornare lectus sit amet est. Elementum curabitur vitae nunc sed velit dignissim sodales. Senectus et netus et malesuada fames ac turpis egestas sed. Scelerisque viverra mauris in aliquam sem fringilla ut. Nunc eget lorem dolor sed viverra ipsum nunc aliquet. Egestas egestas fringilla phasellus faucibus scelerisque eleifend donec. Id neque aliquam vestibulum morbi blandit cursus. Enim tortor at auctor urna nunc id cursus metus. Dignissim convallis aenean et tortor at risus viverra. Et malesuada fames ac turpis egestas. Id cursus metus aliquam eleifend mi in nulla posuere. Egestas dui id ornare arcu odio. At elementum eu facilisis sed odio. Ultrices vitae auctor eu augue ut lectus arcu bibendum at. Amet volutpat consequat mauris nunc congue nisi vitae. Enim lobortis scelerisque fermentum dui faucibus in ornare quam. Libero id faucibus nisl tincidunt eget. Amet risus nullam eget felis eget. Ultricies mi eget mauris pharetra. Magnis dis parturient montes nascetur ridiculus mus mauris vitae. Lectus magna fringilla urna porttitor rhoncus dolor purus. Elementum eu facilisis sed odio morbi quis commodo odio. Tincidunt vitae semper quis lectus. Sollicitudin ac orci phasellus egestas tellus rutrum tellus pellentesque eu. Pretium viverra suspendisse potenti nullam ac. Sed egestas egestas fringilla phasellus faucibus scelerisque eleifend donec. Tortor consequat id porta nibh venenatis. Elit at imperdiet dui accumsan sit amet nulla. Sem viverra aliquet eget sit. At in tellus integer feugiat scelerisque varius morbi enim. Dictum fusce ut placerat orci nulla pellentesque. Sed risus pretium quam vulputate dignissim. Tincidunt dui ut ornare lectus sit amet est placerat in. Urna nec tincidunt praesent semper feugiat. +EOF +)" + +if [ -z "$1" ]; then + echo "$lorem_text" +else + echo "$lorem_text" | cut -f1-$1 --delimiter=" " +fi diff --git a/home/dot_local/share/bin/executable_lrc2labels b/home/dot_local/share/bin/executable_lrc2labels new file mode 100644 index 0000000..a23b299 --- /dev/null +++ b/home/dot_local/share/bin/executable_lrc2labels @@ -0,0 +1,7 @@ +#!/bin/gawk -f +match($0, /^\[([0-9]{2}):([0-9]{2}\.[0-9]{2})\](.*)/, group) { + time = group[1] * 60 + group[2] + lyric = group[3] + + printf("%.2f\t%.2f\t%s\n", time, time, lyric) +} diff --git a/home/dot_local/share/bin/executable_mbsync b/home/dot_local/share/bin/executable_mbsync new file mode 100644 index 0000000..3f6aa09 --- /dev/null +++ b/home/dot_local/share/bin/executable_mbsync @@ -0,0 +1,2 @@ +#!/bin/sh +/usr/bin/mbsync --config "$XDG_CONFIG_HOME/mbsyncrc" "$@" diff --git a/home/dot_local/share/bin/executable_mk b/home/dot_local/share/bin/executable_mk new file mode 100644 index 0000000..051235a --- /dev/null +++ b/home/dot_local/share/bin/executable_mk @@ -0,0 +1,87 @@ +#!/bin/sh +progname="$(basename "$0")" +showmode() { + ! [ -n "$FROM_PROMPT" ] && return + ! [ -t 1 ] && return + + mode=" ($1)" + col=$(( $(tput cols) - $(echo "$mode" | wc -L) + 1 )) + printf '\e[1A\e['$col'G\e[1;30m%s\e[0m\n' "$mode" +} + +make_tags() { + build_dir="${1-build}" + + if [ -e "$build_dir/domains.yaml" ] ; then + yaml2json "$build_dir/domains.yaml" | jq --raw-output '. as $r | $r.flash_order[] as $n | $r.domains[] | select(.name == $n) | .build_dir' | while IFS= read -r build_dir; do + echo "Processing: $build_dir" + done + fi + +} + +mode_west() { + showmode 'west' + if [ -z "$*" ] ; then + set -- build + [ -e sysbuild ] || [ -e sysbuild.conf ] && set -- "$@" --sysbuild + fi + west "$@" + ec=$? + + mktags build & + + exit $ec +} +path="." +for x in $(seq 10) ; do + [ -e "$path/.west" ] && mode_west "$@" + [ "$path" -ef "$path/.." ] && break + path="$path/.." +done + +mode_cmake() { + showmode 'cmake' + builddir="build" + + [ "$*" = "clean" ] && exec rm -rf "$builddir" + + export CMAKE_GENERATOR="Ninja" + + # re-run configuration if fresh or CMakeLists was changed + if [ ! -e "$builddir/build.ninja" ] || + [ "CMakeLists.txt" -nt "$builddir/build.ninja" ] ; then + cmake --log-level WARNING -B "$builddir" || exit $? + fi + + # build + cmake --build "$builddir" -- "$@" + ec=$? + + # generate vim tags (continue after mk exits) + mktags "$builddir" & + + exit $ec +} +[ -e "CMakeLists.txt" ] && mode_cmake "$@" + +mode_make() { + showmode 'make' + exec make "$@" +} +[ -e "makefile" ] && mode_make "$@" +[ -e "Makefile" ] && mode_make "$@" + +mode_latexmk() { + showmode 'latexmk' + + [ "$*" = "clean" ] && exec latexmk -c + + exec latexmk "$@" +} +[ -e "latexmkrc" ] && mode_latexmk "$@" +[ -e ".latexmkrc" ] && mode_latexmk "$@" + +echo "$progname: unable to determine project build system!" >&2 +exit 1 + diff --git a/home/dot_local/share/bin/executable_mktags b/home/dot_local/share/bin/executable_mktags new file mode 100644 index 0000000..2daf25c --- /dev/null +++ b/home/dot_local/share/bin/executable_mktags @@ -0,0 +1,61 @@ +#!/bin/python3 + +from subprocess import run, DEVNULL +from pathlib import Path +from dataclasses import dataclass +from argparse import ArgumentParser + +@dataclass +class Options: + build_dir: Path + +def parse_arguments() -> Options: + parser = ArgumentParser(prog="mktags", description="generate vim tags file from build directory") + parser.add_argument("build_dir", type=Path, help="build directory", nargs='?', default=Path("build")) + + options = parser.parse_args() + return Options(**vars(options)) + +def index_files(build_dir: Path) -> list[Path]: + lines = [line for line in run(("ninja", "-C", str(build_dir), "-t", "deps"), text=True, capture_output=True).stdout.splitlines()] + lines = [line.lstrip() for line in lines if line.startswith(" ")] + return [Path(line) for line in lines] + +def get_sysbuild_files(domains_yml: Path) -> list[Path]: + if not domains_yml.exists(): + return [] + + from yaml import safe_load + yaml = safe_load(domains_yml.read_text()) + + build_dirs = [next(Path(domain['build_dir']) for domain in yaml['domains'] if domain['name'] == domain_name) for domain_name in yaml['flash_order']] + + files: set[Path] = set() + for dir in build_dirs: + files.update(get_files(dir)) + + return list(files) + +def get_files(build_dir: Path) -> list[Path]: + files = [] + + files += get_sysbuild_files(build_dir.joinpath("domains.yaml")) + files += index_files(build_dir) + + return files + +def gen_tags(files: list[Path]) -> str: + filelist = "\n".join(str(file) for file in files) + return run(("ctags", "-L", "-", "-f", "-"), text=True, input=filelist, capture_output=True).stdout + +if __name__ == "__main__": + options = parse_arguments() + + files = get_files(options.build_dir) + + files = list(set(files)) + + tags = gen_tags(files) + + options.build_dir.joinpath("tags").write_text(tags) + diff --git a/home/dot_local/share/bin/executable_mozc-config-filter b/home/dot_local/share/bin/executable_mozc-config-filter new file mode 100644 index 0000000..522275a --- /dev/null +++ b/home/dot_local/share/bin/executable_mozc-config-filter @@ -0,0 +1,6 @@ +#!/bin/sh +yay_dir="$(yay -Pg | jq --raw-output .buildDir)" +config_proto="$(mktemp)" +git --git-dir="$yay_dir/mozc-ut/mozc" show HEAD:src/protocol/config.proto > "$config_proto" +protoc --proto_path /tmp --decode=mozc.config.Config "$config_proto" < "$1" +rm -f "$config_proto" diff --git a/home/dot_local/share/bin/executable_nginx-dev b/home/dot_local/share/bin/executable_nginx-dev new file mode 100644 index 0000000..40e73ad --- /dev/null +++ b/home/dot_local/share/bin/executable_nginx-dev @@ -0,0 +1,86 @@ +#!/bin/sh +folder="$PWD" +port=8080 +try_files='/$uri /$uri.html /$uri/index.html =404' +access_log='/dev/stdout' +cache_control=' + proxy_store off; + proxy_cache off; + add_header Last-Modified $date_gmt; + add_header Cache-Control "private no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0"; + if_modified_since off; + expires off; + etag off; +' + +usage() { + cat << EOF +usage: $(basename "$0") [options] [folder] + +options: + -p PORT host server on port PORT (default $port) + -t STR set try_files pattern to STR (default '$try_files') + -C enable server cache (disabled by default) + -v verbose mode (prints config before starting server) + -q quiet mode (disable access_log) + -x automatically open a browser + -h show this help +EOF +exit $1 +} + +ARGC=0 +while getopts hvp:Ct:qx OPT; do + [ $OPTIND -gt $ARGC ] && ARGC=$OPTIND + case $OPT in + h) usage 0 ;; + p) port="$OPTARG" ;; + t) try_files="$OPTARG" ;; + v) print_config=1 ;; + C) cache_control='' ;; + q) access_log="/dev/null" ;; + x) open_browser=1 ;; + \?|*) usage 1 ;; + esac +done +shift $(( $OPTIND - 1 )) + +[ $# -ge 1 ] && folder="$(readlink -f "$1")" + +config="$(mktemp)" +pidfile="$(mktemp)" +cat << EOF > "$config" +worker_processes 1; +daemon off; +pid $pidfile; + +events { + worker_connections 1024; +} + +http { + types_hash_max_size 4096; + include /etc/nginx/mime.types; + default_type application/octet-stream; + + $cache_control + + access_log $access_log; + + server { + listen $port; + listen [::]:$port; + + root $folder; + + location / { + try_files $try_files; + } + } +} +EOF +[ $print_config ] && cat "$config" +[ $open_browser ] && (xdg-open "http://localhost:$port" 1> /dev/null 2> /dev/null &) +nginx -c "$config" +rm -f "$config" "$pidfile" + diff --git a/home/dot_local/share/bin/executable_open b/home/dot_local/share/bin/executable_open new file mode 100644 index 0000000..7856488 --- /dev/null +++ b/home/dot_local/share/bin/executable_open @@ -0,0 +1,12 @@ +#!/bin/sh +case "$(file --mime-type -Lb "$1")" in + text/*) + exec $EDITOR -- "$@" + ;; + *) + for file in "$@"; do + fork xdg-open "$file" + done + ;; +esac + diff --git a/home/dot_local/share/bin/executable_panic b/home/dot_local/share/bin/executable_panic new file mode 100644 index 0000000..7455786 --- /dev/null +++ b/home/dot_local/share/bin/executable_panic @@ -0,0 +1,36 @@ +#!/bin/sh +silent() { + "$@" 1>/dev/null 2> /dev/null & +} + +on() { + # clear desktop + silent i3-msg focus output primary + silent i3-msg workspace 'panic1' + silent i3-msg focus output right + silent i3-msg workspace 'panic2' + + # stop playing media (if any) + silent mpc pause + silent playerctl -a pause + + # mute mic/headphones + silent pactl set-sink-mute @DEFAULT_SINK@ true + silent pactl set-source-mute @DEFAULT_SOURCE@ true +} + +off() { + # unmute mic/headphones + silent pactl set-sink-mute @DEFAULT_SINK@ false + silent pactl set-source-mute @DEFAULT_SOURCE@ false +} + +panicfile="$XDG_CACHE_HOME/panic" +if [ -e "$panicfile" ] ; then + rm "$panicfile" + off +else + touch "$panicfile" + on +fi + diff --git a/home/dot_local/share/bin/executable_pause b/home/dot_local/share/bin/executable_pause new file mode 100644 index 0000000..8eedbfb --- /dev/null +++ b/home/dot_local/share/bin/executable_pause @@ -0,0 +1,10 @@ +#!/bin/sh +ec=0 +if [ $# -ge 1 ] ; then + "$@" + ec=$? +fi +printf "Press enter to exit..." +read +exit $ec + diff --git a/home/dot_local/share/bin/executable_pdfsize b/home/dot_local/share/bin/executable_pdfsize new file mode 100644 index 0000000..14f940d --- /dev/null +++ b/home/dot_local/share/bin/executable_pdfsize @@ -0,0 +1,2 @@ +#!/bin/sh +pdfinfo -box "$1" | awk '/^Page size:/ { print $3 * 2.54 / 72.0 * 10 "mm" " x " $5 * 2.54 / 72.0 * 10 "mm" }' diff --git a/home/dot_local/share/bin/executable_pew b/home/dot_local/share/bin/executable_pew new file mode 100644 index 0000000..70a9673 --- /dev/null +++ b/home/dot_local/share/bin/executable_pew @@ -0,0 +1,3 @@ +#!/bin/sh + +kill -9 $(xprop | grep "_NET_WM_PID(CARDINAL)" | cut -d' ' -f3) diff --git a/home/dot_local/share/bin/executable_podcast2m3u b/home/dot_local/share/bin/executable_podcast2m3u new file mode 100644 index 0000000..c3b692e --- /dev/null +++ b/home/dot_local/share/bin/executable_podcast2m3u @@ -0,0 +1,33 @@ +#!/bin/sh +URL="$1" +TAB="$(printf '\t')" +curl -sLo- "$URL" |\ +xmlstarlet select --template \ + --match '/rss/channel/item' \ + --value-of './itunes:duration' \ + --output "$TAB" \ + --value-of './title' \ + --output "$TAB" \ + --value-of './enclosure/@url' \ + --nl |\ +awk -F "$TAB" ' +BEGIN { + printf("#EXTM3U\n") +} +function time2secs(time) { + seconds = 0 + gsub(/,/, ".", time) + els = split(time, el, ":") + if (els == 0) return seconds; + seconds += el[els--] + if (els == 0) return seconds; + seconds += el[els--] * 60 + if (els == 0) return seconds; + seconds += el[els--] * 60 * 60 + return seconds; +} +{ + printf("#EXTINF:%s,%s\n%s\n", time2secs($1), $2, $3) +} +' + diff --git a/home/dot_local/share/bin/executable_preview b/home/dot_local/share/bin/executable_preview new file mode 100644 index 0000000..819938b --- /dev/null +++ b/home/dot_local/share/bin/executable_preview @@ -0,0 +1,75 @@ +#!/bin/sh +[ -n "$1" ] && FILE="$1" || { + echo "error: no input file" + exit 1 +} +[ -n "$2" ] && WIDTH="$(( "$2" - 1 ))" || WIDTH="$(tput cols)" +[ -n "$3" ] && HEIGHT="$3" || HEIGHT="$(tput lines)" +[ -n "$4" ] && POS_X="$4" || POS_X="0" +[ -n "$5" ] && POS_Y="$5" || POS_Y="0" + +MIMETYPE="$(file --mime-type -Lb "$FILE")" +EXT="${FILE#*.}" + +if [ "$MIMETYPE" = "text/plain" ] ; then + [ "$EXT" = "md" ] && MIMETYPE="text/markdown" + [ "$EXT" = "rst" ] && MIMETYPE="text/x-rst" +fi +[ "$MIMETYPE" = "application/javascript" ] && MIMETYPE="text/javascript" + +render_manpage() { + exec groff -T utf8 -m man -rcR=1 -rIN=0 -rLL="${WIDTH}n" << EOF +.nr an-suppress-header-and-footer 1 +.TH +$(cat | preconv) +EOF +} + +case "$MIMETYPE" in + image/*) + if [ -z "$UB_SOCKET" ] ; then + echo "ueberzug not available" + else + ueberzugpp cmd \ + --socket "$UB_SOCKET" \ + --action add \ + --identifier PREVIEW \ + --file "$FILE" \ + --max-width "$WIDTH" --max-height "$HEIGHT" \ + --xpos "$POS_X" --ypos "$POS_Y" + exit 1 # <- disable cache + fi + ;; + text/markdown) + pandoc --from=gfm --to=man "$FILE" | render_manpage + ;; + text/x-rst) + pandoc --from=rst --to=man "$FILE" | render_manpage + ;; + text/*) + bat \ + --terminal-width="$WIDTH" \ + --paging=never \ + --color=always \ + -- "$FILE" + ;; + application/x-tar|\ + application/x-bzip|\ + application/x-bzip2|\ + application/gzip|\ + application/zip|\ + application/x-7z-compressed|\ + application/vnd.rar) + bsdtar -tf "$FILE" + ;; + application/json) + jq --color-output . "$FILE" + ;; + *) + echo "$MIMETYPE" + file -b "$FILE" | fold --width="$WIDTH" --spaces + ;; +esac + +exit 0 + diff --git a/home/dot_local/share/bin/executable_prompt b/home/dot_local/share/bin/executable_prompt new file mode 100644 index 0000000..7dde932 --- /dev/null +++ b/home/dot_local/share/bin/executable_prompt @@ -0,0 +1,33 @@ +#!/bin/sh +fmt_esc() { + printf "%s$1%s" "$eo" "$ec" +} + +fmt_segment() { + content="$1" + [ -z "$content" ] && return + printf '%s%s%s -> %s' "$(fmt_esc '\e[90m')" "${content}" "$(fmt_esc '\e[30m')" "$(fmt_esc '\e[0m')" +} + +fmt_environment() { + content="$1" + [ -z "$content" ] && return + printf '%s(%s%s%s)%s ' "$(fmt_esc '\e[30;40m')" "$(fmt_esc '\e[97m')" "$content" "$(fmt_esc '\e[30;40m')" "$(fmt_esc '\e[0m')" +} + +[ -n "$1" ] && fmt_environment "$1" +fmt_environment "$VIRTUAL_ENV_PROMPT" + +# only display hostname in prompt if connected over SSH +[ -n "$SSH_CLIENT" ] && fmt_segment "$(hostname)" + +# current working directory +here="$PWD" +[ "$here" = "$HOME" ] && here="~" +fmt_segment "$(basename "$here")" + +# git status +git rev-parse --is-inside-work-tree 1> /dev/null 2> /dev/null && fmt_segment "git $(git rev-parse --abbrev-ref HEAD 2> /dev/null)" + +# exit happily +exit 0 diff --git a/home/dot_local/share/bin/executable_qrclip b/home/dot_local/share/bin/executable_qrclip new file mode 100644 index 0000000..41bdab7 --- /dev/null +++ b/home/dot_local/share/bin/executable_qrclip @@ -0,0 +1,2 @@ +#!/bin/sh +maim -usb 4 -c 0,0,0 | zbarimg --raw --quiet - diff --git a/home/dot_local/share/bin/executable_reload b/home/dot_local/share/bin/executable_reload new file mode 100644 index 0000000..4b87658 --- /dev/null +++ b/home/dot_local/share/bin/executable_reload @@ -0,0 +1,2 @@ +#!/bin/sh +i3-msg exit diff --git a/home/dot_local/share/bin/executable_rofi b/home/dot_local/share/bin/executable_rofi new file mode 100644 index 0000000..d573764 --- /dev/null +++ b/home/dot_local/share/bin/executable_rofi @@ -0,0 +1,4 @@ +#!/bin/sh +[ -e "$XDG_CONFIG_HOME/gtk-4.0/env" ] && . "$XDG_CONFIG_HOME/gtk-4.0/env" +. "$XDG_CACHE_HOME/mode/state/vars" +exec /bin/rofi -no-default-config "$@" diff --git a/home/dot_local/share/bin/executable_scene b/home/dot_local/share/bin/executable_scene new file mode 100644 index 0000000..c7faff6 --- /dev/null +++ b/home/dot_local/share/bin/executable_scene @@ -0,0 +1,56 @@ +#!/bin/sh +CACHE_FILE="$XDG_CACHE_HOME/hass-scenes" +TAB="$(printf '\t')" + +update_cache() { + rm -f "$CACHE_FILE" + curl -s -X GET \ + -H "Authorization: Bearer $HASS_TOKEN" \ + -H "Content-Type: application/json" \ + "$HASS_SERVER/api/states" |\ + jq --raw-output ' + .[] | + select(.entity_id | startswith("scene.")) | + "\(.attributes.friendly_name)\t\(.entity_id)" + ' > "$CACHE_FILE" +} + +# update cache if it does not exist +[ ! -e "$CACHE_FILE" ] && update_cache + +# update the cache if requested explicitly +[ "$1" = "--update" ] && { + update_cache + exit +} + +# update the cache if it is older than +MAX_CACHE_AGE=$(( 60 * 60 * 24 )) # one day +[ $(( $(date +%s) - $MAX_CACHE_AGE )) -gt $(date -r "$CACHE_FILE" +%s) ] && update_cache + +if [ $# -eq 0 ] ; then + # pick a scene using rofi in dmenu mode + scene="$(cat "$CACHE_FILE" |\ + rofi \ + -dmenu \ + -display-columns 1 \ + -display-column-separator "$TAB" |\ + cut -d"$TAB" -f2 |\ + jq --raw-input)" +else + # non interactive scene pick + scene="$(cat "$CACHE_FILE" |\ + grep -w "$*" | head -n1 |\ + cut -d"$TAB" -f2 |\ + jq --raw-input)" +fi + +# exit if no scene was selected / found +[ -z "$scene" ] && exit 0 + +jq -n --argjson scene "$scene" '{"entity_id": $scene}' |\ + curl -s -X POST -d @- \ + -H "Authorization: Bearer $HASS_TOKEN" \ + -H "Content-Type: application/json" \ + "$HASS_SERVER/api/services/scene/turn_on" > /dev/null + diff --git a/home/dot_local/share/bin/executable_screenrecord b/home/dot_local/share/bin/executable_screenrecord new file mode 100644 index 0000000..1045a6e --- /dev/null +++ b/home/dot_local/share/bin/executable_screenrecord @@ -0,0 +1,8 @@ +#!/bin/sh +exec giph "$@" \ + --framerate 60 \ + --select \ + --bordersize 4 \ + --color 255,255,255 \ + "$(date +'%Y-%m-%d_%H-%M-%S.mp4')" + diff --git a/home/dot_local/share/bin/executable_screenwatch b/home/dot_local/share/bin/executable_screenwatch new file mode 100644 index 0000000..d556fac --- /dev/null +++ b/home/dot_local/share/bin/executable_screenwatch @@ -0,0 +1,11 @@ +#!/bin/sh +# repeatedly open terminal at $dev, even when $dev temporarily dissapears +dev="$1" +while inotifywait -qq -e create --include "$dev" "$(dirname "$dev")"; do + sleep 0.1 # wait until device is initialized + screen "$@" + + # break out of loop if device still exists when screen exits (manual screen exit) + [ -e "$dev" ] && break +done + diff --git a/home/dot_local/share/bin/executable_sdk10_compiledb b/home/dot_local/share/bin/executable_sdk10_compiledb new file mode 100644 index 0000000..6e62d47 --- /dev/null +++ b/home/dot_local/share/bin/executable_sdk10_compiledb @@ -0,0 +1,38 @@ +#!/bin/python3 + +from shlex import split, join +from sys import argv +from os import getcwd +import subprocess + +process = subprocess.run(argv[1:], stdout=subprocess.PIPE, stderr=None, env={"LANG": "C"}) + +dir_stack = [getcwd()] +expanded_output = [] + +for line in process.stdout.decode('utf-8').split('\n'): + expanded_args = [] + args = split(line) + + if line.startswith('make: Entering directory'): + dir_stack.append(args[-1]) + expanded_output.append(line) + continue + if line.startswith('make: Leaving directory'): + dir_stack.pop() + expanded_output.append(line) + continue + + for arg in args: + if not arg.startswith('@'): + expanded_args.append(arg) + continue + with open(dir_stack[-1] + '/' + arg[1:], 'r') as file: + expanded_args += split(file.read()) + expanded_output.append(subprocess.list2cmdline(expanded_args)) + +process = subprocess.Popen(["compiledb"], stdin=subprocess.PIPE, stdout=None, stderr=None, text=True) +process.stdin.write("\n".join(expanded_output)) +process.stdin.close() +process.wait() + diff --git a/home/dot_local/share/bin/executable_set-default b/home/dot_local/share/bin/executable_set-default new file mode 100644 index 0000000..d93f65c --- /dev/null +++ b/home/dot_local/share/bin/executable_set-default @@ -0,0 +1,32 @@ +#!/bin/sh +SCRIPT_NAME="$(basename "$0")" + +usage() { + code=0 + if [ -z "$1" ] ; then + cat << EOF +Set desktop entry ENTRY as default application for opening files with the same +type as FILE + +EOF + else + echo "error: $1" >&2 + code=1 + fi + cat << EOF +usage: + $SCRIPT_NAME ENTRY FILE [FILE] +EOF + exit $code +} + +[ $# -eq 0 ] && usage +DESKTOP_ENTRY="$1"; shift +[ -z "$DESKTOP_ENTRY" ] && usage "no desktop entry" +[ $# -lt 1 ] && usage "no reference file(s)" + +for file in "$@" ; do + mimetype="$(xdg-mime query filetype "$file")" + xdg-mime default "$DESKTOP_ENTRY" "$mimetype" +done + diff --git a/home/dot_local/share/bin/executable_setwacom b/home/dot_local/share/bin/executable_setwacom new file mode 100644 index 0000000..d7427a6 --- /dev/null +++ b/home/dot_local/share/bin/executable_setwacom @@ -0,0 +1,2 @@ +#!/bin/sh +xsetwacom set "Wacom Intuos PT S 2 Pen stylus" $@ diff --git a/home/dot_local/share/bin/executable_single2folder b/home/dot_local/share/bin/executable_single2folder new file mode 100644 index 0000000..b3b2d30 --- /dev/null +++ b/home/dot_local/share/bin/executable_single2folder @@ -0,0 +1,16 @@ +#!/bin/sh +file=$1 +foldername=$(basename "$file" .flac) + +echo "mkdir \"$foldername\"" +mkdir "$foldername" + +echo "mv \"$file\" \"$foldername\"" +mv "$file" "$foldername" + +echo "extract folder.png" +metaflac --export-picture-to="${foldername}/folder.png" "${foldername}/${file}" + +echo "make sure folder.png is a png" +magick "${foldername}/folder.png" "${foldername}/folder.png" + diff --git a/home/dot_local/share/bin/executable_spec b/home/dot_local/share/bin/executable_spec new file mode 100644 index 0000000..7d500dc --- /dev/null +++ b/home/dot_local/share/bin/executable_spec @@ -0,0 +1,2 @@ +#!/bin/sh +sox "$1" -n spectrogram -o - | feh --class floating - diff --git a/home/dot_local/share/bin/executable_subrename b/home/dot_local/share/bin/executable_subrename new file mode 100644 index 0000000..16d913f --- /dev/null +++ b/home/dot_local/share/bin/executable_subrename @@ -0,0 +1,54 @@ +#!/bin/sh +file_extension=".srt" +season=1 +episode=1 + +PROGNAME="$(basename "$0")" +USAGE="$( cat << EOF +usage: $PROGNAME [-h] [-s season] [-e episode] [-x extension] file1 [file2 ...] + +rename files to s01e01.srt, s01e02.srt, etc. + +options: + -s set season number (default: $season) + -e set episode number of first file (default: $episode) + -x set file extension for output files (default: $file_extension) + -h show help + +example: + subrename -x .ja.srt *.srt +EOF +)" +usage() { + echo "$USAGE" + exit 0 +} +stupid() { + echo "use $PROGNAME -h for help" + exit 1 +} + +ARGC=0 +while getopts e:s:x:h OPT; do + [ $OPTIND -gt $ARGC ] && ARGC=$OPTIND + case "$OPT" in + e) episode="$OPTARG" ;; + h) usage ;; + s) season="$OPTARG" ;; + x) file_extension="$OPTARG" ;; + \?|*) stupid ;; + esac +done +shift "$(( $OPTIND - 1 ))" + +if [ $# -eq 0 ] ; then + echo "error: no files provided" + stupid +fi + +for file in "$@" ; do + new_filename="$(printf 's%02de%02d%s\n' "$season" "$episode" "$file_extension")" + mv --verbose "$file" "$new_filename" + episode=$(( $episode + 1 )) +done + diff --git a/home/dot_local/share/bin/executable_time2tsv b/home/dot_local/share/bin/executable_time2tsv new file mode 100644 index 0000000..4cc369d --- /dev/null +++ b/home/dot_local/share/bin/executable_time2tsv @@ -0,0 +1,107 @@ +#!/bin/awk -f + +# ignore empty or comment lines +/^\s*#/ { next } +/^\s*$/ { next } + +{ + owner = "" + date = "" + duration = 0 + description = "" +} + +function max(a, b) { + return a > b ? a : b +} + +function duration2time(duration) { + temp = 0 + num = 0 + multiplier = 60 + + split(duration, char, "") + for (i=1; i <= length(duration); i++) { + if (char[i] == "h") { + temp += num * 60 * 60 + multiplier = 60 + num = 0 + continue + } + if (char[i] == "m") { + temp += num * 60 + multiplier = 1 + num = 0 + continue + } + if (char[i] == "s") { + temp += num + multiplier = 0 + num = 0 + continue + } + + num *= 10 + num += char[i] + } + if (num > 0) { + temp += num * multiplier + } + + return temp +} + +function stripnotes(desc) { + out = "" + nestlevel = 0 + + split(desc, char, "") + for (i=1; i <= length(desc); i++) { + if (char[i] == "(") { + nestlevel += 1 + continue + } + + if (char[i] == ")") { + nestlevel = max(0, nestlevel - 1) + continue + } + + if (nestlevel > 0) continue + out = out char[i] + } + + return out +} + +# strip leading whitespace +/^\s+/ { gsub(/^\s+/, "", $0) } + +# match owner +match($0, /^[[:alpha:]]+/) { + owner = substr($0, RSTART, RLENGTH) + gsub(/^[[:alpha:]]+:?\s*/, "", $0) +} + +# match date +match($0, /^[0-9-]{10}/) { + date = substr($0, RSTART, RLENGTH) + gsub(/^[0-9-]{10}:?\s*/, "", $0) +} + +# match time +match($0, /^\<([0-9]+h)?([0-9]{1,2}m)?([0-9]{1,2}s)?\>/) { + duration = duration2time(substr($0, RSTART, RLENGTH)) + gsub(/^\<([0-9]+h)?([0-9]{1,2}m)?([0-9]{1,2}s)?\>:?\s*/, "", $0) +} + +# description +{ + description = stripnotes($0) +} + +# output +{ + printf("%s\t%s\t%s\t%s\n", owner, date, duration, description) +} + diff --git a/home/dot_local/share/bin/executable_timefmt b/home/dot_local/share/bin/executable_timefmt new file mode 100644 index 0000000..c78fb95 --- /dev/null +++ b/home/dot_local/share/bin/executable_timefmt @@ -0,0 +1,24 @@ +#!/bin/sh +[ $# -eq 0 ] && sum="$(cat)" || sum="$1" +sum="$(echo "$sum" | tr -dc '[:digit:]')" +if [ -z "$sum" ] ; then + echo "error: no input number" + exit 1 +fi + +fmt() { + # printf '%d:%02d:%02d\n' $@ | sed -e 's/^0\{2,\}//' + printf '%02dh%02dm%02ds\n' $@ | sed -e 's/00s$//' -e 's/^\(00.\)\+//' -e 's/^0\+//' +} + +fmt $(bc <<EOF +sum = $sum +seconds = sum % 60 +sum = (sum - seconds) / 60 +minutes = sum % 60 +sum = (sum - minutes) / 60 +hours = sum +print hours," ",minutes," ",seconds +EOF +) + diff --git a/home/dot_local/share/bin/executable_timerep b/home/dot_local/share/bin/executable_timerep new file mode 100644 index 0000000..e09d6c1 --- /dev/null +++ b/home/dot_local/share/bin/executable_timerep @@ -0,0 +1,82 @@ +#!/bin/sh +TAB="$(printf '\t')" +time2tsv "$@" | sort -t"$TAB" -k4 | awk -F"$TAB" ' +{ + gsub(/^\s+/, "", $4) + gsub(/\s+$/, "", $4) + desc = $4 + if (desc != last_desc && last_desc != "") { + printf("%s\t%d\n", last_desc, sum) + sum = 0 + } + sum += $3 + last_desc = desc +} +END { + printf("%s\t%d\n", last_desc, sum) +} +' | awk -F"$TAB" ' +BEGIN { + split("", last_path) # define empty array +} + +function strip(string) { + gsub(/^\s+/, "", string) + gsub(/\s+$/, "", string) + return string +} + +function repeat(str, count, i) { + out = "" + for (i = 0; i < count; i++) { + out = str out + } + return out +} +function indent(depth, i) { + return repeat(" ", depth) +} + +function printpath(new_path, new, i) { + new = 0 + for (i = 1; i <= length(new_path); i++) { + if (last_path[i] != new_path[i]) new = 1 + if (new == 0) continue + printf("%s%s\n", indent(i-1), new_path[i]) + last_path[i] = new_path[i] + } +} + +function timefmt(time, fmt) { + cmd = sprintf("timefmt %s", time) + cmd | getline fmt + close(cmd) + return fmt +} + +{ + len = split($1, path, "::") + for (i = 1; i <= len; i++) + path[i] = strip(path[i]) + + task = path[len] + delete path[len] + depth = len - 1 + sum += $2 + duration = timefmt($2) + + printpath(path) + printf("%-67s %10s\n", indent(depth) task, duration) +} + +BEGIN { + printf("\033[4m%-67s\033[0m \033[4m%10s\033[0m\n", "Description", "Total") +} + +END { + "timefmt "sum | getline duration + printf("%67s \033[4m%10s\033[0m\n", "", "") + printf("%67s %10s\n", "", duration) +} +' + diff --git a/home/dot_local/share/bin/executable_timesum b/home/dot_local/share/bin/executable_timesum new file mode 100644 index 0000000..6284ca4 --- /dev/null +++ b/home/dot_local/share/bin/executable_timesum @@ -0,0 +1,4 @@ +#!/bin/sh +TAB="$(printf '\t')" +time2tsv "$@" | cut -d"$TAB" -f3 | paste -sd+ - | bc | timefmt + diff --git a/home/dot_local/share/bin/executable_toetsrooster2ical b/home/dot_local/share/bin/executable_toetsrooster2ical new file mode 100644 index 0000000..5de58cb --- /dev/null +++ b/home/dot_local/share/bin/executable_toetsrooster2ical @@ -0,0 +1,38 @@ +#!/bin/python3 + +import sys +import xlrd +from datetime import datetime +import json +from icalendar import Calendar, Event +from uuid import uuid4 as uuid +import pytz + +workbook = xlrd.open_workbook(sys.argv[1]) +sheet = workbook.sheet_by_index(0) +cal = Calendar() + +cal.add('prodid', 'toetsrooster2ical') +cal.add('version', '2.0') + +def time_to_tuple(timestr): + return (int(timestr[0:2]), int(timestr[3:5])) + +for toets in range(8, sheet.nrows): + toetsdata = sheet.row_values(toets) + event = Event() + + date = xlrd.xldate_as_tuple(toetsdata[10], workbook.datemode) + times = toetsdata[11].split(" - ") + + event.add('summary', toetsdata[4]) + event.add('dtstart', datetime(*date[0:3], *time_to_tuple(times[0]))) + event.add('dtend', datetime(*date[0:3], *time_to_tuple(times[1]))) + event.add('location', toetsdata[14]) + + cal.add_component(event) + +f = open('out.ics', 'wb') +f.write(cal.to_ical()) +f.close() + diff --git a/home/dot_local/share/bin/executable_vdirsyncer b/home/dot_local/share/bin/executable_vdirsyncer new file mode 100644 index 0000000..7869f19 --- /dev/null +++ b/home/dot_local/share/bin/executable_vdirsyncer @@ -0,0 +1,6 @@ +#!/bin/sh +CFG_TMP="$XDG_CONFIG_HOME/vdirsyncer/config" +mkfifo --mode 700 "$CFG_TMP" +"$XDG_CONFIG_HOME/vdirsyncer/config_gen" > "$CFG_TMP" & +/usr/bin/vdirsyncer --config "$CFG_TMP" "$@" +rm -f "$CFG_TMP" diff --git a/home/dot_local/share/bin/executable_venvgen b/home/dot_local/share/bin/executable_venvgen new file mode 100644 index 0000000..25f2c78 --- /dev/null +++ b/home/dot_local/share/bin/executable_venvgen @@ -0,0 +1,47 @@ +#!/bin/sh + +# check if the input is valid +for arg in "$@" ; do + case "$arg" in + *=*) ;; + *) + echo "error: missing assignment operator in argument ($arg)" >&2 + exit 1 + ;; + esac +done + +# shebang +printf '#!/bin/sh\n' + +# save old variables +for arg in "$@" ; do + name="${arg%%=*}" + eval "hasval=\${$name+x}" + [ -n "$hasval" ] && printf '_%s="${%s}"\n' "$name" "$name" +done + +# set new variables +for arg in "$@" ; do + name="${arg%%=*}" + value="${arg#*=}" + printf 'export %s=%q\n' "$name" "$value" +done + +# deactivate function +printf 'deactivate() {\n' +for arg in "$@" ; do + name="${arg%%=*}" + eval "hasval=\${$name+x}" + if [ -n "$hasval" ] ; then + printf '\t%s="${_%s}"\n' "$name" "$name" + printf '\tunset -v _%s\n' "$name" + else + printf '\tunset -v %s\n' "$name" + fi +done +printf '\thash -r 2>/dev/null\n' +printf '\tunset -f deactivate\n' +printf '}\n' +printf 'hash -r 2>/dev/null\n' + diff --git a/home/dot_local/share/bin/executable_vodchat b/home/dot_local/share/bin/executable_vodchat new file mode 100644 index 0000000..f233348 --- /dev/null +++ b/home/dot_local/share/bin/executable_vodchat @@ -0,0 +1,3 @@ +#!/bin/sh +input_file="$1" +jq --raw-output '.replayChatItemAction.actions[].addChatItemAction.item.liveChatTextMessageRenderer | "[" + (.timestampUsec | tonumber / 1e6 | todateiso8601) + "] " + .authorName.simpleText + ": " + .message.runs[].text' "$input_file" 2>/dev/null diff --git a/home/dot_local/share/bin/executable_wacommode b/home/dot_local/share/bin/executable_wacommode new file mode 100644 index 0000000..2563895 --- /dev/null +++ b/home/dot_local/share/bin/executable_wacommode @@ -0,0 +1,58 @@ +#!/bin/sh + +defaults () { + # smoothing + setwacom Suppress 2 + setwacom RawSample 5 + + # full pen area + setwacom Area 0 0 15200 9500 + + setwacom Rotate none +} + +notify() { + notify-send \ + --replace-id=99999 \ + --icon=/dev/null \ + --expire-time=1000 \ + -- \ + 'ワコム' "$*" +} + +SCREEN_1_GEOMETRY="$(xrandr -q | awk '$2 == "connected" && $3 == "primary" { print $4 }')" +SCREEN_2_GEOMETRY="$(xrandr -q | awk '$2 == "connected" && $3 != "primary" { print $3 }')" +ALL_GEOMETRY="$(xrandr -q | awk '$1 == "Screen" { print ; exit }' | grep -o '\<current\>[^,]\+' | sed -e 's/^current//' -e 's/ //g' -e 's/$/+0+0/')" + +topleft() { + notify "画面1、横" + + setwacom MapToOutput "$SCREEN_1_GEOMETRY" +} + +bottomleft() { + notify "画面2、縦" + + setwacom Rotate ccw + setwacom MapToOutput "$SCREEN_2_GEOMETRY" +} + +topright() { + notify "画面1、横、低遅延" + + setwacom Suppress 0 + setwacom RawSample 1 + + setwacom Area 0 1623 7600 5898 + setwacom MapToOutput "$SCREEN_1_GEOMETRY" +} + +bottomright() { + notify "全ての画面、横" + + setwacom Area 0 0 11875 7600 + setwacom MapToOutput "$ALL_GEOMETRY" +} + +defaults +$1 diff --git a/home/dot_local/share/bin/executable_wacomshortcuts b/home/dot_local/share/bin/executable_wacomshortcuts new file mode 100644 index 0000000..911e7ff --- /dev/null +++ b/home/dot_local/share/bin/executable_wacomshortcuts @@ -0,0 +1,12 @@ +#!/bin/sh + +# tablet buttons +xsetwacom set "Wacom Intuos PT S 2 Pad pad" Button 3 "key +super +alt +ctrl 1 -super -alt -ctrl" +xsetwacom set "Wacom Intuos PT S 2 Pad pad" Button 1 "key +super +alt +ctrl 2 -super -alt -ctrl" +xsetwacom set "Wacom Intuos PT S 2 Pad pad" Button 9 "key +super +alt +ctrl 3 -super -alt -ctrl" +xsetwacom set "Wacom Intuos PT S 2 Pad pad" Button 8 "key +super +alt +ctrl 4 -super -alt -ctrl" + +# pen buttons +setwacom Button 2 pan +setwacom PanScrollThreshold 200 + diff --git a/home/dot_local/share/bin/executable_wacomtouch b/home/dot_local/share/bin/executable_wacomtouch new file mode 100644 index 0000000..6c1e51a --- /dev/null +++ b/home/dot_local/share/bin/executable_wacomtouch @@ -0,0 +1,14 @@ +#!/bin/sh +# print if wacom tablet has touch on or off +bye() { + echo $1 + exit +} + +[ ! -e /dev/input/by-id/usb-Wacom_Co._Ltd._Intuos_PTS-if01-event-mouse ] && bye + +if evtest --query /dev/input/by-id/usb-Wacom_Co._Ltd._Intuos_PTS-if01-event-mouse EV_SW SW_MUTE_DEVICE; then + bye "touch on" +else + bye "touch off" +fi diff --git a/home/dot_local/share/bin/executable_xbindkeys b/home/dot_local/share/bin/executable_xbindkeys new file mode 100644 index 0000000..03a2c37 --- /dev/null +++ b/home/dot_local/share/bin/executable_xbindkeys @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/xbindkeys --file "$XDG_CONFIG_HOME/xbindkeys/main" "$@" diff --git a/home/dot_local/share/bin/executable_yt-vod b/home/dot_local/share/bin/executable_yt-vod new file mode 100644 index 0000000..0eb424d --- /dev/null +++ b/home/dot_local/share/bin/executable_yt-vod @@ -0,0 +1,17 @@ +#!/bin/sh +vid="$1" +if [ -z "$vid" ] ; then + echo "usage: $0 <stream ID>" + exit 1 +fi + +url="https://youtube.com/watch?v=$vid" + +# download chat +screen -d -m -S "yt-$vid-chat" -- pause yt-dlp --live-from-start --write-sub --no-download "$url" + +# download stream +screen -d -m -S "yt-$vid-vod" -- pause yt-dlp --live-from-start -S ext "$url" + +echo "started recording! (use screen -r yt-$vid-<tab> to stop)" + diff --git a/home/dot_local/share/bin/symlink_mode b/home/dot_local/share/bin/symlink_mode new file mode 100644 index 0000000..da230d2 --- /dev/null +++ b/home/dot_local/share/bin/symlink_mode @@ -0,0 +1 @@ +../mode/mode diff --git a/home/dot_local/share/bin/symlink_sh b/home/dot_local/share/bin/symlink_sh new file mode 100644 index 0000000..ff99e34 --- /dev/null +++ b/home/dot_local/share/bin/symlink_sh @@ -0,0 +1 @@ +/usr/bin/dash diff --git a/home/dot_local/share/fcitx5/themes/mode/base.conf b/home/dot_local/share/fcitx5/themes/mode/base.conf new file mode 100644 index 0000000..e329a4f --- /dev/null +++ b/home/dot_local/share/fcitx5/themes/mode/base.conf @@ -0,0 +1,42 @@ +# vim:ft=dosini +[Metadata] +Name=mode +Version=0.1 +Author=lonkaars +Description=theme generated by mode +ScaleWithDPI=True + +[InputPanel] +Font=sans-serif 12 + +[InputPanel/Background/Margin] +Left=0 +Right=0 +Top=0 +Bottom=0 + +[Menu/Background/Margin] +Left=0 +Right=0 +Top=0 +Bottom=0 + +[Menu/ContentMargin] +Left=0 +Right=0 +Top=0 +Bottom=0 + +[Menu/Highlight/Margin] +Left=0 +Right=0 +Top=0 +Bottom=0 + +[Menu/TextMargin] +Left=0 +Right=0 +Top=0 +Bottom=0 + + diff --git a/home/dot_local/share/mode/executable_mode b/home/dot_local/share/mode/executable_mode new file mode 100644 index 0000000..dc188e9 --- /dev/null +++ b/home/dot_local/share/mode/executable_mode @@ -0,0 +1,148 @@ +#!/usr/bin/env sh +progname="$(basename "$0")" +data="$(dirname "$(readlink -f "$0")")" +export data # path to directory containing reload.d, switch.d, etc. + +run_switch=1 +run_reload=1 +no_cfg=0 +theme="" # absolute path to theme + +# print error message and exit with error +stupid() { + echo "$@" >&2 + echo "run \`$progname --help\` for options" >&2 + exit 1 +} + +usage() { + cat << EOF +$progname -- switch system themes + +usage: + $progname [-chr] action|theme + +options: + -s, --no-switch disable running switch.d hooks + -c, --no-cfggen disable generation of templated configuration files + -h, --help display this help text + -r, --no-reload disable reloading of applications after applying theme + +actions: + restore switch to last set theme ($XDG_CACHE_HOME/mode/state/theme) + reload do not update configuration files, only reload applications + help same as --help option + list list all themes + +examples: + mode dark switch to dark mode and reload applications + mode restore --no-reload make sure all configuration files are up-to-date + mode reload only reload applications + +EOF +} + +# run a module file +run_mod() { + mod_name="$1" + + # modules must be executable + ! [ -x "$mod_name" ] && return + + # parse interpreter from shebang + interpreter="$(basename "$(command -v $(head -n1 "$mod_name" | sed -n 's/^#!\(.*\)/\1/p'))")" + if [ "$interpreter" = "sh" ] ; then + # source module if interpreter is POSIX sh (makes plugin functions available) + ( . "$mod_name" ) + else + # else, just run them + "$mod_name" + fi +} + +# generate config files from theme file using scripts in switch.d +switch() { + [ -z "$theme" ] && stupid "error: no theme selected" + [ ! -e "$theme" ] && stupid "error: theme not found" + export theme + + theme_name="$(basename "$theme")" + echo "setting theme to $theme_name..." + + # clean up environment + unset accent accent_text + unset mode + + # load theme colors + aux variables + . "$theme" + + # load plugins (TODO: plugins aren't loaded when only reloading) + for plugin in "$data"/plug.d/* ; do . "$plugin" ; done + + # generate new config files / snippets (in parallel) + for switch_function in "$data"/switch.d/* ; do + run_mod "$switch_function" & + done + + # join all processes started above + wait $(jobs -p) +} + +# reload programs using scripts in reload.d +reload() { + echo "reloading programs..." + + for reload_function in "$data"/reload.d/* ; do + run_mod "$reload_function" & + done + + wait $(jobs -p) +} + +# main program argument parser (later argument always take priority) +for arg in "$@" ; do + case "$arg" in + # stop parsing arguments after -- + --) break ;; + # help + -h|--help|help) usage && exit 0 ;; + # only run reload scripts + reload) run_reload=1 run_switch=0 ;; + # prevent reload.d scripts from running + -r|--no-reload) run_reload=0 ;; + # prevent switch.d scripts from running + -s|--no-switch) run_switch=0 ;; + # prevent switch.d scripts from running + -c|--no-cfggen) no_cfg=1 ;; + # restore previous theme stored as symlink (see switch.d/mode) + restore) + theme="$(readlink -f "$XDG_CACHE_HOME/mode/state/theme")" + [ ! -e "$theme" ] && stupid "error: could not locate previous theme" + ;; + # list themes in themes folder + list) + find "$data/themes" -type f,l | while read -r theme ; do + printf '%s' "$(basename "$theme")" + link="$(readlink "$theme")" && printf ' (%s)' "$link" + printf '\n' + done + exit 0 + ;; + *) + # check if unknown argument is a theme name + if [ -e "$data/themes/$arg" ] ; then + theme="$(readlink -f "$data/themes/$arg")" + continue + fi + # else throw error + stupid "error: unknown argument or theme: $arg" + ;; + esac +done + +export no_cfg + +# main +[ $run_switch -eq 1 ] && switch +[ $run_reload -eq 1 ] && reload + diff --git a/home/dot_local/share/mode/plug.d/10_lib b/home/dot_local/share/mode/plug.d/10_lib new file mode 100644 index 0000000..b3a0276 --- /dev/null +++ b/home/dot_local/share/mode/plug.d/10_lib @@ -0,0 +1,46 @@ +#!/bin/sh +# utility library functions +hex_to_rgb_array() { pastel format rgb "$1" | cut -c4- | tr '()' '[]' ; } + +mix_rgb() { pastel mix --colorspace=RGB --fraction="$3" "$1" "$2" | pastel format hex ; } + +getvar() { + key="$1" + eval "printf '%s' \"\$$key\"" +} + +setvar() { + key="$1" + value="$2" + eval "$key='$(printf '%s' "$value")'" +} + +themevar() { + key="$1" + if [ $# -eq 1 ] ; then + value="$(getvar "$key")" + else + value="$2" + setvar "$key" "$value" + fi + + vars="$vars +$(printf "export %s='%s'" "$key" "$value")" + eval "export $key" +} + +mkcd() { + mkdir -p "$1" + cd "$1" +} + +respawn_daemon() { + killall -q "$1" && fork "$@" +} + +silent_fail_if_no_commmand() { + for name in "$@" ; do + [ -z "$(command -v "$name")" ] && exit + done +} + diff --git a/home/dot_local/share/mode/plug.d/20_export_colors b/home/dot_local/share/mode/plug.d/20_export_colors new file mode 100644 index 0000000..0f53d1f --- /dev/null +++ b/home/dot_local/share/mode/plug.d/20_export_colors @@ -0,0 +1,17 @@ +#!/bin/sh +# colors must be #RRGGBB +check_color() { + ( + eval "color=\"\${$1}\"" + exit "$(echo "$color" | sed -n '/^#[0-9a-fA-F]\{6\}$/p' | wc -l)" + ) + if [ $? -ne 1 ] ; then + echo "error: color $1 is not properly formatted (#RRGGBB)" + stupid && exit 1 + fi + themevar "$1" +} +for color in $(seq 0 15 | sed 's/^/color/') bg fg ; do + check_color $color +done + diff --git a/home/dot_local/share/mode/plug.d/20_export_mode b/home/dot_local/share/mode/plug.d/20_export_mode new file mode 100644 index 0000000..c82c4e1 --- /dev/null +++ b/home/dot_local/share/mode/plug.d/20_export_mode @@ -0,0 +1,9 @@ +#!/bin/sh +# $mode = "light" | "dark" +if [ "$mode" != 'dark' ] && [ "$mode" != 'light' ] ; then + pastel format hsl-lightness "$bg" | awk '{ exit($1 > 0.5) }' + [ $? -eq 0 ] && mode=dark || mode=light + echo "warn: theme $theme did not define \$mode as \"light\" or \"dark\", guessed $mode" >&2 +fi +themevar mode + diff --git a/home/dot_local/share/mode/plug.d/20_export_vim_theme b/home/dot_local/share/mode/plug.d/20_export_vim_theme new file mode 100644 index 0000000..12304f3 --- /dev/null +++ b/home/dot_local/share/mode/plug.d/20_export_vim_theme @@ -0,0 +1,6 @@ +#!/bin/sh +# warn if the vim theme is not installed +if [ "$(find "$XDG_CONFIG_HOME/nvim" -name "$vim_theme_name.vim" | wc -l)" -eq 0 ] ; then + echo "warn: vim theme $vim_theme_name does not appear to be installed" >&2 +fi +themevar vim_theme_name diff --git a/home/dot_local/share/mode/plug.d/50_accent b/home/dot_local/share/mode/plug.d/50_accent new file mode 100644 index 0000000..ceb3209 --- /dev/null +++ b/home/dot_local/share/mode/plug.d/50_accent @@ -0,0 +1,15 @@ +#!/bin/sh +# create accent color differently for dark/light mode + +# do not generate accent color if already explicitly defined by theme +[ -n "$accent" ] && return + +if [ "$mode" = "light" ] ; then + themevar accent "$color15" + themevar accent_text "$color0" +fi +if [ "$mode" = "dark" ] ; then + themevar accent "$(mix_rgb $bg $color0 0.5)" + themevar accent_text "$fg" +fi + diff --git a/home/dot_local/share/mode/reload.d/brave b/home/dot_local/share/mode/reload.d/brave new file mode 100644 index 0000000..6f6caeb --- /dev/null +++ b/home/dot_local/share/mode/reload.d/brave @@ -0,0 +1,80 @@ +#!/bin/sh +# WIP +browser='brave' +driver='chromedriver' +devtools_addr='localhost:9222' +url_base='http://localhost:9515' + +command -v "$browser" > /dev/null && command -v "$driver" > /dev/null +[ $? -ne 0 ] && exit 0 + +get() { curl -s -o - -X GET "$@" ; } +post() { curl -s -o - -X POST -H 'Content-Type: application/json' -d @- "$@" ; } +delete() { curl -s -X DELETE "$@" > /dev/null ; } + +$driver --silent > /dev/null & +sleep 0.1 # (wait for chromedriver to start server) + +create_session() { + args="$(jq --raw-input --slurp 'split("\n") | map(select(. != ""))' << EOF +new-window +headless=new +EOF + )" + jq -nc \ + --arg name "$browser" \ + --arg debugger "$devtools_addr" \ + --argjson args "$args" \ + '{ + desiredCapabilities: { + "browserName": $name, + "goog:chromeOptions": { + binary: $name, + args: $args, + debuggerAddress: $debugger + }, + } + }' |\ + post "$url_base/session" |\ + jq --raw-output '.sessionId' +} + +navigate() { + jq -nc --arg url "$1" '{"url": $url}' |\ + post "$url_base/url" > /dev/null +} + +script() { + jq -nc --arg script "$1" '{"script": $script, args: []}' |\ + post "$url_base/execute/sync" > /dev/null +} + +create_tab() { + handle="$(jq -nc '{"type": "tab"}' |\ + post "$url_base/window/new" |\ + jq --raw-output '.value.handle')" + jq -nc --arg handle "$handle" '{"name": $handle}' |\ + post "$url_base/window" > /dev/null +} + +# create session +session_id="$(create_session)" +url_base="$url_base/session/$session_id" +create_tab + +# set chrome theme +navigate 'brave://settings' +script "chrome.send(\"setBraveThemeType\", [$([ "$mode" = "light" ] && echo "2" || echo "1")])" + +# todo: reload theme extension +# navigate 'brave://extensions' +# - run `chrome.developerPrivate.loadUnpacked()` (TODO: how to handle inputting file path non-interactively) +# TODO: how to use chromedriver from script (preferably without nodejs+npm or python3+pip dependencies?) + +# cleanup +delete "$url_base/window" +delete "$url_base" +kill $(jobs -p) +wait $(jobs -p) + +# reference: https://w3c.github.io/webdriver/ diff --git a/home/dot_local/share/mode/reload.d/executable_dunst b/home/dot_local/share/mode/reload.d/executable_dunst new file mode 100644 index 0000000..430320c --- /dev/null +++ b/home/dot_local/share/mode/reload.d/executable_dunst @@ -0,0 +1,3 @@ +#!/bin/sh +respawn_daemon dunst + diff --git a/home/dot_local/share/mode/reload.d/executable_fcitx5 b/home/dot_local/share/mode/reload.d/executable_fcitx5 new file mode 100644 index 0000000..cd27698 --- /dev/null +++ b/home/dot_local/share/mode/reload.d/executable_fcitx5 @@ -0,0 +1,3 @@ +#!/bin/sh +fork fcitx5 -rd + diff --git a/home/dot_local/share/mode/reload.d/executable_i3 b/home/dot_local/share/mode/reload.d/executable_i3 new file mode 100644 index 0000000..96212cf --- /dev/null +++ b/home/dot_local/share/mode/reload.d/executable_i3 @@ -0,0 +1,2 @@ +#!/bin/sh +fork i3-msg reload diff --git a/home/dot_local/share/mode/reload.d/executable_nvim b/home/dot_local/share/mode/reload.d/executable_nvim new file mode 100644 index 0000000..cfabcc7 --- /dev/null +++ b/home/dot_local/share/mode/reload.d/executable_nvim @@ -0,0 +1,6 @@ +#!/bin/sh +silent_fail_if_no_commmand nvr +nvr --serverlist | while read -r nvim_socket ; do + fork nvr --nostart --servername "$nvim_socket" -c 'source $XDG_CONFIG_HOME/nvim/mode.vim' +done + diff --git a/home/dot_local/share/mode/reload.d/executable_polybar b/home/dot_local/share/mode/reload.d/executable_polybar new file mode 100644 index 0000000..1976811 --- /dev/null +++ b/home/dot_local/share/mode/reload.d/executable_polybar @@ -0,0 +1,3 @@ +#!/bin/sh +fork polybar-msg cmd restart + diff --git a/home/dot_local/share/mode/reload.d/executable_term b/home/dot_local/share/mode/reload.d/executable_term new file mode 100644 index 0000000..b711d56 --- /dev/null +++ b/home/dot_local/share/mode/reload.d/executable_term @@ -0,0 +1,30 @@ +#!/bin/sh +escape_msgs="$(cat << EOF | tr -d '\n' +\033]11;$bg\007 +\033]10;$fg\007 +\033]12;$fg\007 +\033]14;$bg\007 +\033]13;$fg\007 +\033]17;$color8\007 +\033]708;$bg\007 +\033]4;0;$color0\007 +\033]4;1;$color1\007 +\033]4;2;$color2\007 +\033]4;3;$color3\007 +\033]4;4;$color4\007 +\033]4;5;$color5\007 +\033]4;6;$color6\007 +\033]4;7;$color7\007 +\033]4;8;$color8\007 +\033]4;9;$color9\007 +\033]4;10;$color10\007 +\033]4;11;$color11\007 +\033]4;12;$color12\007 +\033]4;13;$color13\007 +\033]4;14;$color14\007 +\033]4;15;$color15\007 +EOF +)" + +find /dev/pts -exec sh -c "printf '$escape_msgs' > {}" \; 2> /dev/null + diff --git a/home/dot_local/share/mode/reload.d/gtk b/home/dot_local/share/mode/reload.d/gtk new file mode 100644 index 0000000..767969d --- /dev/null +++ b/home/dot_local/share/mode/reload.d/gtk @@ -0,0 +1,8 @@ +#!/bin/sh +# this is max jank but xfsettingsd does other things besides live gtk theme +# reloading, and i don't like having it running constantly because it fucks +# up fcitx5 and xbindkeys +fork xfsettingsd --replace +sleep 1 +killall -q xfsettingsd + diff --git a/home/dot_local/share/mode/switch.d/executable_anki b/home/dot_local/share/mode/switch.d/executable_anki new file mode 100644 index 0000000..7572b00 --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_anki @@ -0,0 +1,120 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +# this generates theme files compatible with Anki-redesign: +# <https://ankiweb.net/shared/info/308574457> +# <https://github.com/shirajuki/anki-redesign> +ANKI_REDESIGN="$XDG_DATA_HOME/Anki2/addons21/308574457" + +# ensure folders exist +mkdir -p "$ANKI_REDESIGN/user_files/themes" + +# ensure theme is set to mode +CONFIG="$ANKI_REDESIGN/config.json" +[ -e "$CONFIG" ] && jq '.theme = "mode"' "$CONFIG" | sponge "$CONFIG" + +name() { + key="$1" + value="$2" + key_json="$(printf '%s' "$key" | tr '[:lower:]' '[:upper:]' | tr -c '[:alnum:]' '_')" + key_css="--$(printf '%s' "$key" | tr '[:upper:]' '[:lower:]' | tr -c '[:alnum:]' '-')" + echo "\"$key_json\": [ \"\", \"\", \"$value\", \"$value\", \"$key_css\" ]" +} + +unused="#ff00ff" +surface_0=$(mix_rgb $bg '#000000' 0.7) +surface_1=$(mix_rgb $color0 $bg 0.40) +surface_2=$(mix_rgb $color0 $bg 0.60) + +cat << EOF > "$ANKI_REDESIGN/user_files/themes/mode.json" +{ + "colors": { + $(name accent-card "$color4"), + $(name accent-danger "$color1"), + $(name accent-note "$color2"), + $(name border "$bg"), + $(name border-focus "#3b82f6"), + $(name border-strong "#020202"), + $(name border-subtle "$bg"), + $(name buried-fg "#777733"), + $(name button-bg "$surface_1"), + $(name button-disabled "$bg"), + $(name button-focus-bg "#0093d0"), + $(name button-gradient-end "$surface_2"), + $(name button-gradient-start "$surface_2"), + $(name button-hover-border "$accent"), + $(name button-primary-bg "$accent"), + $(name button-primary-disabled "#4484ed"), + $(name button-primary-gradient-end "$accent"), + $(name button-primary-gradient-start "$accent"), + $(name canvas "$bg"), + $(name canvas-code "$surface_0"), + $(name canvas-elevated "$bg"), + $(name canvas-inset "$surface_1"), + $(name canvas-overlay "$bg"), + $(name current-deck "$unused"), + $(name disabled "#777"), + $(name faint-border "#29292b"), + $(name fg "$fg"), + $(name fg-disabled "#737373"), + $(name fg-faint "$color0"), + $(name fg-link "#bfdbfe"), + $(name fg-subtle "#858585"), + $(name flag1-bg "#aa5555"), + $(name flag1-fg "#ff7b7b"), + $(name flag2-bg "#ac653a"), + $(name flag2-fg "#f5aa41"), + $(name flag3-bg "#559238"), + $(name flag3-fg "#86ce5d"), + $(name flag4-bg "#506aa3"), + $(name flag4-fg "#6f9dff"), + $(name flag5-bg "#975d8f"), + $(name flag5-fg "#f097e4"), + $(name flag6-bg "#399185"), + $(name flag6-fg "#5ccfca"), + $(name flag7-bg "#624b77"), + $(name flag7-fg "#9f63d3"), + $(name flag-1 "$color9"), + $(name flag-2 "$color11"), + $(name flag-3 "$color10"), + $(name flag-4 "$color12"), + $(name flag-5 "$color13"), + $(name flag-6 "$color14"), + $(name flag-7 "$color5"), + $(name focus-shadow "#0093d0"), + $(name frame-bg "$surface_1"), + $(name highlight-bg "$accent"), + $(name highlight-fg "$accent_text"), + $(name learn-count "#ff935b"), + $(name link "#77ccff"), + $(name marked-bg "#77c"), + $(name medium-border "#444"), + $(name new-count "#77ccff"), + $(name review-count "#5ccc00"), + $(name scrollbar-bg "$surface_1"), + $(name scrollbar-bg-active "$surface_2"), + $(name scrollbar-bg-hover "$surface_2"), + $(name selected-bg "rgba(147, 197, 253, 0.5)"), + $(name selected-fg "$fg"), + $(name shadow "#141414"), + $(name shadow-focus "#6366f1"), + $(name shadow-inset "#202020"), + $(name shadow-subtle "#363636"), + $(name slightly-grey-text "#ccc"), + $(name state-buried "#92400e"), + $(name state-learn "$color1"), + $(name state-marked "#a855f7"), + $(name state-new "$color4"), + $(name state-review "$color2"), + $(name state-suspended "#fef9c3"), + $(name suspended-bg "#aaaa33"), + $(name suspended-fg "#ffffb2"), + $(name text-fg "$fg"), + $(name tooltip-bg "$surface_1"), + $(name window-bg "$bg"), + $(name zero-count "#444") + }, + "version": { "major": -1, "minor": -1 } +} +EOF + diff --git a/home/dot_local/share/mode/switch.d/executable_chromium b/home/dot_local/share/mode/switch.d/executable_chromium new file mode 100644 index 0000000..0ea2caa --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_chromium @@ -0,0 +1,48 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_CACHE_HOME/mode/chromium" + +rm -f 'Cached Theme.pak' + +magick -size 100x100 "xc:$bg" 'bg.png' +bg_alt=$(mix_rgb $bg $color0 0.65) +fg_alt=$(mix_rgb $fg $color15 0.35) + +bg="$(hex_to_rgb_array "$bg")" +fg="$(hex_to_rgb_array "$fg")" +bg_alt="$(hex_to_rgb_array "$bg_alt")" +fg_alt="$(hex_to_rgb_array "$fg_alt")" + +cat << EOF > 'manifest.json' +{ + "description": "colorscheme generated by mode", + "manifest_version": 2, + "name": "mode theme", + "theme": { + "images": { "theme_frame": "bg.png" }, + "colors": { + "frame": $bg_alt, + "button_background": $fg, + "ntp_background": $bg, + "ntp_text": $bg_alt, + "toolbar": $bg, + "toolbar_button_icon": $fg, + "tab_background_text": $fg_alt, + "tab_background_text_inactive": $fg_alt, + "tab_background_text_incognito": $fg_alt, + "tab_background_text_incognito_inactive": $fg_alt, + "bookmark_text": $fg, + "tab_text": $fg + }, + "tints": { + "buttons": [ -1, -1, -1 ], + "frame_inactive": [ -1, -1, -1 ], + "frame_incognito": [ -1, -1, -1 ], + "frame_incognito_inactive": [ -1, -1, -1 ] + } + }, + "version": "2" +} +EOF + diff --git a/home/dot_local/share/mode/switch.d/executable_discord b/home/dot_local/share/mode/switch.d/executable_discord new file mode 100644 index 0000000..dd7e5e3 --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_discord @@ -0,0 +1,34 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_CONFIG_HOME/BetterDiscord/themes" +cat << EOF > 'mode.theme.css' +/** + * @name mode + * @author mode + * @version 0 +*/ + +/* AUTOMATICALLY GENERATED, DO NOT EDIT */ + +.theme-dark, .theme-light { + --background-primary: $bg; + --background-secondary: $bg; + --background-secondary-alt: $bg; + --text-primary: $fg; + --text-secondary: $color15; + --accent: $color4; + --accent-alt: $color12; + --error: $color1; + --error-alt: $color9; +} + +.theme-dark { + --background-tertiary: $(mix_rgb $bg '#000000' 0.7); +} + +.theme-light { + --background-tertiary: $bg; +} +EOF + diff --git a/home/dot_local/share/mode/switch.d/executable_dunst b/home/dot_local/share/mode/switch.d/executable_dunst new file mode 100644 index 0000000..d7d9a2b --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_dunst @@ -0,0 +1,24 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_CONFIG_HOME/dunst" +cat 'base' - << EOF > 'dunstrc' +frame_color = "$accent" + +[urgency_low] +background = "$bg" +foreground = "$fg" +timeout = 10 + +[urgency_normal] +background = "$bg" +foreground = "$fg" +timeout = 10 + +[urgency_critical] +background = "$color1" +foreground = "$bg" +frame_color = "$color1" +timeout = 0 +EOF + diff --git a/home/dot_local/share/mode/switch.d/executable_fcitx5 b/home/dot_local/share/mode/switch.d/executable_fcitx5 new file mode 100644 index 0000000..2cc6ccb --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_fcitx5 @@ -0,0 +1,67 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_DATA_HOME/fcitx5/themes/mode" +rounding=6 +size=$(( 2 * $rounding + 4 )) +margin_h=6 +margin_v=4 + +bg='#000000' +fg='#ffffff' +accent='#404040' +accent_text=$fg +sel_bg=$(mix_rgb $color12 $bg 0.4) +sel_fg=$fg + +magick \ + -size ${size}x${size} xc:transparent \ + -fill xc:"$accent" \ + -draw "roundrectangle 0,0 $(( $size - 1 )),$(( $size - 1 )) $rounding,$rounding" \ + highlight.png + +cat base.conf - << EOF > theme.conf +[InputPanel] +NormalColor=$fg +HighlightCandidateColor=$accent_text +HighlightColor=$sel_fg +HighlightBackgroundColor=$sel_bg + +[InputPanel/Background] +Color=$bg + +[InputPanel/Highlight] +Image=highlight.png + +[InputPanel/Highlight/Margin] +Left=$rounding +Right=$rounding +Top=$rounding +Bottom=$rounding + +[InputPanel/ContentMargin] +Left=$(( 2 + $rounding - $margin_h )) +Right=$(( 2 + $rounding - $margin_h )) +Top=$(( 2 + $rounding - $margin_v )) +Bottom=$(( 2 + $rounding - $margin_v )) + +[InputPanel/TextMargin] +Left=$margin_h +Right=$margin_h +Top=$margin_v +Bottom=$margin_v + +[Menu] +NormalColor=$fg + +[Menu/Background] +Color=$bg + +[Menu/Highlight] +Color=$accent + +[Menu/Separator] +Color=$color7 + +EOF + diff --git a/home/dot_local/share/mode/switch.d/executable_gtk b/home/dot_local/share/mode/switch.d/executable_gtk new file mode 100644 index 0000000..95d3e53 --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_gtk @@ -0,0 +1,11 @@ +#!/bin/sh +GTK_3_SETTINGS_INI="$XDG_CONFIG_HOME/gtk-3.0/settings.ini" +if [ "$mode" = "light" ]; then + sed -e 's/-Dark/-Light/' -e 's/-dark/-light/' -i "$GTK_3_SETTINGS_INI" + sed "s/gtk-application-prefer-dark-theme.*/gtk-application-prefer-dark-theme=false/" -i "$GTK_3_SETTINGS_INI" +else + sed -e 's/-Dark/-Light/' -e 's/-dark/-light/' -i "$GTK_3_SETTINGS_INI" + sed "s/gtk-application-prefer-dark-theme.*/gtk-application-prefer-dark-theme=true/" -i "$GTK_3_SETTINGS_INI" +fi +grep gtk-theme-name "$GTK_3_SETTINGS_INI" | cut -f2 -d= | xargs xfconf-query -c xsettings -p /Net/ThemeName -s + diff --git a/home/dot_local/share/mode/switch.d/executable_i3 b/home/dot_local/share/mode/switch.d/executable_i3 new file mode 100644 index 0000000..713869e --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_i3 @@ -0,0 +1,14 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +indicator="$color0" +mkcd "$XDG_CONFIG_HOME/i3" +cat << EOF > 'color.conf' +client.focused $fg $bg $fg $indicator $bg +client.focused_inactive $bg $bg $fg $indicator $bg +client.unfocused $bg $bg $fg $indicator $bg +client.urgent $bg $bg $fg $indicator $bg +client.placeholder $bg $bg $fg $indicator $bg +client.background $bg +EOF + diff --git a/home/dot_local/share/mode/switch.d/executable_kitty b/home/dot_local/share/mode/switch.d/executable_kitty new file mode 100644 index 0000000..eeb81d0 --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_kitty @@ -0,0 +1,27 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_CONFIG_HOME/kitty" + +cat << EOF > 'color.conf' +background $bg +foreground $fg + +color0 $color0 +color1 $color1 +color2 $color2 +color3 $color3 +color4 $color4 +color5 $color5 +color6 $color6 +color7 $color7 +color8 $color8 +color9 $color9 +color10 $color10 +color11 $color11 +color12 $color12 +color13 $color13 +color14 $color14 +color15 $color15 +EOF + diff --git a/home/dot_local/share/mode/switch.d/executable_mode b/home/dot_local/share/mode/switch.d/executable_mode new file mode 100644 index 0000000..8866486 --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_mode @@ -0,0 +1,10 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_CACHE_HOME/mode/state" + +echo "$mode" > mode +rm theme +ln -sf "$theme" theme +echo "#!/bin/sh$vars" > vars + diff --git a/home/dot_local/share/mode/switch.d/executable_polybar b/home/dot_local/share/mode/switch.d/executable_polybar new file mode 100644 index 0000000..7087735 --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_polybar @@ -0,0 +1,16 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_CONFIG_HOME/polybar" +cat << EOF > 'colors.ini' +[color] +bg = \${xrdb:background:$bg} +fg = \${xrdb:foreground:$fg} +fg-alt = \${xrdb:background:$bg} +fg-half = \${xrdb:color8:$color8} + +alpha = #00000000 + +; vim:ft=dosini +EOF + diff --git a/home/dot_local/share/mode/switch.d/executable_vim b/home/dot_local/share/mode/switch.d/executable_vim new file mode 100644 index 0000000..2220b1a --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_vim @@ -0,0 +1,59 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_CONFIG_HOME/nvim/mode" + +# lightline +cat << EOF > 'lightline.vim' +let s:bg = [ '$bg', 'NONE' ] +let s:fg = [ '$fg', 'NONE' ] +let s:mode = [ '$color0', 'NONE' ] +let s:faint = [ '$color8', 'NONE' ] +let s:none = [ 'NONE', 'NONE' ] +let s:test = [ '#ff00ff', 'NONE' ] + +let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}} +let s:p.normal.left = [ [ s:fg, s:mode ], [ s:faint, s:bg ] ] +let s:p.normal.right = [ [ s:faint, s:bg ] ] +let s:p.normal.middle = [ [ s:bg, s:bg ] ] +let s:p.normal.error = [ [ s:test, s:test ] ] +let s:p.normal.warning = [ [ s:test, s:test ] ] +let s:p.inactive.left = copy(s:p.normal.left) +let s:p.inactive.right = copy(s:p.normal.right) +let s:p.inactive.middle = copy(s:p.normal.middle) +let s:p.insert.left = copy(s:p.normal.left) +let s:p.replace.left = copy(s:p.insert.left) +let s:p.visual.left = copy(s:p.insert.left) +let s:p.tabline.left = copy(s:p.normal.right) +let s:p.tabline.tabsel = [ [ s:fg, s:mode ] ] +let s:p.tabline.middle = copy(s:p.normal.right) +let s:p.tabline.right = copy(s:p.normal.right) + +let g:lightline#colorscheme#auto#palette = lightline#colorscheme#flatten(s:p) +EOF + +# terminal colors +cat << EOF > 'termcolors.vim' +let g:terminal_color_0 = '$color0' +let g:terminal_color_1 = '$color1' +let g:terminal_color_2 = '$color2' +let g:terminal_color_3 = '$color3' +let g:terminal_color_4 = '$color4' +let g:terminal_color_5 = '$color5' +let g:terminal_color_6 = '$color6' +let g:terminal_color_7 = '$color7' +let g:terminal_color_8 = '$color8' +let g:terminal_color_9 = '$color9' +let g:terminal_color_10 = '$color10' +let g:terminal_color_11 = '$color11' +let g:terminal_color_12 = '$color12' +let g:terminal_color_13 = '$color13' +let g:terminal_color_14 = '$color14' +let g:terminal_color_15 = '$color15' +EOF + +# color scheme +cat << EOF > 'colorscheme.vim' +colorscheme $vim_theme_name +EOF + diff --git a/home/dot_local/share/mode/switch.d/executable_wall b/home/dot_local/share/mode/switch.d/executable_wall new file mode 100644 index 0000000..c5ced92 --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_wall @@ -0,0 +1,2 @@ +#!/bin/sh +bgcol "$bg" diff --git a/home/dot_local/share/mode/switch.d/executable_xrdb b/home/dot_local/share/mode/switch.d/executable_xrdb new file mode 100644 index 0000000..591a530 --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_xrdb @@ -0,0 +1,22 @@ +#!/bin/sh +cat << EOF | xrdb -override +*.color0: $color0 +*.color1: $color1 +*.color2: $color2 +*.color3: $color3 +*.color4: $color4 +*.color5: $color5 +*.color6: $color6 +*.color7: $color7 +*.color8: $color8 +*.color9: $color9 +*.color10: $color10 +*.color11: $color11 +*.color12: $color12 +*.color13: $color13 +*.color14: $color14 +*.color15: $color15 +*.foreground: $fg +*.background: $bg +EOF + diff --git a/home/dot_local/share/mode/switch.d/executable_zathura b/home/dot_local/share/mode/switch.d/executable_zathura new file mode 100644 index 0000000..8d7e311 --- /dev/null +++ b/home/dot_local/share/mode/switch.d/executable_zathura @@ -0,0 +1,27 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_CONFIG_HOME/zathura" +cat << EOF > 'colors' +set completion-bg "$bg" +set completion-fg "$fg" +set completion-highlight-bg "$accent" +set completion-highlight-fg "$accent_text" +set default-bg "$bg" +set default-fg "$fg" +set highlight-active-color "$(echo "$accent" | pastel set alpha 0.5 | pastel format rgb)" +set highlight-color "$(echo "$accent_text" | pastel set alpha 0.5 | pastel format rgb)" +set inputbar-bg "$bg" +set inputbar-fg "$fg" +set notification-bg "$bg" +set notification-error-bg "$color9" +set notification-error-fg "$bg" +set notification-fg "$fg" +set notification-warning-bg "$color9" +set notification-warning-fg "$bg" +set recolor-darkcolor "$fg" +set recolor-lightcolor "$bg" +set statusbar-bg "$bg" +set statusbar-fg "$fg" +EOF + diff --git a/home/dot_local/share/mode/themes/github-black b/home/dot_local/share/mode/themes/github-black new file mode 100644 index 0000000..34b507c --- /dev/null +++ b/home/dot_local/share/mode/themes/github-black @@ -0,0 +1,25 @@ +#!/bin/sh +mode=dark + +color0='#484f58' +color1='#ffa198' +color2='#56d364' +color3='#e3b341' +color4='#79c0ff' +color5='#d2a8ff' +color6='#56d4dd' +color7='#b1bac4' +color8='#6e7681' +color9='#ff7b72' +color10='#3fb950' +color11='#d29922' +color12='#58a6ff' +color13='#bc8cff' +color14='#39c5cf' +color15='#ffffff' + +bg='#000000' +fg='#e6edf3' + +vim_theme_name='ghdark' + diff --git a/home/dot_local/share/mode/themes/github-dark b/home/dot_local/share/mode/themes/github-dark new file mode 100644 index 0000000..577106c --- /dev/null +++ b/home/dot_local/share/mode/themes/github-dark @@ -0,0 +1,25 @@ +#!/bin/sh +mode=dark + +color0='#484f58' +color1='#ffa198' +color2='#56d364' +color3='#e3b341' +color4='#79c0ff' +color5='#d2a8ff' +color6='#56d4dd' +color7='#b1bac4' +color8='#6e7681' +color9='#ff7b72' +color10='#3fb950' +color11='#d29922' +color12='#58a6ff' +color13='#bc8cff' +color14='#39c5cf' +color15='#ffffff' + +bg='#0d1117' +fg='#e6edf3' + +vim_theme_name='ghdark' + diff --git a/home/dot_local/share/mode/themes/github-light b/home/dot_local/share/mode/themes/github-light new file mode 100644 index 0000000..d0162f8 --- /dev/null +++ b/home/dot_local/share/mode/themes/github-light @@ -0,0 +1,25 @@ +#!/bin/sh +mode=light + +color0='#d1d5da' +color1='#cb2431' +color2='#22863a' +color3='#b08800' +color4='#005cc5' +color5='#5a32a3' +color6='#3192aa' +color7='#6a737d' +color8='#959da5' +color9='#d73a49' +color10='#28a745' +color11='#dbab09' +color12='#0366d6' +color13='#5a32a3' +color14='#1b7c83' +color15='#24292e' + +bg='#ffffff' +fg='#24292e' + +vim_theme_name='github-light' + diff --git a/home/dot_local/share/mode/themes/rose-pine-dawn b/home/dot_local/share/mode/themes/rose-pine-dawn new file mode 100644 index 0000000..dfed420 --- /dev/null +++ b/home/dot_local/share/mode/themes/rose-pine-dawn @@ -0,0 +1,28 @@ +#!/bin/sh +mode=light + +color0='#c4bdc3' +color1='#b4637a' +color2='#286983' +color3='#ea9d34' +color4='#56949f' +color5='#907aa9' +color6='#d7827e' +color7='#575279' +color8='#797593' +color9='#b4637a' +color10='#286983' +color11='#ea9d34' +color12='#56949f' +color13='#907aa9' +color14='#d7827e' +color15='#575279' + +bg='#faf4ed' +fg='#575279' + +accent='#d7827e' +accent_text='#f4ede8' + +vim_theme_name='rose-pine-dawn' + diff --git a/home/dot_local/share/mode/themes/symlink_dark b/home/dot_local/share/mode/themes/symlink_dark new file mode 100644 index 0000000..b5d11f8 --- /dev/null +++ b/home/dot_local/share/mode/themes/symlink_dark @@ -0,0 +1 @@ +github-dark diff --git a/home/dot_local/share/mode/themes/symlink_light b/home/dot_local/share/mode/themes/symlink_light new file mode 100644 index 0000000..2c27e1d --- /dev/null +++ b/home/dot_local/share/mode/themes/symlink_light @@ -0,0 +1 @@ +github-light diff --git a/home/dot_local/share/mode/themes/xcode-dark b/home/dot_local/share/mode/themes/xcode-dark new file mode 100644 index 0000000..eb75b80 --- /dev/null +++ b/home/dot_local/share/mode/themes/xcode-dark @@ -0,0 +1,24 @@ +#!/bin/sh +mode=dark + +color0='#43454b' +color1='#ff8a7a' +color2='#83c9bc' +color3='#d9c668' +color4='#4ec4e6' +color5='#ff85b8' +color6='#cda1ff' +color7='#ffffff' +color8='#838991' +color9='#ff8a7a' +color10='#b1faeb' +color11='#ffa14f' +color12='#6bdfff' +color13='#ff85b8' +color14='#e5cfff' +color15='#ffffff' + +bg='#1f1f24' +fg='#e6edf3' + +vim_theme_name='xcodedarkhc' diff --git a/home/dot_local/share/oh-my-zsh/completions/_fork b/home/dot_local/share/oh-my-zsh/completions/_fork new file mode 100644 index 0000000..7b76938 --- /dev/null +++ b/home/dot_local/share/oh-my-zsh/completions/_fork @@ -0,0 +1,2 @@ +#compdef fork +_precommand "$@" diff --git a/home/dot_local/share/oh-my-zsh/themes/loek.zsh-theme b/home/dot_local/share/oh-my-zsh/themes/loek.zsh-theme new file mode 100644 index 0000000..5231234 --- /dev/null +++ b/home/dot_local/share/oh-my-zsh/themes/loek.zsh-theme @@ -0,0 +1,17 @@ +INFO_COLOR=$'%{\e[90m%}' # bright gray +SEPARATOR_COLOR=$'%{\e[30m%}' # normal gray +RESET_COLOR=$'%{\e[0m%}' + +SEPARATOR="$SEPARATOR_COLOR -> " + +PROMPT="" +# only display hostname in prompt if connected over SSH +[ -n "$SSH_CLIENT" ] && PROMPT+="$INFO_COLOR%m$SEPARATOR" +PROMPT+="$INFO_COLOR%c$SEPARATOR" # working directory +PROMPT+="$INFO_COLOR\$(git_prompt_info)" # git info (if in repo) +PROMPT+="$RESET_COLOR" + +ZSH_THEME_GIT_PROMPT_PREFIX="${INFO_COLOR}git " +ZSH_THEME_GIT_PROMPT_SUFFIX="$SEPARATOR" + +# vim:ft=zsh diff --git a/home/dot_local/share/pass-extensions/executable_directory.bash b/home/dot_local/share/pass-extensions/executable_directory.bash new file mode 100644 index 0000000..84db500 --- /dev/null +++ b/home/dot_local/share/pass-extensions/executable_directory.bash @@ -0,0 +1,12 @@ +#!/bin/bash +# print the initialized password store directory as a fully qualified path. +# exits with code 1 if the password store is not initialized. +dir="${PASSWORD_STORE_DIR-$HOME/.password-store}" +dir="$(realpath "$dir")" +if [ -e "$dir/.gpg-id" ] ; then + echo "$dir" +else + echo "error: password store is not initialized" >&2 + exit 1 +fi + diff --git a/home/dot_local/share/pass-extensions/executable_duplicates.bash b/home/dot_local/share/pass-extensions/executable_duplicates.bash new file mode 100644 index 0000000..3ba47aa --- /dev/null +++ b/home/dot_local/share/pass-extensions/executable_duplicates.bash @@ -0,0 +1,45 @@ +#!/bin/bash +declare -A dupe_tally dupe_map + +pass_names="$(pass names -l)" +[ $? -ne 0 ] && exit 1 + +pass_count="$(echo "$pass_names" | wc -l)" +pass_index=1 + +while read pass_name ; do + hash="$(pass show "$pass_name" | head -n1 | sha1sum | cut -c1-40)" + + dupe_map["$pass_name"]="$hash" + dupe_tally["$hash"]=$(( ${dupe_tally["$hash"]} + 1 )) + + printf '\rhashing... (%d/%d)' "$pass_index" "$pass_count" >&2 + pass_index=$(( $pass_index + 1 )) +done < <(echo "$pass_names") +printf '\r\e[2K' >&2 + +unique_duplicates=0 +total_shared=0 + +for talley_key in "${!dupe_tally[@]}" ; do + [ "${dupe_tally["$talley_key"]}" -le 1 ] && continue; + unique_duplicates=$(( $unique_duplicates + 1 )) + + echo "same password:" + for pass_name in "${!dupe_map[@]}" ; do + [ "${dupe_map["$pass_name"]}" != "$talley_key" ] && continue; + echo "- $pass_name" + total_shared=$(( $total_shared + 1 )) + done + echo +done + +echo "summary:" +if [ $unique_duplicates -eq 0 ] ; then + echo "- no duplicates" +else + cat << EOF +- found $unique_duplicates password(s) that were used more than once +- you should change all $total_shared passwords listed above +EOF +fi diff --git a/home/dot_local/share/pass-extensions/executable_exit.bash b/home/dot_local/share/pass-extensions/executable_exit.bash new file mode 100644 index 0000000..06bd986 --- /dev/null +++ b/home/dot_local/share/pass-extensions/executable_exit.bash @@ -0,0 +1,2 @@ +#!/bin/bash +exit 0 diff --git a/home/dot_local/share/pass-extensions/executable_g.bash b/home/dot_local/share/pass-extensions/executable_g.bash new file mode 100644 index 0000000..4ab3ace --- /dev/null +++ b/home/dot_local/share/pass-extensions/executable_g.bash @@ -0,0 +1,2 @@ +#!/bin/bash +exec pass git "$@" diff --git a/home/dot_local/share/pass-extensions/executable_names.bash b/home/dot_local/share/pass-extensions/executable_names.bash new file mode 100644 index 0000000..aa42ebf --- /dev/null +++ b/home/dot_local/share/pass-extensions/executable_names.bash @@ -0,0 +1,46 @@ +#!/bin/bash +# list all passwords in store + +pass_dir="$(pass directory)" +[ $? -ne 0 ] && exit 1 +cd "$pass_dir" + +usage() { + cat << EOF +usage: + pass names [-hl] + +options: + -l ignore symbolic links in password store + -h show this help +EOF + exit $1 +} + +ARGC=0 +while getopts lh OPT; do + [ $OPTIND -gt $ARGC ] && ARGC=$OPTIND + case $OPT in + l) + opt_ignore_symlinks=y + ;; + h) usage 0 ;; + \?|*) usage 1 ;; + esac +done + +find_args=() + +if [ -n "$opt_ignore_symlinks" ] ; then + find_args+=(-P) # ignore symbolic links +else + find_args+=(-L) # follow symbolic links +fi +find_args+=(.) +find_args+=(-type d -name .git -prune) # skip .git directory +find_args+=(-o -type d -name .extensions -prune) # skip .extensions directory +find_args+=(-o -type f -name '*.gpg') # only .gpg files +find_args+=(-print) + +find "${find_args[@]}" | cut -c3- | rev | cut -c5- | rev + diff --git a/home/dot_local/share/pass-extensions/executable_treasure.bash b/home/dot_local/share/pass-extensions/executable_treasure.bash new file mode 100644 index 0000000..e79ec24 --- /dev/null +++ b/home/dot_local/share/pass-extensions/executable_treasure.bash @@ -0,0 +1,47 @@ +#!/bin/bash +TAB="$(printf '\t')" + +# TODO: add options: +# --help to display some help +# --list to list all the versions of a password + +# print error if fzf is not found +command -v fzf > /dev/null || exec bash -c fzf || exit 1 + +# load pass source code for accessing internals +exit() { true ; } # disable exit command +. "$(command -v pass)" exit # source pass source (bash) +exit() { command exit ; } # restore exit command + +cd "$(pass directory)" + +set_git "$PWD/" +if [ -z "$INNER_GIT_DIR" ] ; then + cat << "EOF" >&2 +pass-treasure only works when the password store is tracked under version +control using git! +EOF +fi + +# create a list of all files that ever existed in the password store +# repository, then filter empty lines (created by git log), only show file +# names ending in .gpg, and sort the list +repo_files_all="$(\ + cmd_git log --all --pretty="format:" --name-only --diff-filter=A |\ + sed '/^$/d' | sed -n '/\.gpg$/p' |\ + sort)" + +IFS="$TAB" read -r date file hash < <( + while read -u 3 -r file ; do + while IFS="$TAB" read -u 4 -r hash date ; do + printf '%s\t%s\t%s\n' "$date" "$file" "$hash" + done 4< <( + cmd_git log --no-patch --diff-filter=ABCMRTUX --format="format:%H$TAB%ad" \ + -- "$file" + echo + ) + done 3< <( echo "$repo_files_all" ) | fzf --tabstop=4 +) + +cmd_git cat-file -p "$hash:$file" | $GPG -d "${GPG_OPTS[@]}" - + diff --git a/home/dot_local/share/pass-extensions/symlink_dir.bash b/home/dot_local/share/pass-extensions/symlink_dir.bash new file mode 100644 index 0000000..cb34588 --- /dev/null +++ b/home/dot_local/share/pass-extensions/symlink_dir.bash @@ -0,0 +1 @@ +directory.bash diff --git a/home/dot_local/share/pass-extensions/symlink_dupes.bash b/home/dot_local/share/pass-extensions/symlink_dupes.bash new file mode 100644 index 0000000..59c3653 --- /dev/null +++ b/home/dot_local/share/pass-extensions/symlink_dupes.bash @@ -0,0 +1 @@ +duplicates.bash diff --git a/home/dot_local/share/private_gnupg/private_gpg-agent.conf b/home/dot_local/share/private_gnupg/private_gpg-agent.conf new file mode 100644 index 0000000..4e3bb5d --- /dev/null +++ b/home/dot_local/share/private_gnupg/private_gpg-agent.conf @@ -0,0 +1,3 @@ +allow-preset-passphrase +max-cache-ttl 604800 +pinentry-program /usr/bin/pinentry-gtk diff --git a/home/dot_profile b/home/dot_profile new file mode 100644 index 0000000..caf94f9 --- /dev/null +++ b/home/dot_profile @@ -0,0 +1,131 @@ +#!/bin/sh +# +# this file should only contain posix-compliant shell customizations and +# environment variables. shell-specific customizations should be done in the +# respective shell's profile or init file (e.g. .zshrc, .bash_profile, etc.) + +# AJATT (user account only because TTYs don't render non-ascii characters) +export LANG='ja_JP.UTF-8' + +# aliases +alias copy='xclip -selection clipboard' +alias dnd='dragon-drop --all --and-exit' +alias sl='sl -w' +alias bctl='bluetoothctl' +alias sctl='systemctl --user' + +# one letters +alias r='cd "$(lf -print-last-dir | head -n1)"' +alias v='nvim -p' +alias m='neomutt' +alias y='yay' +alias n='ncmpcpp' +alias c='khal' +alias f='fork' +alias p='pass' +alias b='bluetoothctl' +alias s='systemctl --user' +alias g='git' + +# force colorterm +export COLORTERM="truecolor" + +# colors +alias diff='diff --color=auto' + +# xdg base directories +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_CACHE_HOME="$HOME/.cache" +export XDG_DATA_HOME="$HOME/.local/share" +export XDG_STATE_HOME="$HOME/.local/state" + +# ruby +export GEM_HOME="$XDG_DATA_HOME/gem/ruby/3.0.0" + +# script locations +if [ -z "$PATH_EXTENDED" ] ; then + PATH="/opt/zephyr-sdk/arm-zephyr-eabi/bin:$PATH" + PATH="$GEM_HOME/bin:$PATH" + PATH="$HOME/.local/share/cargo/bin:$PATH" + PATH="$HOME/.local/go/bin:$PATH" + PATH="$HOME/.local/bin:$PATH" + PATH="$HOME/.local/share/bin:$PATH" + export PATH + export PATH_EXTENDED=y +fi + +# other stuff +export EDITOR=editor +export PAGER="less --mouse --wheel-lines=3 -R" +alias less="$PAGER" +export DELTA_PAGER="$PAGER" +export FZF_DEFAULT_COMMAND="find . -name '.?*' -prune -o -print" +export FZF_DEFAULT_OPTS="--color=bw,current-fg:regular:reverse,info:bright-black,hl:underline --layout=reverse --info=inline-right --no-separator --no-scrollbar --marker='' --pointer='' --highlight-line" +export GOPATH="$HOME/.local/go" +[ -e "$XDG_CONFIG_HOME/gtk-4.0/env" ] && . "$XDG_CONFIG_HOME/gtk-4.0/env" +export PASSWORD_STORE_ENABLE_EXTENSIONS=true +export PASSWORD_STORE_EXTENSIONS_DIR="$XDG_DATA_HOME/pass-extensions" +export MOZ_USE_XINPUT2=1 +export LIBVIRT_DEFAULT_URI='qemu:///system' +export WINEDEBUG='fixme-all,err-all' +export INPUTRC="$XDG_CONFIG_HOME/inputrc" + +# LS_COLORS +[ ! -e "$XDG_CACHE_HOME/dircolors" ] || [ "$XDG_CONFIG_HOME/dircolors" -nt "$XDG_CACHE_HOME/dircolors" ] && dircolors "$XDG_CONFIG_HOME/dircolors" > "$XDG_CACHE_HOME/dircolors" +. "$XDG_CACHE_HOME/dircolors" + +# use .config/ instead of home directory +export ANDROID_SDK_HOME="$XDG_CONFIG_HOME/android" +export ADB_VENDOR_KEY="$XDG_CONFIG_HOME/android" +export CARGO_HOME="$XDG_DATA_HOME/cargo" +export gnome_user_dir="$HOME/.config/gnome/apps" +export GNUPGHOME="$XDG_DATA_HOME/gnupg" +export GRADLE_USER_HOME="$XDG_DATA_HOME/gradle" +export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc" +export PARALLEL_HOME="$XDG_CONFIG_HOME/parallel" +export PYLINTHOME="$XDG_CACHE_HOME/pylint" +export STACK_ROOT="$XDG_DATA_HOME/stack" +export WINEPREFIX="$XDG_DATA_HOME/wineprefixes/default" +export CUDA_CACHE_PATH="$XDG_CACHE_HOME/nv" +export CONAN_USER_HOME="$XDG_CONFIG_HOME/conan" +alias nvidia-settings='nvidia-settings --config="$XDG_CONFIG_HOME/nvidia/settings"' +alias gpg2="gpg2 --homedir $XDG_DATA_HOME/gnupg" +export PASSWORD_STORE_DIR="$XDG_DATA_HOME/pass" +export NMPASS_FORMAT="net/{ssid}/passwd" +export WGETRC="$XDG_CONFIG_HOME/wgetrc" +export TEXMFHOME="$XDG_DATA_HOME/texmf" +export TEXMFVAR="$XDG_CACHE_HOME/texlive/texmf-var" +export TEXMFCONFIG="$XDG_CONFIG_HOME/texlive/texmf-config" +alias poke="poke --quiet" + +# CMake +export CMAKE_BUILD_TYPE=Debug +export CMAKE_EXPORT_COMPILE_COMMANDS=1 +export CMAKE_GENERATOR=Ninja +export CMAKE_C_COMPILER_LAUNCHER=ccache +export CMAKE_CXX_COMPILER_LAUNCHER=ccache + +# colors +alias diff='diff --color=auto' +alias mk='FROM_PROMPT=y mk' +alias diffstat='diffstat -C' + +# disable dotnet telemetry +export DOTNET_CLI_TELEMETRY_OPTOUT=1 + +# GPG key IDs +export GPG_ID_DEFAULT="1081FFE2B963ADB5BDCF4DA6D0E3BC76E355B6CC" +export GPG_ID_GIT="$GPG_ID_DEFAULT" +export GPG_ID_PASSWORD_STORE="A12ADDD26335FA960FE3C78A9FC7A0100BC4C971" + +# GDB +! [ -d "$XDG_DATA_HOME/gdb" ] && mkdir -p "$XDG_DATA_HOME/gdb" +export GDBHISTFILE="$XDG_DATA_HOME/gdb/history" + +# GDB +! [ -d "$XDG_DATA_HOME/gdb" ] && mkdir -p "$XDG_DATA_HOME/gdb" +export GDBHISTFILE="$XDG_DATA_HOME/gdb/history" + +# secrets +[ -f "$HOME/.env" ] && . "$HOME/.env" + diff --git a/home/dot_zshrc b/home/dot_zshrc new file mode 100644 index 0000000..6220015 --- /dev/null +++ b/home/dot_zshrc @@ -0,0 +1,64 @@ +#!/bin/zsh +export ZSH_COMPDUMP="$XDG_CACHE_HOME/zcompdump" + +# do not glob for calculator command +aliases[=]="noglob =" + +# color aliases +alias ls='ls --color=auto' +alias grep='grep --color=auto' + +# completion +autoload -U compinit +zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" +zstyle ':completion:*:*:*:*:*' menu select +zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|=*' 'l:|=* r:|=*' +zstyle ':completion:*' special-dirs true +setopt auto_menu # show completion menu when spamming <tab> +setopt complete_in_word +setopt always_to_end # move cursor to end of word after completion +setopt auto_cd # cd if the command is a valid path +WORDCHARS="${WORDCHARS:gs/\//}" # remove '/' from WORDCHARS +compinit -d "$ZSH_COMPDUMP" + +# history +! [ -d "$XDG_DATA_HOME/zsh" ] && mkdir -p "$XDG_DATA_HOME/zsh" +export HISTFILE="$XDG_DATA_HOME/zsh/history" +export HISTSIZE=10000000 +export SAVEHIST=10000000 +setopt hist_ignore_space +setopt share_history +setopt hist_ignore_dups + +# keybinds +bindkey -e # emacs bindings +bindkey '^[[Z' reverse-menu-complete + +# prompt +setopt PROMPT_SUBST +export VIRTUAL_ENV_DISABLE_PROMPT=y +PROMPT='$(eo=%{ ec=%} prompt)' + +# auto venv +function cd() { + builtin cd "$@" + + if [ -n "$VIRTUAL_ENV" ] ; then + if [[ "$PWD"/ != "$(dirname "$VIRTUAL_ENV")"/* ]] && [ ! -z "$(command -v deactivate)" ] ; then + deactivate + else + return + fi + fi + + git_dir="$(git rev-parse --show-toplevel 2>/dev/null)" + for dir in ./ "$git_dir" ../ "$git_dir/.." ; do + [ ! -d "$dir" ] && continue + for file in "$dir"/.env "$dir"/venv/bin/activate ; do + [ ! -e "$file" ] && continue + source "$file" + return + done + done +} + diff --git a/home/executable_dot_xinitrc b/home/executable_dot_xinitrc new file mode 100644 index 0000000..d4601d3 --- /dev/null +++ b/home/executable_dot_xinitrc @@ -0,0 +1,13 @@ +#!/bin/sh +. "$HOME/.profile" + +# make current environment available to systemd user units +systemctl --user import-environment $(export | cut -d= -f1) + +xrdb -override "$XDG_CONFIG_HOME/X11/base" + +# https://github.com/swaywm/sway/wiki#gtk-applications-take-20-seconds-to-start +dbus-update-activation-environment --systemd DISPLAY + +exec i3 + diff --git a/home/private_dot_ssh/private_config b/home/private_dot_ssh/private_config new file mode 100644 index 0000000..c070bdf --- /dev/null +++ b/home/private_dot_ssh/private_config @@ -0,0 +1,8 @@ +match user git host pipeframe.xyz + requesttty no + +host * + warnweakcrypto no + +host router.lan + user admin diff --git a/home/symlink_dot_zshenv b/home/symlink_dot_zshenv new file mode 100644 index 0000000..f940b94 --- /dev/null +++ b/home/symlink_dot_zshenv @@ -0,0 +1 @@ +.profile |