Skip to content

Commit d5aedf2

Browse files
committed
update
1 parent b7bc269 commit d5aedf2

File tree

40 files changed

+1611
-1086
lines changed

40 files changed

+1611
-1086
lines changed

.obsidian/appearance.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"accentColor": "#7e47ff",
33
"interfaceFontFamily": "霞鹜文楷 Medium",
4-
"textFontFamily": "霞鹜文楷",
5-
"monospaceFontFamily": "Fira Mono for Powerline",
6-
"baseFontSize": 16,
4+
"textFontFamily": "霞鹜文楷 Medium",
5+
"monospaceFontFamily": "霞鹜文楷 Medium",
6+
"baseFontSize": 17,
77
"translucency": false,
88
"cssTheme": "Blue Topaz",
99
"enabledCssSnippets": [

.obsidian/community-plugins.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
"recent-files-obsidian",
2020
"floating-settings",
2121
"obsidian-hover-editor",
22-
"attachment-flow-plugin"
22+
"attachment-flow-plugin",
23+
"youhavebeenstaring-plugin"
2324
]

.obsidian/plugins/obsidian-daily-stats/data.json

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,34 @@
44
"2025/2/20": 457,
55
"2025/2/21": 0,
66
"2025/2/22": 1,
7-
"2025/2/24": 242
7+
"2025/2/24": 242,
8+
"2025/2/25": 337,
9+
"2025/2/26": 1,
10+
"2025/3/8": 0,
11+
"2025/3/12": 0,
12+
"2025/3/13": 17,
13+
"2025/3/14": 648
814
},
915
"todaysWordCount": {
10-
"📒文章/🤔反思和总结/💯考研/🗃️复试资料整理/面试问题准备.md": {
11-
"initial": 3970,
12-
"current": 4212
16+
"📒文章/🛠️实用工具/📦Scoop/Scoop的安装.md": {
17+
"initial": 209,
18+
"current": 363
19+
},
20+
"📒文章/🛠️实用工具/📦Scoop/Scoop——Windows下的包管理器.md": {
21+
"initial": 375,
22+
"current": 427
23+
},
24+
"📒文章/🖥️专业技能/📦Npm/未命名.md": {
25+
"initial": 15,
26+
"current": 15
27+
},
28+
"📒文章/🖥️专业技能/📦Npm/Npm&Pnpm的安装与配置.md": {
29+
"initial": 15,
30+
"current": 457
31+
},
32+
"📒文章/🛠️实用工具/📟Powershell/1-Powershell配置和美化方案.md": {
33+
"initial": 1583,
34+
"current": 1583
1335
}
1436
}
1537
}

.obsidian/plugins/obsidian-style-settings/data.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,5 +168,10 @@
168168
"blue-topaz-theme@@enable-icon-anima": false,
169169
"sidebar-footnote@@sidebar-footnote-status": false,
170170
"sidebar-footnote@@sidebar-footnote-backref": false,
171-
"sidebar-footnote@@footnote-sidebar-position": false
171+
"sidebar-footnote@@footnote-sidebar-position": false,
172+
"floating-toc-styles@@enable-outline-style": "default-outline-style",
173+
"floating-toc-styles@@enable-bar-style": "default-bar-style",
174+
"floating-toc-styles@@enable-bar-heading-text": false,
175+
"floating-toc-styles@@floating-toc-response-time": 0.2,
176+
"floating-toc-styles@@enable-background-blur-dept": false
172177
}

.obsidian/plugins/recent-files-obsidian/data.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,37 @@
11
{
22
"recentFiles": [
3+
{
4+
"basename": "1-Powershell配置和美化方案",
5+
"path": "📒文章/🛠️实用工具/📟Powershell/1-Powershell配置和美化方案.md"
6+
},
7+
{
8+
"basename": "Scoop——Windows下的包管理器",
9+
"path": "📒文章/🛠️实用工具/📦Scoop/Scoop——Windows下的包管理器.md"
10+
},
11+
{
12+
"basename": "Npm&Pnpm的安装与配置",
13+
"path": "📒文章/🖥️专业技能/📦Npm/Npm&Pnpm的安装与配置.md"
14+
},
15+
{
16+
"basename": "Npm发布自定义依赖包",
17+
"path": "📒文章/🖥️专业技能/📦Npm/Npm发布自定义依赖包.md"
18+
},
19+
{
20+
"basename": "Git安装配置",
21+
"path": "📒文章/🖥️专业技能/🌵Git/Git安装配置.md"
22+
},
323
{
424
"basename": "面试问题准备",
525
"path": "📒文章/🤔反思和总结/💯考研/🗃️复试资料整理/面试问题准备.md"
626
},
27+
{
28+
"basename": "复试联系导师",
29+
"path": "📒文章/🤔反思和总结/💯考研/复试联系导师.md"
30+
},
31+
{
32+
"basename": "index",
33+
"path": "📆日记/index.md"
34+
},
735
{
836
"basename": "流水不争先,争的是滔滔不绝",
937
"path": "📒文章/🤔反思和总结/📈个人成长/流水不争先,争的是滔滔不绝.md"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"totalUptime": 50099000,
3+
"lastLoad": 1744593257586,
4+
"currentSessionDuration": 19229000,
5+
"showTotalUptimeInStatusBar": false,
6+
"displayStaringTimeAsHumanString": true,
7+
"staringText": "You have been staring at your vault for ",
8+
"totalStaringText": "Your total staring time in this vault is ",
9+
"pausedText": "Your staring counter is paused"
10+
}
Lines changed: 255 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,255 @@
1+
'use strict';
2+
3+
var obsidian = require('obsidian');
4+
5+
/*! *****************************************************************************
6+
Copyright (c) Microsoft Corporation.
7+
8+
Permission to use, copy, modify, and/or distribute this software for any
9+
purpose with or without fee is hereby granted.
10+
11+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17+
PERFORMANCE OF THIS SOFTWARE.
18+
***************************************************************************** */
19+
/* global Reflect, Promise */
20+
21+
var extendStatics = function(d, b) {
22+
extendStatics = Object.setPrototypeOf ||
23+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
24+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
25+
return extendStatics(d, b);
26+
};
27+
28+
function __extends(d, b) {
29+
extendStatics(d, b);
30+
function __() { this.constructor = d; }
31+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
32+
}
33+
34+
function __awaiter(thisArg, _arguments, P, generator) {
35+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
36+
return new (P || (P = Promise))(function (resolve, reject) {
37+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
38+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
39+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
40+
step((generator = generator.apply(thisArg, _arguments || [])).next());
41+
});
42+
}
43+
44+
function __generator(thisArg, body) {
45+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
46+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
47+
function verb(n) { return function (v) { return step([n, v]); }; }
48+
function step(op) {
49+
if (f) throw new TypeError("Generator is already executing.");
50+
while (_) try {
51+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
52+
if (y = 0, t) op = [op[0] & 2, t.value];
53+
switch (op[0]) {
54+
case 0: case 1: t = op; break;
55+
case 4: _.label++; return { value: op[1], done: false };
56+
case 5: _.label++; y = op[1]; op = [0]; continue;
57+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
58+
default:
59+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
60+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
61+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
62+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
63+
if (t[2]) _.ops.pop();
64+
_.trys.pop(); continue;
65+
}
66+
op = body.call(thisArg, _);
67+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
68+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
69+
}
70+
}
71+
72+
var SETTINGS = {
73+
totalUptime: 0,
74+
lastLoad: Date.now(),
75+
currentSessionDuration: 0,
76+
showTotalUptimeInStatusBar: false,
77+
displayStaringTimeAsHumanString: true,
78+
staringText: 'You have been staring at your vault for ',
79+
totalStaringText: 'Your total staring time in this vault is ',
80+
pausedText: 'Your staring counter is paused'
81+
};
82+
var YouHaveBeenStaring = /** @class */ (function (_super) {
83+
__extends(YouHaveBeenStaring, _super);
84+
function YouHaveBeenStaring() {
85+
return _super !== null && _super.apply(this, arguments) || this;
86+
}
87+
YouHaveBeenStaring.prototype.onload = function () {
88+
return __awaiter(this, void 0, void 0, function () {
89+
var _this = this;
90+
return __generator(this, function (_a) {
91+
switch (_a.label) {
92+
case 0: return [4 /*yield*/, this.loadSettings()];
93+
case 1:
94+
_a.sent();
95+
this.settings.lastLoad = Date.now();
96+
this.settings.currentSessionDuration = 0;
97+
this.counterActive = true;
98+
this.staringTimeStatusBar = this.addStatusBarItem();
99+
this.totalStaringTimeStatusBar = this.addStatusBarItem();
100+
this.registerInterval(window.setInterval(function () {
101+
_this.showTimeSinceLoad(),
102+
_this.showTotalStaringTime(),
103+
_this.settings.totalUptime += _this.counterActive ? 1000 : 0,
104+
_this.settings.currentSessionDuration += _this.counterActive ? 1000 : 0;
105+
}, 1000));
106+
// Save every 10 minutes
107+
this.registerInterval(window.setInterval(function () {
108+
_this.saveSettings();
109+
}, 600000));
110+
this.addSettingTab(new YouHaveBeenStaringSettingsTab(this.app, this));
111+
this.addRibbonIcon('any-key', 'Start/stop staring counter', function () {
112+
_this.counterActive = !_this.counterActive;
113+
new obsidian.Notice('Turning staring counter ' + (_this.counterActive ? 'on' : 'off'));
114+
_this.saveSettings();
115+
});
116+
return [2 /*return*/];
117+
}
118+
});
119+
});
120+
};
121+
YouHaveBeenStaring.prototype.onunload = function () {
122+
this.saveSettings();
123+
};
124+
YouHaveBeenStaring.prototype.showTimeSinceLoad = function () {
125+
if (this.settings.lastLoad && this.counterActive) {
126+
var moment = window.moment;
127+
var staringTime = moment.duration(this.settings.currentSessionDuration, 'milliseconds').humanize();
128+
this.staringTimeStatusBar.setText(this.settings.staringText + ("" + staringTime));
129+
}
130+
if (!this.counterActive) {
131+
this.staringTimeStatusBar.setText(this.settings.pausedText);
132+
}
133+
};
134+
YouHaveBeenStaring.prototype.showTotalStaringTime = function () {
135+
if (this.settings.showTotalUptimeInStatusBar && this.settings.totalUptime > 0) {
136+
var moment = window.moment;
137+
var totalStaringTime = this.settings.displayStaringTimeAsHumanString
138+
? moment.duration(this.settings.totalUptime, 'milliseconds').humanize()
139+
: moment.duration(this.settings.totalUptime, 'milliseconds').hours() + ':' + moment.duration(this.settings.totalUptime, 'milliseconds').minutes();
140+
this.totalStaringTimeStatusBar.setText(this.settings.totalStaringText + ("" + totalStaringTime));
141+
}
142+
};
143+
YouHaveBeenStaring.prototype.loadSettings = function () {
144+
return __awaiter(this, void 0, void 0, function () {
145+
var _a, _b, _c, _d;
146+
return __generator(this, function (_e) {
147+
switch (_e.label) {
148+
case 0:
149+
_a = this;
150+
_c = (_b = Object).assign;
151+
_d = [SETTINGS];
152+
return [4 /*yield*/, this.loadData()];
153+
case 1:
154+
_a.settings = _c.apply(_b, _d.concat([_e.sent()]));
155+
return [2 /*return*/];
156+
}
157+
});
158+
});
159+
};
160+
YouHaveBeenStaring.prototype.saveSettings = function () {
161+
return __awaiter(this, void 0, void 0, function () {
162+
return __generator(this, function (_a) {
163+
switch (_a.label) {
164+
case 0: return [4 /*yield*/, this.saveData(this.settings)];
165+
case 1:
166+
_a.sent();
167+
return [2 /*return*/];
168+
}
169+
});
170+
});
171+
};
172+
return YouHaveBeenStaring;
173+
}(obsidian.Plugin));
174+
var YouHaveBeenStaringSettingsTab = /** @class */ (function (_super) {
175+
__extends(YouHaveBeenStaringSettingsTab, _super);
176+
function YouHaveBeenStaringSettingsTab(app, plugin) {
177+
var _this = _super.call(this, app, plugin) || this;
178+
_this.plugin = plugin;
179+
return _this;
180+
}
181+
YouHaveBeenStaringSettingsTab.prototype.display = function () {
182+
var _this = this;
183+
var containerEl = this.containerEl;
184+
containerEl.empty();
185+
containerEl.createEl('h3', { text: 'YouHaveBeenStaring settings' });
186+
new obsidian.Setting(containerEl)
187+
.setName('Show total staring duration')
188+
.setDesc('Displays the total duration you have been staring on your vault (well at least when this plugin was able to measure it).')
189+
.addToggle(function (toggle) {
190+
return toggle
191+
.setValue(_this.plugin.settings.showTotalUptimeInStatusBar)
192+
.onChange(function (value) {
193+
_this.plugin.settings.showTotalUptimeInStatusBar = value;
194+
if (!value) {
195+
_this.plugin.totalStaringTimeStatusBar.empty();
196+
}
197+
_this.plugin.saveSettings();
198+
});
199+
});
200+
new obsidian.Setting(containerEl)
201+
.setName('Display total recorded staring time as human readable')
202+
.setDesc('The recorded staring time is shown as text, such as \'10 hours\'. Turning this off will show the total recorded time in HH:mm fashion.')
203+
.addToggle(function (toggle) {
204+
return toggle
205+
.setValue(_this.plugin.settings.displayStaringTimeAsHumanString)
206+
.onChange(function (value) {
207+
_this.plugin.settings.displayStaringTimeAsHumanString = value;
208+
_this.plugin.showTotalStaringTime();
209+
_this.plugin.saveSettings();
210+
});
211+
});
212+
new obsidian.Setting(containerEl)
213+
.setName('Status bar text of staring time')
214+
.setDesc('Overrides the status bar text displaying your staring time.')
215+
.addTextArea(function (text) {
216+
return text
217+
.setValue(_this.plugin.settings.staringText)
218+
.setPlaceholder('You have been staring at your vault for ')
219+
.onChange(function (value) {
220+
_this.plugin.settings.staringText = value;
221+
_this.plugin.saveSettings();
222+
});
223+
});
224+
new obsidian.Setting(containerEl)
225+
.setName('Status bar text of total staring time')
226+
.setDesc('Overrides the status bar text displaying your total staring time for this vault.')
227+
.addTextArea(function (text) {
228+
return text
229+
.setValue(_this.plugin.settings.totalStaringText)
230+
.setPlaceholder('Your total staring time in this vault is ')
231+
.onChange(function (value) {
232+
_this.plugin.settings.totalStaringText = value;
233+
_this.plugin.saveSettings();
234+
});
235+
});
236+
new obsidian.Setting(containerEl)
237+
.setName('Status bar text when staring counter is paused')
238+
.setDesc('Overrides the status bar text shown when you disabled the staring time counting.')
239+
.addTextArea(function (text) {
240+
return text
241+
.setValue(_this.plugin.settings.pausedText)
242+
.setPlaceholder('Your staring counter is paused')
243+
.onChange(function (value) {
244+
_this.plugin.settings.pausedText = value;
245+
_this.plugin.saveSettings();
246+
});
247+
});
248+
};
249+
return YouHaveBeenStaringSettingsTab;
250+
}(obsidian.PluginSettingTab));
251+
252+
module.exports = YouHaveBeenStaring;
253+
254+
255+
/* nosourcemap */
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"id": "youhavebeenstaring-plugin",
3+
"name": "YouHaveBeenStaring",
4+
"version": "1.2.2",
5+
"minAppVersion": "0.9.12",
6+
"description": "This plugin tells you in the status bar for how long you've been staring at your obsidian vault. Well - at least how long your vault is open.",
7+
"author": "Felix Almer",
8+
"authorUrl": "https://almer.dev",
9+
"isDesktopOnly": false
10+
}

0 commit comments

Comments
 (0)