Compare commits

12 Commits

Author SHA1 Message Date
8d57821630 Set terminal type 2023-12-29 10:21:47 +03:00
ae9174ce27 Fix typo 2023-12-27 10:58:32 +03:00
d9832eb8e7 Update font in alacritty 2023-12-26 17:51:04 +03:00
b457a84dfd Update zsh submodule 2023-12-26 11:56:45 +03:00
466115287b Add .gitconfig 2023-12-26 01:12:02 +03:00
f9f728740d Add zsh env 2023-12-26 01:07:26 +03:00
d5a3b02f8e Add zsh config 2023-12-26 01:02:21 +03:00
b20e72a14c Update submodules 2023-12-26 00:20:34 +03:00
ae55fd8572 Add custom scripts 2023-12-26 00:12:37 +03:00
e067d3c93a Add nvim config as a submodule 2023-12-25 23:54:45 +03:00
2dd52a9fbf Add taskwarrior config 2023-12-25 23:24:05 +03:00
23708bf23f Update timewarrior config 2023-12-25 23:20:27 +03:00
11 changed files with 160 additions and 9 deletions

View File

@ -126,9 +126,8 @@ env:
# Font configuration # Font configuration
font: font:
normal: normal:
family: FiraCode Nerd Font Mono family: MesloLGS Nerd Font
#family: FantasqueSansM Nerd Font Mono style: Regular
style: regular
#font: #font:
# Normal (roman) font face # Normal (roman) font face

1
.config/nvim Submodule

Submodule .config/nvim added at 72ca507530

View File

@ -0,0 +1,67 @@
#!/usr/bin/env python3
'''Timewarrior on-modify hook to call timew on start,stop, done commands.'''
import json
import shlex
import subprocess
import sys
def retrieve_args_dict():
'''Read process arguments and store them in a dictionary.'''
process_args = sys.argv[1:]
dictionary = dict()
for process_arg in process_args:
splitted = process_arg.split(':')
if len(splitted) > 1:
key = splitted[0]
value = ''.join(splitted[1:])
dictionary[key] = value
return dictionary
def determine_timew_tags(task):
'''Determine which timew "tags" should be used for the task.'''
tags = list()
# Keys associated with one value
for key in ['uuid', 'project', 'description']:
if key in task:
tags.append('{}:{}'.format(key, task[key]))
# Keys associated with several values
if 'tags' in task:
for value in task['tags']:
tags.append('tag:{}'.format(value))
return tags
def generate_timew_command(cmd, tags):
'''Generate an input for subprocess.call.'''
tags_as_string = ' '.join([shlex.quote(tag) for tag in tags])
if cmd == 'done':
cmd = 'stop'
cmd_string = f'timew {cmd} {tags_as_string} :yes'
return shlex.split(cmd_string)
def main():
'''Main function of this module.'''
old_task = json.loads(sys.stdin.readline())
new_task = json.loads(sys.stdin.readline())
args = retrieve_args_dict()
# Do something.
feedback = None
if 'api' in args: # Only do something for known API.
if args['api'] in ['2']: # APIs that give us a 'command' key.
cmd = args['command']
if cmd in ['start', 'stop', 'done']: # Only do something on 'start', 'stop' or 'done'
timew_tags = determine_timew_tags(new_task)
timew_cmd = generate_timew_command(cmd, timew_tags)
subprocess.call(timew_cmd)
# Generate output as task expects it.
print(json.dumps(new_task))
if feedback is not None:
print(feedback)
sys.exit(0)
if __name__ == "__main__":
main()

47
.config/task/taskrc Normal file
View File

@ -0,0 +1,47 @@
# [Created by task 2.6.2 12/23/2023 17:46:47]
# Taskwarrior program configuration file.
# For more documentation, see https://taskwarrior.org or try 'man task', 'man task-color',
# 'man task-sync' or 'man taskrc'
# Here is an example of entries that use the default, override and blank values
# variable=foo -- By specifying a value, this overrides the default
# variable= -- By specifying no value, this means no default
# #variable=foo -- By commenting out the line, or deleting it, this uses the default
# You can also refence environment variables:
# variable=$HOME/task
# variable=$VALUE
# Use the command 'task show' to see all defaults and overrides
# data.location=/home/sahin/.task
# To use the default location of the XDG directories,
# move this configuration file from ~/.taskrc to ~/.config/task/taskrc and uncomment below
# Files
include holidays.tr-TR.rc
data.location=~/.local/share/task
hooks.location=~/.config/task/hooks
# Color theme (uncomment one to use)
include solarized-dark-256.theme
#include dark-16.theme
#include light-16.theme
#include light-256.theme
#include dark-256.theme
#include dark-red-256.theme
#include dark-green-256.theme
#include dark-blue-256.theme
#include dark-violets-256.theme
#include dark-yellow-green.theme
#include dark-gray-256.theme
#include dark-gray-blue-256.theme
#include solarized-light-256.theme
#include no-color.theme
news.version=2.6.0
#
color.calendar.holiday=black on yellow

View File

@ -0,0 +1 @@
import /Users/sahin/.config/timewarrior/holidays/holidays.tr-TR

View File

@ -33,7 +33,7 @@ bind-key -n 'C-M-c' copy-mode
bind-key -T copy-mode-vi 'C-h' select-pane -L bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi kC-l' select-pane -R bind-key -T copy-mode-vi 'C-l' select-pane -R
# vim like copy mode # vim like copy mode
bind-key -T copy-mode-vi v send-keys -X begin-selection bind-key -T copy-mode-vi v send-keys -X begin-selection
@ -86,7 +86,7 @@ bind-key -n C-Down swap-pane -s '{down-of}'
bind-key -n C-Left swap-pane -s '{left-of}' bind-key -n C-Left swap-pane -s '{left-of}'
bind-key -n C-Right swap-pane -s '{right-of}' bind-key -n C-Right swap-pane -s '{right-of}'
# set -g default-terminal "xterm-256color" set -g default-terminal "xterm-256color"
# tell Tmux that outside terminal supports true color # tell Tmux that outside terminal supports true color
# set -ga terminal-overrides ",xterm-256color*:Tc" # set -ga terminal-overrides ",xterm-256color*:Tc"

1
.config/zsh Submodule

Submodule .config/zsh added at 268649fe14

6
.gitconfig Normal file
View File

@ -0,0 +1,6 @@
[user]
email = sahin@sahinakkaya.dev
name = Şahin Akkaya
signingkey = sahin@sahinakkaya.dev
[init]
defaultBranch = main

18
.gitmodules vendored
View File

@ -1,6 +1,16 @@
[submodule "/home/sahin/.config/tmux/plugins/tpm"] [submodule ".config/tmux/plugins/tpm"]
path = /home/sahin/.config/tmux/plugins/tpm path = .config/tmux/plugins/tpm
url = https://github.com/tmux-plugins/tpm.git url = https://github.com/tmux-plugins/tpm.git
[submodule "/home/sahin/.config/alacritty/themes"] branch = master
path = /home/sahin/.config/alacritty/themes [submodule ".config/alacritty/themes"]
path = .config/alacritty/themes
url = https://github.com/alacritty/alacritty-theme.git url = https://github.com/alacritty/alacritty-theme.git
branch = master
[submodule ".config/nvim"]
path = .config/nvim
url = https://github.com/sahinakkaya/nvim-config.git
branch = macos
[submodule ".config/zsh"]
path = .config/zsh
url = https://github.com/sahinakkaya/zsh-config.git
branch = macos

2
.zshenv Executable file
View File

@ -0,0 +1,2 @@
export ZDOTDIR="$HOME/.config/zsh"
export PATH="$HOME/scripts/:$HOME/.local/bin/:$PATH"

17
scripts/task-visualizer.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
#
tmux split-window -h
tmux split-window
tmux resize-pane -U 14
tmux resize-pane -R 5
tmux send-keys -t0 "btop" Enter
tmux send-keys -t1 "while true;do task next limit:5;sleep 2;done" Enter
tmux send-keys -t2 "while true;do task burndown.daily;sleep 3;done" Enter
tmux rename-window "tasks"
tmux new-window