Compare commits
No commits in common. "c4f1c61522a5593b32318f75f19dcb0de84afe0a" and "28964186a89889fa95e2af5b42817845225f6128" have entirely different histories.
c4f1c61522
...
28964186a8
44 changed files with 835 additions and 686 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,2 +1 @@
|
|||
.env
|
||||
*.sqlite3*
|
||||
*.svg
|
||||
|
|
|
|||
1
.rspec
1
.rspec
|
|
@ -1 +0,0 @@
|
|||
--require spec_helper
|
||||
|
|
@ -1 +0,0 @@
|
|||
3.4.2
|
||||
16
Gemfile
16
Gemfile
|
|
@ -1,16 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem 'foreman'
|
||||
gem 'sinatra'
|
||||
gem 'puma'
|
||||
gem "sinatra-activerecord"
|
||||
gem "sqlite3"
|
||||
gem "rake"
|
||||
|
||||
gem "rackup", "~> 2.1"
|
||||
|
||||
gem "sinatra-contrib", "~> 4.0"
|
||||
|
||||
gem "timecop", "~> 0.9.8"
|
||||
110
Gemfile.lock
110
Gemfile.lock
|
|
@ -1,110 +0,0 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
activemodel (8.0.1)
|
||||
activesupport (= 8.0.1)
|
||||
activerecord (8.0.1)
|
||||
activemodel (= 8.0.1)
|
||||
activesupport (= 8.0.1)
|
||||
timeout (>= 0.4.0)
|
||||
activesupport (8.0.1)
|
||||
base64
|
||||
benchmark (>= 0.3)
|
||||
bigdecimal
|
||||
concurrent-ruby (~> 1.0, >= 1.3.1)
|
||||
connection_pool (>= 2.2.5)
|
||||
drb
|
||||
i18n (>= 1.6, < 2)
|
||||
logger (>= 1.4.2)
|
||||
minitest (>= 5.1)
|
||||
securerandom (>= 0.3)
|
||||
tzinfo (~> 2.0, >= 2.0.5)
|
||||
uri (>= 0.13.1)
|
||||
base64 (0.2.0)
|
||||
benchmark (0.4.0)
|
||||
bigdecimal (3.1.9)
|
||||
concurrent-ruby (1.3.5)
|
||||
connection_pool (2.5.0)
|
||||
drb (2.2.1)
|
||||
foreman (0.88.1)
|
||||
i18n (1.14.7)
|
||||
concurrent-ruby (~> 1.0)
|
||||
logger (1.6.6)
|
||||
minitest (5.25.4)
|
||||
multi_json (1.15.0)
|
||||
mustermann (3.0.3)
|
||||
ruby2_keywords (~> 0.0.1)
|
||||
nio4r (2.7.4)
|
||||
puma (6.6.0)
|
||||
nio4r (~> 2.0)
|
||||
rack (3.1.11)
|
||||
rack-protection (4.1.1)
|
||||
base64 (>= 0.1.0)
|
||||
logger (>= 1.6.0)
|
||||
rack (>= 3.0.0, < 4)
|
||||
rack-session (2.1.0)
|
||||
base64 (>= 0.1.0)
|
||||
rack (>= 3.0.0)
|
||||
rackup (2.2.1)
|
||||
rack (>= 3)
|
||||
rake (13.2.1)
|
||||
ruby2_keywords (0.0.5)
|
||||
securerandom (0.4.1)
|
||||
sinatra (4.1.1)
|
||||
logger (>= 1.6.0)
|
||||
mustermann (~> 3.0)
|
||||
rack (>= 3.0.0, < 4)
|
||||
rack-protection (= 4.1.1)
|
||||
rack-session (>= 2.0.0, < 3)
|
||||
tilt (~> 2.0)
|
||||
sinatra-activerecord (2.0.28)
|
||||
activerecord (>= 4.1)
|
||||
sinatra (>= 1.0)
|
||||
sinatra-contrib (4.1.1)
|
||||
multi_json (>= 0.0.2)
|
||||
mustermann (~> 3.0)
|
||||
rack-protection (= 4.1.1)
|
||||
sinatra (= 4.1.1)
|
||||
tilt (~> 2.0)
|
||||
sqlite3 (2.6.0-aarch64-linux-gnu)
|
||||
sqlite3 (2.6.0-aarch64-linux-musl)
|
||||
sqlite3 (2.6.0-arm-linux-gnu)
|
||||
sqlite3 (2.6.0-arm-linux-musl)
|
||||
sqlite3 (2.6.0-arm64-darwin)
|
||||
sqlite3 (2.6.0-x86-linux-gnu)
|
||||
sqlite3 (2.6.0-x86-linux-musl)
|
||||
sqlite3 (2.6.0-x86_64-darwin)
|
||||
sqlite3 (2.6.0-x86_64-linux-gnu)
|
||||
sqlite3 (2.6.0-x86_64-linux-musl)
|
||||
tilt (2.6.0)
|
||||
timecop (0.9.10)
|
||||
timeout (0.4.3)
|
||||
tzinfo (2.0.6)
|
||||
concurrent-ruby (~> 1.0)
|
||||
uri (1.0.3)
|
||||
|
||||
PLATFORMS
|
||||
aarch64-linux-gnu
|
||||
aarch64-linux-musl
|
||||
arm-linux-gnu
|
||||
arm-linux-musl
|
||||
arm64-darwin
|
||||
x86-linux-gnu
|
||||
x86-linux-musl
|
||||
x86_64-darwin
|
||||
x86_64-linux-gnu
|
||||
x86_64-linux-musl
|
||||
|
||||
DEPENDENCIES
|
||||
foreman
|
||||
puma
|
||||
rackup (~> 2.1)
|
||||
rake
|
||||
sinatra
|
||||
sinatra-activerecord
|
||||
sinatra-contrib (~> 4.0)
|
||||
sqlite3
|
||||
timecop (~> 0.9.8)
|
||||
|
||||
BUNDLED WITH
|
||||
2.5.19
|
||||
1
Procfile
1
Procfile
|
|
@ -1 +0,0 @@
|
|||
web: ruby mood_app.rb
|
||||
8
Rakefile
8
Rakefile
|
|
@ -1,8 +0,0 @@
|
|||
# Rakefile
|
||||
require "sinatra/activerecord/rake"
|
||||
|
||||
namespace :db do
|
||||
task :load_config do
|
||||
require "./mood_app"
|
||||
end
|
||||
end
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
require './mood_app'
|
||||
run MoodApp
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
class CreateMoods < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
create_table :moods do |t|
|
||||
t.string :mode, null: false
|
||||
t.datetime :recorded_at, precision: nil, null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
class CreateEvents < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :events do |t|
|
||||
t.string :title
|
||||
t.text :description
|
||||
t.datetime :taken_place_on, precision: nil, null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
24
db/schema.rb
24
db/schema.rb
|
|
@ -1,24 +0,0 @@
|
|||
# This file is auto-generated from the current state of the database. Instead
|
||||
# of editing this file, please use the migrations feature of Active Record to
|
||||
# incrementally modify your database, and then regenerate this schema definition.
|
||||
#
|
||||
# This file is the source Rails uses to define your schema when running `bin/rails
|
||||
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
|
||||
# be faster and is potentially less error prone than running all of your
|
||||
# migrations from scratch. Old migrations may fail to apply correctly if those
|
||||
# migrations use external dependencies or application code.
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.2].define(version: 2024_11_01_211840) do
|
||||
create_table "events", force: :cascade do |t|
|
||||
t.string "title"
|
||||
t.text "description"
|
||||
t.datetime "taken_place_on", precision: nil, null: false
|
||||
end
|
||||
|
||||
create_table "moods", force: :cascade do |t|
|
||||
t.string "mode", null: false
|
||||
t.datetime "recorded_at", precision: nil, null: false
|
||||
end
|
||||
end
|
||||
31
dotfiles/nvim/init.lua
Normal file
31
dotfiles/nvim/init.lua
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
--[[
|
||||
If you don't know anything about Lua, I recommend taking some time to read through
|
||||
a guide. One possible example which will only take 10-15 minutes:
|
||||
- https://learnxinyminutes.com/docs/lua/
|
||||
|
||||
After understanding a bit more about Lua, you can use `:help lua-guide` as a
|
||||
reference for how Neovim integrates Lua.
|
||||
- :help lua-guide
|
||||
- (or HTML version): https://neovim.io/doc/user/lua-guide.html
|
||||
]]
|
||||
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
|
||||
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
||||
vim.g.have_nerd_font = true
|
||||
|
||||
-- [[ Setting options ]]
|
||||
require 'options'
|
||||
|
||||
-- [[ Basic Keymaps ]]
|
||||
require 'keymaps'
|
||||
|
||||
-- [[ Install `lazy.nvim` plugin manager ]]
|
||||
require 'lazy-bootstrap'
|
||||
|
||||
-- [[ Configure and install plugins ]]
|
||||
-- require 'lazy-plugins'
|
||||
|
||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
32
dotfiles/nvim/lazy-lock.json
Normal file
32
dotfiles/nvim/lazy-lock.json
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"conform.nvim": { "branch": "master", "commit": "a6f5bdb78caa305496357d17e962bbc4c0b392e2" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "4c40357994f386e72be92a46f41fc1664c84c87d" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
|
||||
"luvit-meta": { "branch": "main", "commit": "1df30b60b1b4aecfebc785aa98943db6c6989716" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "5639d58a3d11ff7c05c8e31e159bfedae55d7961" },
|
||||
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
|
||||
"mini.nvim": { "branch": "main", "commit": "3a354c754656538ad76d1add93ca21e75b7f3181" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "e96fd85bf18bc345dab332b345098fa5460dffac" },
|
||||
"nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "5a11682453ac6b13dbf32cd403da4ee9c07ef1c3" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "62c5fac4c59be9e41b92ef62f3bb0fbdae3e2d9e" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "99487eb34a397befce8182ff63347a21c5f4b881" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "1020869742ecb191f260818234517f4a1515cfe8" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "2a5ceff981501cff8f46871d5402cd3378a8ab6a" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
|
||||
"vim-tmux-navigator": { "branch": "master", "commit": "791dacfcfc8ccb7f6eb1c853050883b03e5a22fe" },
|
||||
"vim-tmux-runner": { "branch": "master", "commit": "eead441119d9863227f4c39dac7890aa09d6b4cd" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
|
||||
}
|
||||
50
dotfiles/nvim/lua/keymaps.lua
Normal file
50
dotfiles/nvim/lua/keymaps.lua
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
-- [[ Basic Keymaps ]]
|
||||
-- See `:help vim.keymap.set()`
|
||||
|
||||
vim.keymap.set('i', 'jk', '<Esc>')
|
||||
|
||||
-- Clear highlights on search when pressing <Esc> in normal mode
|
||||
-- See `:help hlsearch`
|
||||
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
||||
|
||||
-- Diagnostic keymaps
|
||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
|
||||
|
||||
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
|
||||
-- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which
|
||||
-- is not what someone will guess without a bit more experience.
|
||||
--
|
||||
-- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping
|
||||
-- or just use <C-\><C-n> to exit terminal mode
|
||||
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
|
||||
|
||||
-- TIP: Disable arrow keys in normal mode
|
||||
vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
|
||||
vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
|
||||
vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
|
||||
vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
|
||||
|
||||
-- Keybinds to make split navigation easier.
|
||||
-- Use CTRL+<hjkl> to switch between windows
|
||||
--
|
||||
-- See `:help wincmd` for a list of all window commands
|
||||
vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
|
||||
vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
|
||||
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
|
||||
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
||||
|
||||
-- [[ Basic Autocommands ]]
|
||||
-- See `:help lua-guide-autocommands`
|
||||
|
||||
-- Highlight when yanking (copying) text
|
||||
-- Try it with `yap` in normal mode
|
||||
-- See `:help vim.highlight.on_yank()`
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
desc = 'Highlight when yanking (copying) text',
|
||||
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
13
dotfiles/nvim/lua/lazy-bootstrap.lua
Normal file
13
dotfiles/nvim/lua/lazy-bootstrap.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
-- [[ Install `lazy.nvim` plugin manager ]]
|
||||
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
||||
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
|
||||
local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
|
||||
if vim.v.shell_error ~= 0 then
|
||||
error('Error cloning lazy.nvim:\n' .. out)
|
||||
end
|
||||
end ---@diagnostic disable-next-line: undefined-field
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
96
dotfiles/nvim/lua/lazy-plugins.lua
Normal file
96
dotfiles/nvim/lua/lazy-plugins.lua
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
-- [[ Configure and install plugins ]]
|
||||
--
|
||||
-- To check the current status of your plugins, run
|
||||
-- :Lazy
|
||||
--
|
||||
-- You can press `?` in this menu for help. Use `:q` to close the window
|
||||
--
|
||||
-- To update plugins you can run
|
||||
-- :Lazy update
|
||||
--
|
||||
-- NOTE: Here is where you install your plugins.
|
||||
require('lazy').setup({
|
||||
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
|
||||
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
|
||||
'christoomey/vim-tmux-navigator',
|
||||
'christoomey/vim-tmux-runner',
|
||||
|
||||
-- NOTE: Plugins can also be added by using a table,
|
||||
-- with the first argument being the link and the following
|
||||
-- keys can be used to configure plugin behavior/loading/etc.
|
||||
--
|
||||
-- Use `opts = {}` to force a plugin to be loaded.
|
||||
--
|
||||
|
||||
|
||||
-- modular approach: using `require 'path/name'` will
|
||||
-- include a plugin definition from file lua/path/name.lua
|
||||
|
||||
require 'kickstart/plugins/gitsigns',
|
||||
|
||||
require 'kickstart/plugins/which-key',
|
||||
|
||||
require 'kickstart/plugins/telescope',
|
||||
|
||||
require 'kickstart/plugins/lspconfig',
|
||||
|
||||
require 'kickstart/plugins/conform',
|
||||
|
||||
require 'kickstart/plugins/cmp',
|
||||
|
||||
require 'kickstart/plugins/tokyonight',
|
||||
|
||||
require 'kickstart/plugins/todo-comments',
|
||||
|
||||
require 'kickstart/plugins/mini',
|
||||
|
||||
require 'kickstart/plugins/treesitter',
|
||||
|
||||
-- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the
|
||||
-- init.lua. If you want these files, they are in the repository, so you can just download them and
|
||||
-- place them in the correct locations.
|
||||
|
||||
-- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for Kickstart
|
||||
--
|
||||
-- Here are some example plugins that I've included in the Kickstart repository.
|
||||
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
|
||||
--
|
||||
-- require 'kickstart.plugins.debug',
|
||||
-- require 'kickstart.plugins.indent_line',
|
||||
-- require 'kickstart.plugins.lint',
|
||||
-- require 'kickstart.plugins.autopairs',
|
||||
require 'kickstart.plugins.neo-tree',
|
||||
|
||||
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
||||
-- This is the easiest way to modularize your config.
|
||||
--
|
||||
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
||||
-- { import = 'custom.plugins' },
|
||||
--
|
||||
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
|
||||
-- Or use telescope!
|
||||
-- In normal mode type `<space>sh` then write `lazy.nvim-plugin`
|
||||
-- you can continue same window with `<space>sr` which resumes last telescope search
|
||||
}, {
|
||||
ui = {
|
||||
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
||||
-- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table
|
||||
icons = vim.g.have_nerd_font and {} or {
|
||||
cmd = '⌘',
|
||||
config = '🛠',
|
||||
event = '📅',
|
||||
ft = '📂',
|
||||
init = '⚙',
|
||||
keys = '🗝',
|
||||
plugin = '🔌',
|
||||
runtime = '💻',
|
||||
require = '🌙',
|
||||
source = '📄',
|
||||
start = '🚀',
|
||||
task = '📌',
|
||||
lazy = '💤 ',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
65
dotfiles/nvim/lua/options.lua
Normal file
65
dotfiles/nvim/lua/options.lua
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
-- [[ Setting options ]]
|
||||
-- See `:help vim.opt`
|
||||
-- NOTE: You can change these options as you wish!
|
||||
-- For more options, you can see `:help option-list`
|
||||
|
||||
-- Make line numbers default
|
||||
vim.opt.number = true
|
||||
-- You can also add relative line numbers, to help with jumping.
|
||||
-- Experiment for yourself to see if you like it!
|
||||
-- vim.opt.relativenumber = true
|
||||
|
||||
-- Enable mouse mode, can be useful for resizing splits for example!
|
||||
vim.opt.mouse = 'a'
|
||||
|
||||
-- Don't show the mode, since it's already in the status line
|
||||
vim.opt.showmode = false
|
||||
|
||||
-- Sync clipboard between OS and Neovim.
|
||||
-- Schedule the setting after `UiEnter` because it can increase startup-time.
|
||||
-- Remove this option if you want your OS clipboard to remain independent.
|
||||
-- See `:help 'clipboard'`
|
||||
vim.schedule(function()
|
||||
vim.opt.clipboard = 'unnamedplus'
|
||||
end)
|
||||
|
||||
-- Enable break indent
|
||||
vim.opt.breakindent = true
|
||||
|
||||
-- Save undo history
|
||||
vim.opt.undofile = true
|
||||
|
||||
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
|
||||
-- Keep signcolumn on by default
|
||||
vim.opt.signcolumn = 'yes'
|
||||
|
||||
-- Decrease update time
|
||||
vim.opt.updatetime = 250
|
||||
|
||||
-- Decrease mapped sequence wait time
|
||||
-- Displays which-key popup sooner
|
||||
vim.opt.timeoutlen = 300
|
||||
|
||||
-- Configure how new splits should be opened
|
||||
vim.opt.splitright = true
|
||||
vim.opt.splitbelow = true
|
||||
|
||||
-- Sets how neovim will display certain whitespace characters in the editor.
|
||||
-- See `:help 'list'`
|
||||
-- and `:help 'listchars'`
|
||||
vim.opt.list = true
|
||||
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
|
||||
|
||||
-- Preview substitutions live, as you type!
|
||||
vim.opt.inccommand = 'split'
|
||||
|
||||
-- Show which line your cursor is on
|
||||
vim.opt.cursorline = true
|
||||
|
||||
-- Minimal number of screen lines to keep above and below the cursor.
|
||||
vim.opt.scrolloff = 10
|
||||
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
15
draft
15
draft
|
|
@ -1,15 +0,0 @@
|
|||
x prendre billet de train
|
||||
x répondre à Laurent
|
||||
x noter agenda yaf et coopaname
|
||||
|
||||
- faire moodtracker mobile
|
||||
|
||||
- faire vaisselle
|
||||
- vider poubelles
|
||||
- demander à mathieu quel jour
|
||||
- laver drap
|
||||
- appeler athie
|
||||
|
||||
- répondre à delphine
|
||||
- redige mail julie sauzin
|
||||
|
||||
7
event.rb
7
event.rb
|
|
@ -1,7 +0,0 @@
|
|||
class Event < ActiveRecord::Base
|
||||
default_scope { order(:taken_place_on) }
|
||||
validates_presence_of :title
|
||||
validates_presence_of :taken_place_on
|
||||
|
||||
end
|
||||
|
||||
28
mood.rb
28
mood.rb
|
|
@ -1,28 +0,0 @@
|
|||
class Mood < ActiveRecord::Base
|
||||
default_scope { order(:recorded_at) }
|
||||
validates_presence_of :mode
|
||||
validates_presence_of :recorded_at
|
||||
|
||||
def self.log
|
||||
return if Mood.count < 1
|
||||
|
||||
first_mood = Mood.first.recorded_at.to_date
|
||||
first_monday = first_mood - (first_mood.wday - 1)
|
||||
|
||||
current_date = first_monday
|
||||
current_mode = nil
|
||||
log_mood = []
|
||||
Mood.all.each do |mood|
|
||||
while current_date < mood.recorded_at.to_date do
|
||||
log_mood << [ current_date.to_s, current_mode ]
|
||||
current_date += 1
|
||||
end
|
||||
current_mode = mood.mode
|
||||
end
|
||||
while current_date <= Date.today do
|
||||
log_mood << [ current_date.to_s, current_mode ]
|
||||
current_date += 1
|
||||
end
|
||||
log_mood.each_slice(7).to_a.last(52)
|
||||
end
|
||||
end
|
||||
32
mood_app.rb
32
mood_app.rb
|
|
@ -1,32 +0,0 @@
|
|||
require 'sinatra/base'
|
||||
require 'sinatra/namespace'
|
||||
require 'sinatra/activerecord'
|
||||
require './mood'
|
||||
require './event'
|
||||
|
||||
class MoodApp < Sinatra::Base
|
||||
register Sinatra::ActiveRecordExtension
|
||||
register Sinatra::Namespace
|
||||
set :database, { adapter: 'sqlite3', database: "mood-#{ENV['RACK_ENV']}.sqlite3" }
|
||||
|
||||
get '/' do
|
||||
@mode = Mood.last&.mode || 'croisiere'
|
||||
@mood_log = Mood.log || []
|
||||
erb :index
|
||||
end
|
||||
|
||||
namespace '/api/v1' do
|
||||
before do
|
||||
content_type 'application/json'
|
||||
end
|
||||
|
||||
post '/moods' do
|
||||
json = request.body.read
|
||||
puts json
|
||||
data = JSON.parse json
|
||||
Mood.create(mode: data['mode'], recorded_at: Time.now)
|
||||
end
|
||||
end
|
||||
|
||||
run! if app_file == $0
|
||||
end
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
ENV['APP_ENV'] = 'test'
|
||||
|
||||
require './mood_app'
|
||||
require 'rspec'
|
||||
require 'rack/test'
|
||||
|
||||
describe 'MoodApp' do
|
||||
include Rack::Test::Methods
|
||||
|
||||
it 'says hello' do
|
||||
get '/'
|
||||
expect(last_response).to be_ok
|
||||
end
|
||||
|
||||
def app
|
||||
MoodApp
|
||||
end
|
||||
end
|
||||
42
mood_spec.rb
42
mood_spec.rb
|
|
@ -1,42 +0,0 @@
|
|||
ENV['APP_ENV'] = 'test'
|
||||
|
||||
require './mood_app'
|
||||
require 'rspec'
|
||||
require 'timecop'
|
||||
|
||||
describe 'Mood' do
|
||||
before do
|
||||
Mood.destroy_all
|
||||
Timecop.freeze(Time.local(2024,2,10,9))
|
||||
end
|
||||
|
||||
after do
|
||||
Timecop.return
|
||||
end
|
||||
|
||||
it 'returns log' do
|
||||
Mood.create(recorded_at: '2024-02-03', mode: 'creatif')
|
||||
Mood.create(recorded_at: '2024-02-09', mode: 'en-charge')
|
||||
|
||||
expect(Mood.log).to eq [
|
||||
[
|
||||
{'2024-01-29' => nil},
|
||||
{'2024-01-30' => nil},
|
||||
{'2024-01-31' => nil},
|
||||
{'2024-02-01' => nil},
|
||||
{'2024-02-02' => nil},
|
||||
{'2024-02-03' => 'creatif'},
|
||||
{'2024-02-04' => 'creatif'}
|
||||
],
|
||||
[
|
||||
{'2024-02-05' => 'creatif'},
|
||||
{'2024-02-06' => 'creatif'},
|
||||
{'2024-02-07' => 'creatif'},
|
||||
{'2024-02-08' => 'creatif'},
|
||||
{'2024-02-09' => 'en-charge'},
|
||||
{'2024-02-10' => 'en-charge'}
|
||||
]
|
||||
]
|
||||
end
|
||||
end
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 904 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 337 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 836 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 947 KiB |
194
public/main.css
194
public/main.css
|
|
@ -1,194 +0,0 @@
|
|||
body {
|
||||
margin: 0px;
|
||||
font: 1.8rem "Fira Sans", sans-serif;
|
||||
}
|
||||
|
||||
.mode {
|
||||
grid-area: mode;
|
||||
height: 50vh;
|
||||
}
|
||||
|
||||
.tracker {
|
||||
grid-area: tracker;
|
||||
}
|
||||
|
||||
.title {
|
||||
grid-area: title;
|
||||
margin: 30px;
|
||||
}
|
||||
|
||||
.moods {
|
||||
grid-area: moods;
|
||||
margin: 30px;
|
||||
}
|
||||
|
||||
.legend {
|
||||
grid-area: legend;
|
||||
margin: 4px;
|
||||
font-size: 0.8rem;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-end;
|
||||
justify-content: flex-end;
|
||||
margin: 30px;
|
||||
}
|
||||
.info {
|
||||
grid-area: info;
|
||||
}
|
||||
.legend .bar-creatif {
|
||||
background: red;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin-left: 15px;
|
||||
}
|
||||
.legend .bar-frigo {
|
||||
background: gray;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin-left: 15px;
|
||||
}
|
||||
.legend .bar-croisiere {
|
||||
background: green;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin-left: 15px;
|
||||
}
|
||||
.legend .bar-en-charge {
|
||||
background: orange;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin-left: 15px;
|
||||
}
|
||||
.legend .bar-explain {
|
||||
padding-left: 3px;
|
||||
}
|
||||
|
||||
.legend-mood {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
main {
|
||||
display: block;
|
||||
grid-template-rows: 1fr 1fr;
|
||||
grid-template-areas:
|
||||
"mode"
|
||||
"tracker";
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.mode img {
|
||||
height: 100%;
|
||||
width:100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
.tracker {
|
||||
grid-area: tracker;
|
||||
}
|
||||
.title h1 {
|
||||
font-weight: 350;
|
||||
}
|
||||
|
||||
@media (min-width: 1000px) {
|
||||
main {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-template-rows: 1fr;
|
||||
grid-template-areas: "mode tracker";
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.mode {
|
||||
height: 100vh;
|
||||
grid-area: mode;
|
||||
}
|
||||
.tracker {
|
||||
grid-area: tracker;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-template-rows: repeat(2, 1fr) repeat(7, 1fr);
|
||||
grid-template-areas:
|
||||
"title title"
|
||||
"title title"
|
||||
"moods moods"
|
||||
"moods moods"
|
||||
"moods moods"
|
||||
"moods moods"
|
||||
"moods moods"
|
||||
"moods moods"
|
||||
". legend";
|
||||
background-color: lightgoldenrodyellow;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100vh;
|
||||
width: 100%;
|
||||
gap: 45px;
|
||||
}
|
||||
|
||||
.title {
|
||||
grid-area: title;
|
||||
margin: 30px;
|
||||
}
|
||||
|
||||
|
||||
.info {
|
||||
grid-area: info;
|
||||
}
|
||||
|
||||
.mode img {
|
||||
height: 100%;
|
||||
width:100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
.title h1 {
|
||||
font-weight: 350;
|
||||
}
|
||||
}
|
||||
.moods {
|
||||
grid-area: moods;
|
||||
margin: 30px;
|
||||
max-height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.legend {
|
||||
align-self: flex-end;
|
||||
}
|
||||
.log {
|
||||
align-self: flex-end;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-start;
|
||||
overflow: hidden;
|
||||
}
|
||||
.moods .log .week {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-items: start;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.moods .log .day {
|
||||
border: 1px;
|
||||
margin: 4px;
|
||||
min-width: 15px;
|
||||
min-height: 15px;
|
||||
}
|
||||
.creatif {
|
||||
background-color: red;
|
||||
}
|
||||
.en-charge {
|
||||
background-color: orange;
|
||||
}
|
||||
.frigo-vide {
|
||||
background-color: grey;
|
||||
}
|
||||
.croisiere {
|
||||
background-color: green;
|
||||
}
|
||||
|
||||
.info {
|
||||
margin: 30px;
|
||||
}
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
ENV["RACK_ENV"] = 'test'
|
||||
|
||||
# This file was generated by the `rspec --init` command. Conventionally, all
|
||||
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
||||
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
||||
# this file to always be loaded, without a need to explicitly require it in any
|
||||
# files.
|
||||
#
|
||||
# Given that it is always loaded, you are encouraged to keep this file as
|
||||
# light-weight as possible. Requiring heavyweight dependencies from this file
|
||||
# will add to the boot time of your test suite on EVERY test run, even for an
|
||||
# individual file that may not need all of that loaded. Instead, consider making
|
||||
# a separate helper file that requires the additional dependencies and performs
|
||||
# the additional setup, and require it from the spec files that actually need
|
||||
# it.
|
||||
#
|
||||
# See https://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
||||
RSpec.configure do |config|
|
||||
# rspec-expectations config goes here. You can use an alternate
|
||||
# assertion/expectation library such as wrong or the stdlib/minitest
|
||||
# assertions if you prefer.
|
||||
config.expect_with :rspec do |expectations|
|
||||
# This option will default to `true` in RSpec 4. It makes the `description`
|
||||
# and `failure_message` of custom matchers include text for helper methods
|
||||
# defined using `chain`, e.g.:
|
||||
# be_bigger_than(2).and_smaller_than(4).description
|
||||
# # => "be bigger than 2 and smaller than 4"
|
||||
# ...rather than:
|
||||
# # => "be bigger than 2"
|
||||
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
||||
end
|
||||
|
||||
# rspec-mocks config goes here. You can use an alternate test double
|
||||
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
||||
config.mock_with :rspec do |mocks|
|
||||
# Prevents you from mocking or stubbing a method that does not exist on
|
||||
# a real object. This is generally recommended, and will default to
|
||||
# `true` in RSpec 4.
|
||||
mocks.verify_partial_doubles = true
|
||||
end
|
||||
|
||||
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
||||
# have no way to turn it off -- the option exists only for backwards
|
||||
# compatibility in RSpec 3). It causes shared context metadata to be
|
||||
# inherited by the metadata hash of host groups and examples, rather than
|
||||
# triggering implicit auto-inclusion in groups with matching metadata.
|
||||
config.shared_context_metadata_behavior = :apply_to_host_groups
|
||||
|
||||
# The settings below are suggested to provide a good initial experience
|
||||
# with RSpec, but feel free to customize to your heart's content.
|
||||
=begin
|
||||
# This allows you to limit a spec run to individual examples or groups
|
||||
# you care about by tagging them with `:focus` metadata. When nothing
|
||||
# is tagged with `:focus`, all examples get run. RSpec also provides
|
||||
# aliases for `it`, `describe`, and `context` that include `:focus`
|
||||
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
||||
config.filter_run_when_matching :focus
|
||||
|
||||
# Allows RSpec to persist some state between runs in order to support
|
||||
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
||||
# you configure your source control system to ignore this file.
|
||||
config.example_status_persistence_file_path = "spec/examples.txt"
|
||||
|
||||
# Limits the available syntax to the non-monkey patched syntax that is
|
||||
# recommended. For more details, see:
|
||||
# https://rspec.info/features/3-12/rspec-core/configuration/zero-monkey-patching-mode/
|
||||
config.disable_monkey_patching!
|
||||
|
||||
# This setting enables warnings. It's recommended, but in some cases may
|
||||
# be too noisy due to issues in dependencies.
|
||||
config.warnings = true
|
||||
|
||||
# Many RSpec users commonly either run the entire suite or an individual
|
||||
# file, and it's useful to allow more verbose output when running an
|
||||
# individual spec file.
|
||||
if config.files_to_run.one?
|
||||
# Use the documentation formatter for detailed output,
|
||||
# unless a formatter has already been configured
|
||||
# (e.g. via a command-line flag).
|
||||
config.default_formatter = "doc"
|
||||
end
|
||||
|
||||
# Print the 10 slowest examples and example groups at the
|
||||
# end of the spec run, to help surface which specs are running
|
||||
# particularly slow.
|
||||
config.profile_examples = 10
|
||||
|
||||
# Run specs in random order to surface order dependencies. If you find an
|
||||
# order dependency and want to debug it, you can fix the order by providing
|
||||
# the seed, which is printed after each run.
|
||||
# --seed 1234
|
||||
config.order = :random
|
||||
|
||||
# Seed global randomization in this process using the `--seed` CLI option.
|
||||
# Setting this allows you to use `--seed` to deterministically reproduce
|
||||
# test failures related to randomization by passing the same `--seed` value
|
||||
# as the one that triggered the failure.
|
||||
Kernel.srand config.seed
|
||||
=end
|
||||
end
|
||||
BIN
sway/bg.png
Normal file
BIN
sway/bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 593 KiB |
34
sway/config
Normal file
34
sway/config
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# Default config for sway
|
||||
#
|
||||
# Copy this to ~/.config/sway/config and edit it to your liking.
|
||||
#
|
||||
# Read `man 5 sway` for a complete reference.
|
||||
|
||||
# styles - set the folder for your theme definition file
|
||||
set $theme /usr/share/sway/themes/matcha-green
|
||||
|
||||
# theme variables
|
||||
include $theme/theme.conf
|
||||
|
||||
# user theme variable can override the global theme
|
||||
include $HOME/.config/sway/definitions.d/theme.conf
|
||||
|
||||
# global variables
|
||||
include /etc/sway/definitions
|
||||
|
||||
# user variables can override global definitions
|
||||
include $HOME/.config/sway/definitions.d/*.conf
|
||||
|
||||
include /etc/sway/inputs/*
|
||||
|
||||
# enable modes
|
||||
include /etc/sway/modes/*
|
||||
|
||||
# only enable this if every app you use is compatible with wayland
|
||||
# xwayland disable
|
||||
|
||||
# include additional configs e.g. to autostart applications
|
||||
include /etc/sway/config.d/*
|
||||
|
||||
# user config
|
||||
include $HOME/.config/sway/config.d/*.conf
|
||||
10
sway/config.d/keyboard.conf
Normal file
10
sway/config.d/keyboard.conf
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
### Input configuration
|
||||
#
|
||||
# You can get the names of your inputs by running: swaymsg -t get_inputs
|
||||
# Read `man 5 sway-input` for more information about this section.
|
||||
# xkb_options caps:ctrl_modifier
|
||||
input type:keyboard {
|
||||
xkb_layout "fr,us"
|
||||
xkb_variant "azerty"
|
||||
xkb_options caps:ctrl_modifier
|
||||
}
|
||||
12
sway/config.d/scratchpad.conf
Normal file
12
sway/config.d/scratchpad.conf
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#
|
||||
# Scratchpad:
|
||||
#
|
||||
# Sway has a "scratchpad", which is a bag of holding for windows.
|
||||
# You can send windows there and get them back later.
|
||||
|
||||
## Action // Move window to scratchpad ##
|
||||
bindsym $mod+Shift+agrave move scratchpad, exec "waybar-signal scratchpad"
|
||||
|
||||
# If there are multiple scratchpad windows, this command cycles through them.
|
||||
## Action // Toggle scratchpad ##
|
||||
bindsym $mod+agrave scratchpad show, exec "waybar-signal scratchpad"
|
||||
26
sway/config.d/workspace.conf
Normal file
26
sway/config.d/workspace.conf
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
$unbindsym $mod+minus
|
||||
$unbindsym $mod+Shift+minus
|
||||
|
||||
# Switch to workspace
|
||||
bindsym $mod+ampersand workspace $ws1
|
||||
bindsym $mod+eacute workspace $ws2
|
||||
bindsym $mod+quotedbl workspace $ws3
|
||||
bindsym $mod+apostrophe workspace $ws4
|
||||
bindsym $mod+parenleft workspace $ws5
|
||||
bindsym $mod+minus workspace $ws6
|
||||
bindsym $mod+egrave workspace $ws7
|
||||
bindsym $mod+underscore workspace $ws8
|
||||
bindsym $mod+ccedilla workspace $ws9
|
||||
|
||||
# move focused container to workspace
|
||||
bindsym $mod+Shift+ampersand move container to workspace $ws1, exec $focus_ws $ws1
|
||||
bindsym $mod+Shift+eacute move container to workspace $ws2, exec $focus_ws $ws2
|
||||
bindsym $mod+Shift+quotedbl move container to workspace $ws3, exec $focus_ws $ws3
|
||||
bindsym $mod+Shift+apostrophe move container to workspace $ws4, exec $focus_ws $ws4
|
||||
bindsym $mod+Shift+parenleft move container to workspace $ws5, exec $focus_ws $ws5
|
||||
bindsym $mod+Shift+minus move container to workspace $ws6, exec $focus_ws $ws6
|
||||
bindsym $mod+Shift+egrave move container to workspace $ws7, exec $focus_ws $ws7
|
||||
bindsym $mod+Shift+underscore move container to workspace $ws8, exec $focus_ws $ws8
|
||||
bindsym $mod+Shift+ccedilla move container to workspace $ws9, exec $focus_ws $ws9
|
||||
# Note: workspaces can have any name you want, not just numbers.
|
||||
# We just use 1-10 as the default.
|
||||
1
sway/definitions.d/bg.conf
Normal file
1
sway/definitions.d/bg.conf
Normal file
|
|
@ -0,0 +1 @@
|
|||
set $background /home/krichtof/.config/sway/bg.png
|
||||
1
sway/definitions.d/focus.conf
Normal file
1
sway/definitions.d/focus.conf
Normal file
|
|
@ -0,0 +1 @@
|
|||
set $focus_after_move true
|
||||
1
sway/definitions.d/lock.conf
Normal file
1
sway/definitions.d/lock.conf
Normal file
|
|
@ -0,0 +1 @@
|
|||
set $locking swaylock --daemonize --color "$selection-color" --inside-color "$selection-color" --inside-clear-color "$text-color" --ring-color "$color2" --ring-clear-color "$color11" --ring-ver-color "$color13" --show-failed-attempts --fade-in 0.2 --grace 2 --image ~/.config/sway/locked.png --ignore-empty-password --hide-keyboard-layout --text-wrong "Caramba" --text-clear "Validé" --text-ver "Suspens"
|
||||
5
sway/definitions.d/term.conf
Normal file
5
sway/definitions.d/term.conf
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
set $term alacritty
|
||||
set $term_cwd $term --working-directory "$(swaycwd 2>/dev/null || echo $HOME)"
|
||||
set $term_float footclient --app-id floating_shell --window-size-chars 164*50
|
||||
set $term_float alacritty -T alacritty_float --hold -e sh -c
|
||||
for_window [title="alacritty_float"] floating enable
|
||||
BIN
sway/locked.png
Normal file
BIN
sway/locked.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 MiB |
63
tmux.conf
Normal file
63
tmux.conf
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
unbind C-b
|
||||
set -g prefix C-s
|
||||
|
||||
set -g default-terminal "xterm-256color"
|
||||
set-option -ga terminal-overrides ",xterm-256color:Tc"
|
||||
|
||||
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
|
||||
|
||||
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
|
||||
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
|
||||
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
|
||||
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
|
||||
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
|
||||
|
||||
bind-key - split-window -v -c '#{pane_current_path}'
|
||||
bind-key | split-window -h -c '#{pane_current_path}'
|
||||
bind c new-window -c "#{pane_current_path}"
|
||||
|
||||
set -g base-index 1
|
||||
set -g renumber-windows on
|
||||
|
||||
bind-key b break-pane -d
|
||||
bind-key C-j choose-tree
|
||||
|
||||
# Fine adjustment (1 or 2 cursor cells per bump)
|
||||
bind -n S-Left if-shell "$is_vim" "send-keys S-Left" "resize-pane -L 2"
|
||||
bind -n S-Right if-shell "$is_vim" "send-keys S-Right" "resize-pane -R 2"
|
||||
bind -n S-Down if-shell "$is_vim" "send-keys S-Down" "resize-pane -D 1"
|
||||
bind -n S-Up if-shell "$is_vim" "send-keys S-Up" "resize-pane -U 1"
|
||||
|
||||
# Coarse adjustment (5 or 10 cursor cells per bump)
|
||||
bind -n C-Left if-shell "$is_vim" "send-keys C-Left" "resize-pane -L 10"
|
||||
bind -n C-Right if-shell "$is_vim" "send-keys C-Right" "resize-pane -R 10"
|
||||
bind -n C-Down if-shell "$is_vim" "send-keys C-Down" "resize-pane -D 5"
|
||||
bind -n C-Up if-shell "$is_vim" "send-keys C-Up" "resize-pane -U 5"
|
||||
|
||||
# Use vim keybindings in copy mode
|
||||
setw -g mode-keys vi
|
||||
|
||||
# Setup 'v' to begin selection as in Vim
|
||||
#bind-key -t vi-copy v begin-selection
|
||||
#bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
|
||||
|
||||
# Update default binding of `Enter` to also use copy-pipe
|
||||
#unbind -t vi-copy Enter
|
||||
#bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
|
||||
|
||||
set-option -g default-terminal "screen-256color"
|
||||
#source "/home/krichtof/.local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf"
|
||||
|
||||
# toggle status bar visibility
|
||||
if-shell '[ ! -z "$VIMRUNTIME" ]' {
|
||||
set -g status off
|
||||
}
|
||||
|
||||
# bind-key u set-option -g status
|
||||
|
||||
# List of plugins
|
||||
# set -g @plugin 'catppuccin/tmux'
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
||||
run '~/.tmux/plugins/tpm/tpm'
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="main.css">
|
||||
<script type="module">
|
||||
import { Application, Controller } from "https://unpkg.com/@hotwired/stimulus/dist/stimulus.js"
|
||||
window.Stimulus = Application.start()
|
||||
|
||||
Stimulus.register("mood", class extends Controller {
|
||||
static targets = [ "image" ]
|
||||
|
||||
showMode(event) {
|
||||
const image = this.imageTarget
|
||||
image.src = event.target.dataset.mode + ".png"
|
||||
}
|
||||
|
||||
showCurrent() {
|
||||
const image = this.imageTarget
|
||||
image.src = "<%= @mode %>.png"
|
||||
}
|
||||
|
||||
})
|
||||
</script>
|
||||
</head>
|
||||
<main data-controller="mood">
|
||||
<div class="mode">
|
||||
<img data-mood-target="image" src="<%= @mode %>.png">
|
||||
</div>
|
||||
<div class="tracker">
|
||||
<div class="title">
|
||||
<h1>Comment il va le Robi ?</h1>
|
||||
</div>
|
||||
<div class="moods">
|
||||
<div class="log">
|
||||
<% @mood_log.each do |week| %>
|
||||
<div class="week">
|
||||
<% week.each do |d| %>
|
||||
<% if d[1] %>
|
||||
<div data-mode="<%= d[1] %>" data-action="mouseover->mood#showMode mouseleave->mood#showCurrent" title="<%= d[0] %> : <%= d[1] %>" class="day <%= d[1] %>"></div>
|
||||
<% else %>
|
||||
<div class="day"></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="legend">
|
||||
<div class="legend-mood">
|
||||
<div class="bar-frigo"></div>
|
||||
<div class="bar-explain">Triste</div>
|
||||
</div>
|
||||
<div class="legend-mood">
|
||||
<div class="bar-en-charge"></div>
|
||||
<div class="bar-explain">En charge</div>
|
||||
</div>
|
||||
<div class="legend-mood">
|
||||
<div class="bar-croisiere"></div>
|
||||
<div class="bar-explain">Croisiere</div>
|
||||
</div>
|
||||
<div class="legend-mood">
|
||||
<div class="bar-creatif"></div>
|
||||
<div class="bar-explain">Créatif</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
367
waybar/config.jsonc
Normal file
367
waybar/config.jsonc
Normal file
|
|
@ -0,0 +1,367 @@
|
|||
// =============================================================================
|
||||
//
|
||||
// Waybar configuration
|
||||
//
|
||||
// Configuration reference: https://github.com/Alexays/Waybar/wiki/Configuration
|
||||
//
|
||||
// =============================================================================
|
||||
|
||||
{
|
||||
// -------------------------------------------------------------------------
|
||||
// Global configuration
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
"layer": "top",
|
||||
|
||||
// If height property would be not present, it'd be calculated dynamically
|
||||
"height": 30,
|
||||
"position": "bottom",
|
||||
|
||||
"modules-left": ["custom/menu", "sway/workspaces", "custom/scratchpad"],
|
||||
"modules-center": [
|
||||
"custom/wf-recorder",
|
||||
"sway/mode",
|
||||
"custom/weather",
|
||||
"sway/window"
|
||||
],
|
||||
"modules-right": [
|
||||
// informational
|
||||
"sway/language",
|
||||
"custom/github",
|
||||
"custom/clipboard",
|
||||
"custom/zeit",
|
||||
// "cpu",
|
||||
// "temperature",
|
||||
"battery",
|
||||
|
||||
// connecting
|
||||
"network",
|
||||
"bluetooth",
|
||||
"custom/valent",
|
||||
|
||||
// media
|
||||
"custom/playerctl",
|
||||
"custom/idle_inhibitor",
|
||||
"custom/dnd",
|
||||
"pulseaudio",
|
||||
"backlight",
|
||||
|
||||
// system
|
||||
// "custom/adaptive-light",
|
||||
// "custom/sunset",
|
||||
"custom/pacman",
|
||||
|
||||
"tray",
|
||||
"clock"
|
||||
],
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Modules
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
"battery": {
|
||||
"interval": 30,
|
||||
"states": {
|
||||
"warning": 30,
|
||||
"critical": 15
|
||||
},
|
||||
"format-charging": " {capacity}%",
|
||||
"format": "{icon} {capacity}%",
|
||||
"format-icons": ["", "", "", "", "", "", "", "", "", ""],
|
||||
"tooltip": true
|
||||
},
|
||||
|
||||
"clock": {
|
||||
"interval": 60,
|
||||
"format": "{:%e %b %Y %H:%M}",
|
||||
"tooltip": true,
|
||||
"tooltip-format": "<big>{:%B %Y}</big>\n<tt>{calendar}</tt>",
|
||||
"on-click": "swaymsg exec \\$calendar"
|
||||
},
|
||||
|
||||
"cpu": {
|
||||
"interval": 10,
|
||||
"format": "",
|
||||
"states": {
|
||||
"warning": 70,
|
||||
"critical": 90
|
||||
},
|
||||
"on-click": "swaymsg exec \\$task_manager",
|
||||
"tooltip": true
|
||||
},
|
||||
|
||||
"memory": {
|
||||
"interval": 10,
|
||||
"format": "",
|
||||
"states": {
|
||||
"warning": 70,
|
||||
"critical": 90
|
||||
},
|
||||
"on-click": "swaymsg exec \\$task_manager",
|
||||
"tooltip": true
|
||||
},
|
||||
|
||||
"network": {
|
||||
"interval": 5,
|
||||
"format-wifi": "{icon}",
|
||||
"format-ethernet": "",
|
||||
"format-disconnected": "",
|
||||
"format-disabled": "",
|
||||
"format-icons": [
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
],
|
||||
"tooltip-format": "{icon} {ifname}: {ipaddr}",
|
||||
"tooltip-format-ethernet": "{icon} {ifname}: {ipaddr}",
|
||||
"tooltip-format-wifi": "{icon} {ifname} ({essid}): {ipaddr}",
|
||||
"tooltip-format-disconnected": "{icon} disconnected",
|
||||
"tooltip-format-disabled": "{icon} disabled",
|
||||
"on-click": "swaymsg exec \\$once \\$term_float nmtui connect"
|
||||
},
|
||||
|
||||
"sway/mode": {
|
||||
"format": "<span style=\"italic\">{}</span>",
|
||||
"tooltip": false
|
||||
},
|
||||
|
||||
"backlight": {
|
||||
"format": "{icon} {percent}%",
|
||||
"format-icons": ["", "", ""],
|
||||
"on-scroll-up": "swaymsg exec \\$brightness_up",
|
||||
"on-scroll-down": "swaymsg exec \\$brightness_down"
|
||||
},
|
||||
|
||||
"pulseaudio": {
|
||||
"scroll-step": 5,
|
||||
"format": "{icon} {volume}%{format_source}",
|
||||
"format-muted": " {format_source}",
|
||||
"format-source": "",
|
||||
"format-source-muted": " ",
|
||||
"format-icons": {
|
||||
"headphone": "",
|
||||
"headset": "",
|
||||
"default": ["", "", ""]
|
||||
},
|
||||
"tooltip-format": "{icon} {volume}% {format_source}",
|
||||
"on-click": "swaymsg exec \\$pulseaudio",
|
||||
"on-click-middle": "swaymsg exec \\$volume_mute",
|
||||
"on-scroll-up": "swaymsg exec \\$volume_up",
|
||||
"on-scroll-down": "swaymsg exec \\$volume_down"
|
||||
},
|
||||
|
||||
"temperature": {
|
||||
"critical-threshold": 90,
|
||||
"interval": 5,
|
||||
"format": "{icon}",
|
||||
"tooltip-format": "{temperatureC}°C",
|
||||
"format-icons": ["", "", ""],
|
||||
"tooltip": true,
|
||||
"on-click": "swaymsg exec \"\\$once \\$term_float watch sensors\""
|
||||
},
|
||||
|
||||
"tray": {
|
||||
"icon-size": 21,
|
||||
"spacing": 5
|
||||
},
|
||||
|
||||
"custom/pacman": {
|
||||
"format": " {}",
|
||||
"interval": 3600,
|
||||
"return-type": "json",
|
||||
"exec-if": "/usr/share/sway/scripts/checkupdates.sh check",
|
||||
"exec": "/usr/share/sway/scripts/checkupdates.sh status",
|
||||
"on-click": "/usr/share/sway/scripts/checkupdates.sh check && swaymsg exec \\$update_manager",
|
||||
"on-click-middle": "waybar-signal pacman",
|
||||
"signal": 14
|
||||
},
|
||||
|
||||
"custom/menu": {
|
||||
"format": "",
|
||||
"on-click": "swaymsg exec \\$menu",
|
||||
"tooltip": false
|
||||
},
|
||||
|
||||
"bluetooth": {
|
||||
"format": "",
|
||||
"format-disabled": "",
|
||||
"on-click": "swaymsg exec \\$bluetooth",
|
||||
"on-click-right": "rfkill toggle bluetooth",
|
||||
"tooltip-format": "{}"
|
||||
},
|
||||
|
||||
"sway/language": {
|
||||
"format": " {}",
|
||||
"min-length": 5,
|
||||
"tooltip": false,
|
||||
"on-click": "swaymsg input type:keyboard xkb_switch_layout next"
|
||||
},
|
||||
|
||||
"custom/scratchpad": {
|
||||
"interval": "once",
|
||||
"return-type": "json",
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"one": "",
|
||||
"many": ""
|
||||
},
|
||||
"exec": "/bin/sh /usr/share/sway/scripts/scratchpad.sh",
|
||||
"on-click": "swaymsg 'scratchpad show'",
|
||||
"signal": 7
|
||||
},
|
||||
|
||||
"custom/sunset": {
|
||||
"interval": "once",
|
||||
"tooltip": true,
|
||||
"return-type": "json",
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"on": "",
|
||||
"off": ""
|
||||
},
|
||||
"exec": "fallback_latitude=50.1 fallback_longitude=8.7 latitude= longitude= /usr/share/sway/scripts/sunset.sh",
|
||||
"on-click": "/usr/share/sway/scripts/sunset.sh toggle",
|
||||
"exec-if": "/usr/share/sway/scripts/sunset.sh check",
|
||||
"signal": 6
|
||||
},
|
||||
|
||||
"custom/wf-recorder": {
|
||||
"interval": "once",
|
||||
"return-type": "json",
|
||||
"format": "{}",
|
||||
"exec": "echo '{\"class\": \"recording\",\"text\":\"\",\"tooltip\":\"press $mod+Esc to stop recording\"}'",
|
||||
"exec-if": "pgrep wf-recorder",
|
||||
"on-click": "waybar-signal recorder",
|
||||
"signal": 8
|
||||
},
|
||||
|
||||
"custom/github": {
|
||||
"interval": 300,
|
||||
"tooltip": false,
|
||||
"return-type": "json",
|
||||
"format": " {}",
|
||||
"exec": "gh api '/notifications' -q '{ text: length }' | cat -",
|
||||
"exec-if": "[ -x \"$(command -v gh)\" ] && gh auth status 2>&1 | grep -q -m 1 'Logged in' && test $(gh api '/notifications' -q 'length') -ne 0",
|
||||
"on-click": "test $(gh api '/notifications' -q 'length') -ne 0 && xdg-open https://github.com/notifications && sleep 30 && waybar-signal github",
|
||||
"signal": 4
|
||||
},
|
||||
|
||||
"custom/playerctl": {
|
||||
"interval": "once",
|
||||
"tooltip": true,
|
||||
"return-type": "json",
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"Playing": "",
|
||||
"Paused": ""
|
||||
},
|
||||
"exec": "playerctl metadata --format '{\"alt\": \"{{status}}\", \"tooltip\": \"{{playerName}}: {{markup_escape(title)}} - {{markup_escape(artist)}}\" }'",
|
||||
"on-click": "playerctl play-pause",
|
||||
"on-click-right": "playerctl next",
|
||||
"on-scroll-up": "playerctl position 10+",
|
||||
"on-scroll-down": "playerctl position 10-",
|
||||
"signal": 5
|
||||
},
|
||||
|
||||
"custom/clipboard": {
|
||||
"format": "",
|
||||
"interval": "once",
|
||||
"return-type": "json",
|
||||
"on-click": "swaymsg -q exec '$clipboard'; waybar-signal clipboard",
|
||||
"on-click-right": "swaymsg -q exec '$clipboard-del'; waybar-signal clipboard",
|
||||
"on-click-middle": "rm -f ~/.cache/cliphist/db; waybar-signal clipboard",
|
||||
"exec": "printf '{\"tooltip\":\"%s\"}' $(cliphist list | wc -l)' item(s) in the clipboard\r(Mid click to clear)'",
|
||||
"exec-if": "[ -x \"$(command -v cliphist)\" ] && [ $(cliphist list | wc -l) -gt 0 ]",
|
||||
"signal": 9
|
||||
},
|
||||
|
||||
"custom/weather": {
|
||||
"format": "{}",
|
||||
"tooltip": true,
|
||||
"interval": 3600,
|
||||
// accepts -c/--city <city> -t/--temperature <C/F> -d/--distance <km/miles>
|
||||
"exec": "/usr/share/sway/scripts/weather.py",
|
||||
"return-type": "json",
|
||||
"on-click": "xdg-open \"https://wttr.in/$(curl -s https://manjaro-sway.download/geoip | jq -r '.city')\"",
|
||||
"on-click-right": "waybar-signal weather",
|
||||
"signal": 16
|
||||
},
|
||||
|
||||
"custom/zeit": {
|
||||
"return-type": "json",
|
||||
"interval": "once",
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"tracking": "",
|
||||
"stopped": ""
|
||||
},
|
||||
"exec": "/usr/share/sway/scripts/zeit.sh status",
|
||||
"on-click": "/usr/share/sway/scripts/zeit.sh click; waybar-signal zeit",
|
||||
"exec-if": "[ -x \"$(command -v zeit)\" ]",
|
||||
"signal": 10
|
||||
},
|
||||
|
||||
"custom/dnd": {
|
||||
"interval": "once",
|
||||
"return-type": "json",
|
||||
"format": "{}{icon}",
|
||||
"format-icons": {
|
||||
"default": "",
|
||||
"dnd": ""
|
||||
},
|
||||
"on-click": "/usr/share/sway/scripts/dnd.sh toggle; waybar-signal dnd",
|
||||
"on-click-right": "/usr/share/sway/scripts/dnd.sh restore",
|
||||
"exec": "/usr/share/sway/scripts/dnd.sh status",
|
||||
"signal": 11
|
||||
},
|
||||
|
||||
"custom/adaptive-light": {
|
||||
"interval": "once",
|
||||
"tooltip": true,
|
||||
"return-type": "json",
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"on": "",
|
||||
"off": ""
|
||||
},
|
||||
"exec": "/usr/share/sway/scripts/wluma.sh",
|
||||
"on-click": "/usr/share/sway/scripts/wluma.sh toggle",
|
||||
"exec-if": "/usr/share/sway/scripts/wluma.sh check",
|
||||
"signal": 12
|
||||
},
|
||||
|
||||
"custom/valent": {
|
||||
"format": "{icon}",
|
||||
"tooltip": true,
|
||||
"interval": 60,
|
||||
"exec": "/usr/share/sway/scripts/valent.py",
|
||||
"exec-if": "[ -x \"$(command -v valent)\" ]",
|
||||
"return-type": "json",
|
||||
"format-icons": {
|
||||
"no-devices": "",
|
||||
"dangerously-empty": "",
|
||||
"no-signal": "",
|
||||
"connected": "",
|
||||
"disconnected": ""
|
||||
},
|
||||
"on-click": "valent",
|
||||
"on-click-middle": "waybar-signal valent",
|
||||
"signal": 13
|
||||
},
|
||||
|
||||
"custom/idle_inhibitor": {
|
||||
"interval": 60,
|
||||
"return-type": "json",
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"on": "",
|
||||
"off": ""
|
||||
},
|
||||
"exec": "inhibit-idle",
|
||||
"on-click": "inhibit-idle off; inhibit-idle interactive",
|
||||
"on-click-middle": "inhibit-idle off",
|
||||
"signal": 15
|
||||
}
|
||||
}
|
||||
1
waybar/style.css
Normal file
1
waybar/style.css
Normal file
|
|
@ -0,0 +1 @@
|
|||
@import "/usr/share/sway/templates/waybar/style.css";
|
||||
26
zshrc
Normal file
26
zshrc
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# Use powerline
|
||||
USE_POWERLINE="true"
|
||||
# Has weird character width
|
||||
# Example:
|
||||
# is not a diamond
|
||||
HAS_WIDECHARS="false"
|
||||
# Source manjaro-zsh-configuration
|
||||
if [[ -e /usr/share/zsh/manjaro-zsh-config ]]; then
|
||||
source /usr/share/zsh/manjaro-zsh-config
|
||||
fi
|
||||
# Use manjaro zsh prompt
|
||||
if [[ -e /usr/share/zsh/manjaro-zsh-prompt ]]; then
|
||||
source /usr/share/zsh/manjaro-zsh-prompt
|
||||
fi
|
||||
|
||||
PATH=$HOME/.local/bin:$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH
|
||||
EDITOR=nvim
|
||||
|
||||
alias vi=nvim
|
||||
|
||||
if [[ -e $HOME/.config/zsh/autocomplete_zeit ]]; then
|
||||
source $HOME/.config/zsh/autocomplete_zeit
|
||||
fi
|
||||
|
||||
set -o vi
|
||||
bindkey '^R' history-incremental-search-backward
|
||||
Loading…
Add table
Reference in a new issue