Configure powerline to display git status - powerline

I've installed powerline and the default configuration displays my current git branch. I'd also like to display the status of that branch (number of staged/unstaged files etc...) I found powerline-gitstatus which seems to do the job but I can't figure out how to configure it..
I have copied the configuration entries displayed at https://github.com/jaspernbrouwer/powerline-gitstatus#configuration to ~/.config/powerline/themes/shell/default.json as per the instructions provided there.
The next section states
Then you can activate the Gitstatus segment by adding it to your segment configuration, for example in .config/powerline/themes/shell/default.json:
{
"function": "powerline_gitstatus.gitstatus",
"priority": 40
}
That file (.config/powerline/themes/shell/default.json) does not exist so I created it, added that entry, then restarted my shell. It didn't have the desired effect though. I thought maybe I should add that same entry to .config/powerline/config.json but I don't know where in there to put it.
If someone can guide me through this I'd be very grateful.

For me, the default theme did not show any VCS info at all, so I switched to default_leftonly. Using that theme, the following worked for me:
Make sure you have the git_status python module installed:
python3 -m pip install powerline_gitstatus
Create a file ~/.config/powerline/colorschemes/default.json containing
{
"groups": {
"gitstatus": { "fg": "gray8", "bg": "gray2", "attrs": [] },
"gitstatus_branch": { "fg": "gray8", "bg": "gray2", "attrs": [] },
"gitstatus_branch_clean": { "fg": "green", "bg": "gray2", "attrs": [] },
"gitstatus_branch_dirty": { "fg": "gray8", "bg": "gray2", "attrs": [] },
"gitstatus_branch_detached": { "fg": "mediumpurple", "bg": "gray2", "attrs": [] },
"gitstatus_tag": { "fg": "darkcyan", "bg": "gray2", "attrs": [] },
"gitstatus_behind": { "fg": "gray10", "bg": "gray2", "attrs": [] },
"gitstatus_ahead": { "fg": "gray10", "bg": "gray2", "attrs": [] },
"gitstatus_staged": { "fg": "green", "bg": "gray2", "attrs": [] },
"gitstatus_unmerged": { "fg": "brightred", "bg": "gray2", "attrs": [] },
"gitstatus_changed": { "fg": "mediumorange", "bg": "gray2", "attrs": [] },
"gitstatus_untracked": { "fg": "brightestorange", "bg": "gray2", "attrs": [] },
"gitstatus_stashed": { "fg": "darkblue", "bg": "gray2", "attrs": [] },
"gitstatus:divider": { "fg": "gray8", "bg": "gray2", "attrs": [] }
}
}
create a file ~/.config/powerline/themes/shell/default_leftonly.json containing
{
"segments": {
"left": [
{
"function": "powerline.segments.common.net.hostname",
"priority": 10
},
{
"function": "powerline.segments.common.env.user",
"priority": 30
},
{
"function": "powerline.segments.common.env.virtualenv",
"priority": 50
},
{
"function": "powerline_gitstatus.gitstatus",
"priority": 40
},
{
"function": "powerline.segments.shell.cwd",
"priority": 10
},
{
"function": "powerline.segments.shell.jobnum",
"priority": 20
},
{
"function": "powerline.segments.shell.last_pipe_status",
"priority": 10
}
]
}
}
and create a file ~/.config/powerline/config.json containing
{
"ext": {
"shell": {
"theme": "default_leftonly"
}
}
}

I also struggled quite a lot to figure out the right configuration. Once getting it right, I wrote this Article guiding one through the setup of powerline. Including installing the right font and configuring Visual Studio Code. I hope it helps.
To summarize do the following:
Create the directories:
mkdir ~/.config/powerline
mkdir ~/.config/powerline/colorschemes
mkdir ~/.config/powerline/themes
mkdir ~/.config/powerline/themes/shell
Copy the default config files (maybe path has another python version):
cp ~/.local/lib/python3.7/site-packages/powerline/config_files/colorschemes/default.json ~/.config/powerline/colorschemes/
cp ~/.local/lib/python3.7/site-packages/powerline/config_files/colorschemes/solarized.json ~/.config/powerline/colorschemes/
cp ~/.local/lib/python3.7/site-packages/powerline/config_files/themes/shell/default.json ~/.config/powerline/themes/shell/
Add the following lines to both files in ~/.config/powerline/colorschemes
The lines need to be added to the "groups" section, and don't forget the comma in the last line before appending the lines.
"gitstatus": { "fg": "gray8", "bg": "gray2", "attrs": [] },
"gitstatus_branch": { "fg": "gray8", "bg": "gray2", "attrs": [] },
"gitstatus_branch_clean": { "fg": "green", "bg": "gray2", "attrs": [] },
"gitstatus_branch_dirty": { "fg": "gray8", "bg": "gray2", "attrs": [] },
"gitstatus_branch_detached": { "fg": "mediumpurple", "bg": "gray2", "attrs": [] },
"gitstatus_tag": { "fg": "darkcyan", "bg": "gray2", "attrs": [] },
"gitstatus_behind": { "fg": "gray10", "bg": "gray2", "attrs": [] },
"gitstatus_ahead": { "fg": "gray10", "bg": "gray2", "attrs": [] },
"gitstatus_staged": { "fg": "green", "bg": "gray2", "attrs": [] },
"gitstatus_unmerged": { "fg": "brightred", "bg": "gray2", "attrs": [] },
"gitstatus_changed": { "fg": "mediumorange", "bg": "gray2", "attrs": [] },
"gitstatus_untracked": { "fg": "brightestorange", "bg": "gray2", "attrs": [] },
"gitstatus_stashed": { "fg": "darkblue", "bg": "gray2", "attrs": [] },
"gitstatus:divider": { "fg": "gray8", "bg": "gray2", "attrs": [] }
Next, edit the file ~/.config/powerline/themes/shell/default.json
Change:
"function": "powerline.segments.shell.jobnum",
"priority": 20
To:
"function": "powerline_gitstatus.gitstatus",
"priority": 40
Finally, restart the powerline daemon:
powerline-daemon --replace
After that the GIT specific information should be visible within powerline.

Related

not able to notarize electron app using forge

hello I am building electron app for the mac platform and having trouble notarize the app using Forge and getting this error:
Packaging ApplicationWARNING: Code sign failed; please retry manually. Error: Command failed: spctl --assess --type execute --verbose --ignore-cache --no-cache /var/folders/q7//T/electron-packager/darwin-arm64/Integration-darwin-arm64/Integration.app
/var/folders/q7/*/T/electron-packager/darwin-arm64/Integration-darwin-arm64/Integration.app: rejected
source=Unnotarized Developer ID
my forge config
"forge": {
"packagerConfig": {
"appBundleId": "com.anyfolder.integrations",
"osxSign": {
"identity": "Developer ID Application: ****** (****)",
"hardened-runtime": true,
"entitlements": "entitlements.plist",
"entitlements-inherit": "entitlements.plist",
"signature-flags": "library"
},
"osxNotarize": {
"appleId": "myid#id.com",
"appleIdPassword": "my-password"
},
"protocols": [
{
"name": "Any Folder",
"schemes": [
"electron-****"
]
}
],
"icon": "public/images/icon.ico"
},
"publishers": [
{
"name": "#electron-forge/publisher-s3",
"config": {
"bucket": "*******",
"folder": "integrations",
"public": true
}
},
{
"name": "#electron-forge/publisher-github",
"config": {
"repository": {
"owner": "****",
"name": "****"
},
"draft": false,
"prerelease": false
}
}
],
"makers": [
{
"name": "#electron-forge/maker-squirrel",
"config": {
"name": "integrations"
}
},
{
"name": "#electron-forge/maker-dmg",
"config": {
"icon": "public/images/icon.icns",
"format": "ULFO",
"name": "Name",
"overwrite": true,
"debug": true
}
}
],
"plugins": [
[
"#electron-forge/plugin-webpack",
{
"mainConfig": "./webpack.main.config.js",
"renderer": {
"config": "./webpack.renderer.config.js",
"entryPoints": [
{
"html": "./src/render/imageEditor/index.html",
"js": "./src/render/imageEditor/index.tsx",
"name": "capture_window",
"preload": {
"js": "./src/render/imageEditor/preload.ts"
}
},
{
"name": "main_window",
"html": "./src/index.html",
"js": "./src/render/main/index.tsx",
"preload": {
"js": "./src/render/main/preload.ts"
}
},
{
"name": "integrations_menu",
"html": "./src/index.html",
"js": "./src/render/integrations/index.tsx",
"preload": {
"js": "./src/render/integrations/preload.ts"
}
}
]
}
}
]
]
}

Highcharts xAxis has extra gap when multiple yAxis

We have a chart that plots multiple series at once.
There are the main y-series (line type) that will have the main data readings.
There is the option to set two different 'levels' (line types) on the y-axis as well.
There are also options to have multiple additional y-axis bars (bar types).
With the x-axis being the datetime
Here is what a typical example of a chart looks like with valid date for the given range
This is working as expected.
We have the main y-series as the average air temp (left y-axis)
Then we have two bars, one for rainfall and one for irrigation (right y-axis)
And then the two 'levels', one red and one blue.
This is all great.
However, when we go to a date range in the future, where there is no air temp data, we get the following
Note that the start date is 2 days before the date range, and the end date looks equal distance from the end of the 'levels'
Interestingly if we remove the bars we get the following
This now shows the 'levels' to span the full width of the chart
If we remove the lines and just have the bars then we get the following (which is how it should look, but with the 'levels')
There seems to be something in here that is causing the conflict when there are multiple y-series without the main y-series.
I am setting the xAxis.setExtremes to the start and end dates of the date range we are looking at, but that seems to be doing nothing.
Here is the config;
{
"chart": {
"type":"line",
"animation": {
"duration":150
},
"events":{}
},
"credits":{
"enabled":false
},
"title":{
"text":""
},
"subtitle":{
"text":""
},
"tooltip":{
"shared":true,
"crosshairs":true,
"borderWidth":0,
"followPointer":true,
"useHTML":true,
"headerFormat":"<span style=\"font-size: 10px;\">{point.key}</span><br><br>"
},
"xAxis":[
{
"id":"x-axis",
"type":"datetime",
"crosshair":{
"snap":false
},
"title":{
"text":"25th Sep 2019 - 1st Oct 2019",
"margin":15
}
}
],
"yAxis":[
{
"id":"y-axis-sensors",
"title":{
"text":"ºC"
},
"reversed":false,
"visible":true,
"endOnTick":false,
"startOnTick":false,
"alignTicks":false
},
{
"id":"y-axis-moisture",
"title":{
"text":"mm"
},
"opposite":true,
"min":0,
"endOnTick":false,
"startOnTick":false,
"alignTicks":false,
"tickWidth":0,
"gridLineWidth":0
}
],
"series":[
{
"type":"line",
"yAxis":"y-axis-sensors",
"marker":{
"enabled":false
},
"lineWidth":1,
"animation":false,
"name":"Full",
"seriesGroup":"levelSeries",
"id":"series-level-range-full",
"color":"#31B5E0",
"showInLegend":false,
"states":{
"hover":{
"enabled":false
}
},
"enableMouseTracking":false,
"zIndex":5,
"step":true,
"data":[
[1569369600000,5],
[1569974400000,5]
]
},
{
"type":"line",
"yAxis":"y-axis-sensors",
"marker":{
"enabled":false
},
"lineWidth":1,
"animation":false,
"name":"Refill",
"seriesGroup":"levelSeries",
"id":"series-level-range-refill",
"color":"#D23333",
"showInLegend":false,
"states":{
"hover":{
"enabled":false
}
},
"enableMouseTracking":false,
"zIndex":5,
"step":true,
"data":[
[1569369600000,17],
[1569974400000,17]
]
},
{
"type":"column",
"yAxis":"y-axis-moisture",
"marker":{
"enabled":false
},
"name":"Rainfall",
"seriesGroup":"rainfallSeries",
"states":{
"hover":{
"enabled":false
}
},
"id":"series-rainfall",
"pointWidth":6,
"borderWidth":0,
"color":"rgba(41, 182, 246, 0.3)",
"data":[
[1569488400000,5]
],
"zIndex":10,
"stacking":"normal",
"stack":"moisture"
},
{
"type":"column",
"yAxis":"y-axis-moisture",
"marker":{
"enabled":false
},
"states":{
"hover":{
"enabled":false
}
},
"name":"Irrigation",
"seriesGroup":"irrigationSeries",
"id":"series-irrigation",
"pointWidth":6,
"borderWidth":0,
"color":"rgba(205,220,57, 0.3)",
"data":[[1569574800000,3]],
"zIndex":10,
"stacking":"normal",
"stack":"moisture"
}
]
}
I am at a bit of a loss here as to why this is happening.
Can anyone shed some light on this?
One of the solutions can be to add additional x-axis and bind line series to it. Then it looks like your expected result. Check demo and code posted below.
Code:
Highcharts.chart('container', {
"chart": {
"type": "line",
"animation": {
"duration": 150
},
"events": {}
},
"credits": {
"enabled": false
},
"title": {
"text": ""
},
"subtitle": {
"text": ""
},
"tooltip": {
"shared": true,
"crosshairs": true,
"borderWidth": 0,
"followPointer": true,
"useHTML": true,
"headerFormat": "<span style=\"font-size: 10px;\">{point.key}</span><br><br>"
},
"xAxis": [{
"id": "x-axis1",
"type": "datetime",
"crosshair": {
"snap": false
},
"title": {
"text": "25th Sep 2019 - 1st Oct 2019",
"margin": 15
}
}, {
"id": "x-axis2",
visible: false,
"type": "datetime"
}],
"yAxis": [{
"id": "y-axis-sensors",
"title": {
"text": "ºC"
},
"reversed": false,
"visible": true,
"endOnTick": false,
"startOnTick": false,
"alignTicks": false
},
{
"id": "y-axis-moisture",
"title": {
"text": "mm"
},
"opposite": true,
"min": 0,
"endOnTick": false,
"startOnTick": false,
"alignTicks": false,
"tickWidth": 0,
"gridLineWidth": 0
}
],
"series": [
{
"type": "line",
xAxis: 'x-axis2',
"yAxis": "y-axis-sensors",
"marker": {
"enabled": false
},
"lineWidth": 1,
"animation": false,
"name": "Full",
"seriesGroup": "levelSeries",
"id": "series-level-range-full",
"color": "#31B5E0",
"showInLegend": false,
"states": {
"hover": {
"enabled": false
}
},
"enableMouseTracking": false,
"zIndex": 5,
"step": true,
"data": [
[1569369600000, 5],
[1569974400000, 5]
]
},
{
"type": "line",
xAxis: 'x-axis2',
"yAxis": "y-axis-sensors",
"marker": {
"enabled": false
},
"lineWidth": 1,
"animation": false,
"name": "Refill",
"seriesGroup": "levelSeries",
"id": "series-level-range-refill",
"color": "#D23333",
"showInLegend": false,
"states": {
"hover": {
"enabled": false
}
},
"enableMouseTracking": false,
"zIndex": 5,
"step": true,
"data": [
[1569369600000, 17],
[1569974400000, 17]
]
},
{
"type": "column",
xAxis: 'x-axis1',
"yAxis": "y-axis-moisture",
"marker": {
"enabled": false
},
"name": "Rainfall",
"seriesGroup": "rainfallSeries",
"states": {
"hover": {
"enabled": false
}
},
"id": "series-rainfall",
"pointWidth": 6,
"borderWidth": 0,
"color": "rgba(41, 182, 246, 0.3)",
"data": [
[1569488400000, 5]
],
"zIndex": 10,
"stacking": "normal",
"stack": "moisture"
},
{
"type": "column",
xAxis: 'x-axis1',
"yAxis": "y-axis-moisture",
"marker": {
"enabled": false
},
"states": {
"hover": {
"enabled": false
}
},
"name": "Irrigation",
"seriesGroup": "irrigationSeries",
"id": "series-irrigation",
"pointWidth": 6,
"borderWidth": 0,
"color": "rgba(205,220,57, 0.3)",
"data": [
[1569574800000, 3]
],
"zIndex": 10,
"stacking": "normal",
"stack": "moisture"
}
]
});
<script src="https://code.highcharts.com/highcharts.js"></script>
<div id="container"></div>
Demo:
https://jsfiddle.net/BlackLabel/juwc8f37/

Highcharts - column chart has space between bar and xAxis

How can I prevent this space:
I try a lot but no success.
Here is my options:
$('#container').highcharts({
"chart": {
"type": "column"
},
"xAxis": {
"categories": ["1/1/2018", "2/1/2018", "3/1/2018"]
},
"legend": {
"enabled": false
},
"yAxis": {
"categories": []
},
"series": [{
"data": [1, 3, 1]
}]
});
JSFiddle link
Thanks in advance.
Remove the empty category definition on the yAxis to make highchart automatically generate values for the yAxis:
$('#container').highcharts({
"chart": {
"type": "column"
},
"xAxis": {
"categories": ["1/1/2018", "2/1/2018", "3/1/2018"]
},
"legend": {
"enabled": false
},
"yAxis": {
},
"series": [{
"data": [1, 3, 1]
}]
});
JSFiddle working example: http://jsfiddle.net/ewolden/sq1hf68r/

Highcharts column chart. Sometimes unusable 1px stacked columns. Sometimes usable side by side columns

I have a basic column chart. With smaller data sets, the chart displays as it should. See this fiddle:
http://jsfiddle.net/hmg0y2a3/1/
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 600px; height: 400px; margin: 0 auto"></div>
Highcharts.chart('container', {
"chart": {
"type": "column"
},
"title": {
"text": "High Net Income"
},
"xAxis": {
"type": "datetime",
"tickInterval": 604800000,
"dateTimeLabelFormats": {
"millisecond": "%m/%d/%Y",
"second": "%m/%d/%Y",
"minute": "%m/%d/%Y",
"hour": "%m/%d/%Y",
"day": "%m/%d/%Y",
"week": "%m/%d/%Y",
"month": "%m/%d/%Y",
"year": "%m/%d/%Y"
},
"labels": {
"rotation": -45
}
},
"yAxis": {
"min": 0,
"title": {
"text": "Audience Reach"
}
},
"plotOptions": {
"borderWidth": 0,
"pointPadding": 0.2
},
"legend": {
"enabled": false
},
"credits": {
"enabled": false
},
"series": [{
"name": "Distribution Count",
"data": [
[1504342376000, 6403],
[1504423639000, 1086],
[1504510033000, 1089]
]
}, {
"name": "Unique VELO Count",
"data": [
[1504342376000, 2973],
[1504423639000, 597],
[1504510033000, 599]
]
}]
});
I like that it's displaying each series side by side for a specific date.
However, when the data sets get larger, I get skinny little stacked 1px columns and I don't like it one bit, but I don't know what I need to do to keep the columns side by side, not stacked, and have a width that is usable. See this fiddle:
http://jsfiddle.net/hmg0y2a3/
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto">
Highcharts.chart('container', {
"chart": {
"type": "column"
},
"title": {
"text": "High Net Income"
},
"xAxis": {
"type": "datetime",
"tickInterval": 604800000,
"dateTimeLabelFormats": {
"millisecond": "%m/%d/%Y",
"second": "%m/%d/%Y",
"minute": "%m/%d/%Y",
"hour": "%m/%d/%Y",
"day": "%m/%d/%Y",
"week": "%m/%d/%Y",
"month": "%m/%d/%Y",
"year": "%m/%d/%Y"
},
"labels": {
"rotation": -45
}
},
"yAxis": {
"min": 0,
"title": {
"text": "Audience Reach"
}
},
"plotOptions": {
"borderWidth": 0,
"pointPadding": 0.2
},
"legend": {
"enabled": false
},
"credits": {
"enabled": false
},
"series": [{
"name": "Distribution Count",
"data": [
[1504342376000, 6403],
[1504423639000, 1086],
[1504510033000, 1089],
[1504597165000, 1103],
[1504683776000, 1099],
[1504770376000, 1210],
[1504858167000, 1242],
[1504942932000, 1224],
[1505027910000, 1227],
[1505114658000, 1229],
[1505201998000, 1214],
[1505289935000, 1110],
[1505289941000, 1110],
[1505418941000, 930],
[1505419065000, 930]
]
}, {
"name": "Unique VELO Count",
"data": [
[1504342376000, 2973],
[1504423639000, 597],
[1504510033000, 599],
[1504597165000, 598],
[1504683776000, 590],
[1504770376000, 637],
[1504858167000, 636],
[1504942932000, 625],
[1505027910000, 628],
[1505114658000, 639],
[1505201998000, 638],
[1505289935000, 617],
[1505289941000, 617],
[1505418941000, 557],
[1505419065000, 557]
]
}]
});
Try to set static pointWidth: for series object in plotOptions, like below:
"plotOptions": {
"series": {
"pointWidth": 15
},
},
API Reference: http://api.highcharts.com/highcharts/series%3Cbar%3E.pointWidth
Live working: http://jsfiddle.net/daniel_s/qetr9p0p/
Best regards!
The dates in the series were the issue. If I mutate the dates by setting to UTC and truncating to the day, the bars will not stack and they will not be 1px wide if there is over 12 points of data:
time_series = broadcast_data.time_series_data[b];
date = new Date(time_series.broadcast_dt);
date = Date.UTC(date.getFullYear(),date.getMonth(),date.getDate());

Highchart Stacked Column w/ Datetime X-axis Columns Too Thin

I am trying to display to my users the number of videos recorded per day with each one of their cameras. To do so I would like to use a stacked back (each stack showing the # of videos recorded with a given camera). Here are the options I am passing in:
var options = {
"title": {
"text": null
},
"legend": {
"layout": "vertical",
"style": { },
"enabled": false
},
"xAxis": {
"type": "datetime",
"minTickInterval": 86400000
},
"yAxis": {
"stackLabels": { "enabled": true },
"title": { "text": null }
},
"tooltip": { "enabled": true },
"credits": { "enabled": false },
"plotOptions": {
"column": { "stacking": "normal" }
},
"chart": {
"defaultSeriesType": "column",
"height": 200,
"borderRadius": 0,
"renderTo": "monthy_chart"
},
"subtitle": { },
"colors": [ "#c7084b","#089fbf","#00d047","#d300d1","#f48400","#f6f400" ],
"series": [
{
"name": "Camera",
"data": [ [ 1362614400000,6 ],[ 1362528000000,2 ] ]
},
{
"name": "NewCamera2",
"data": [ [ 1362614400000,1 ] ]
}
]
};
The graph displays the data correctly but is rendering the columns extremely narrowly even when there are only 2 days of data (image below). Is there a way for me to deine the scale of the x-axis so the widths of the columns will display a bit better?
http://i.stack.imgur.com/NSSYg.png
You can set pointWidth and startOnTick / endOfTick
http://jsfiddle.net/bLrah/
"xAxis": {
startOnTick:true,
endOnTick:true,
"type": "datetime",
"minTickInterval": 86400000
http://api.highcharts.com/highcharts#xAxis.startOnTick
http://api.highcharts.com/highcharts#xAxis.endOnTick
http://api.highcharts.com/highcharts#plotOptions.column.pointWidth

Resources