summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIndrajith K L2022-11-21 05:37:45 +0530
committerIndrajith K L2022-11-21 05:37:45 +0530
commitfa4cd7ef759d97f5ea1cced7433c2b8e9ef96e6e (patch)
tree821d3af0b59a36f67fe9f75ca3bcab576cc96520
parent0c4bf9cfcba4bf9245bafd9e0891c5939908b178 (diff)
downloadwindows-dot-files-fa4cd7ef759d97f5ea1cced7433c2b8e9ef96e6e.tar.gz
windows-dot-files-fa4cd7ef759d97f5ea1cced7433c2b8e9ef96e6e.tar.bz2
windows-dot-files-fa4cd7ef759d97f5ea1cced7433c2b8e9ef96e6e.zip
Adds Alias
* Upload file to 0x0.st * Get Git Last Commit Message * Get Wallpapers from wallheaven
-rw-r--r--powershell/user_profile.ps130
1 files changed, 30 insertions, 0 deletions
diff --git a/powershell/user_profile.ps1 b/powershell/user_profile.ps1
index 9b790e1..2abee8a 100644
--- a/powershell/user_profile.ps1
+++ b/powershell/user_profile.ps1
@@ -13,6 +13,8 @@ Set-Alias htop ntop
Set-Alias -Name lv -Value Love2D
Set-Alias guid New-Guid
Set-Alias exif 'C:\tools\exiftool(-k).exe'
+Set-Alias -Name upload -Value UploadFile
+Set-Alias -Name getwalls -Value GetWallPapers
## Git Alias
Set-Alias g git
@@ -23,6 +25,7 @@ Set-Alias -Name gbs -Value GitSearchBranch
Set-Alias -Name push -Value GitPush
Set-Alias -Name status -Value GitStatus
Set-Alias -Name pcb -Value PushCurrentBranch
+Set-Alias -Name glm -Value GitLastMessage
function GitDiff {
$output = (git diff --stat) | Out-String
@@ -77,3 +80,30 @@ function PushCurrentBranch {
$originQuery = (git config --get remote.origin.url)
(git push -u $originQuery $branchName)
}
+
+function GitLastMessage {
+ $output = (git log -1)
+ Write-Output $output
+}
+
+function UploadFile {
+ $fileName = $args[0]
+ $output = (curl -F'file=@"'$fileName'"' https://0x0.st)
+ Write-Output $output
+}
+
+function GetWallPapers {
+ $searchQuery = $args[0];
+ $response = Invoke-RestMethod -URI https://wallhaven.cc/api/v1/search?q="$searchQuery"
+ $currentFolder = Get-Location
+ Set-Location -Path "C:\Users\Indrajith\Pictures\wallpapers\wallhaven\"
+ for (($i=0); ($i -lt $response.data.Length); $i++) {
+ $data = $response.data[$i]
+ $currentId = $data.id
+ $filePath = $data.path
+ # Write-Output $currentId
+ (curl $filePath --output "$currentId.jpg")
+ }
+ # Write-Output $response.data
+ Set-Location -Path $currentFolder
+}